body1
stringlengths 20
4.1k
| body2
stringlengths 23
4.09k
|
---|---|
public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); /* runOnUiThread th=new runOnUiThread(new TextChange());*/ final TextView tv=(TextView)findViewById(R.id.tv); runOnUiThread(new Runnable() { @Override public void run() { while(true) { try { Thread.currentThread().sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } Random rand = new Random(); int y=rand.nextInt(100); tv.setText(Integer.toString(y)); } } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } if its a infinite loop then nothing shows up ever (it should have shown a new random number each second) and if I initiate a finite loop only the last number show when the loop gets finished. How to show a new random number on screen every second? | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
From an end-user perspective, what is the difference between a NAS device and using NFS exports from a file server? They seem to accomplish the same end result. The difference between a SAN and other file storage is related (in my experience) to how they are connected to the server infrastructure. However, the difference between a NAS, connecting over a standard ethernet port, and NFS (sharing storage off specific servers, also over the network), seems more nebulous. Is there a good reason to pick a NAS filer over just running NFS on servers? | What is the difference between SAN, NAS and DAS? |
If you send a text on your iphone and then immediately delete it while the synced Mac computer and ipad is off/not connected to Wifi, will the messages still appear in chat on the Mac when you connect it? | If I have my iPad and my iPhone synced through iCloud and I can see that my text messages are being received/sent on both. If I send an iMessage on my iPad and immediately delete the entire text thread on my iPad, does it in turn delete the text threat off of my iPhone? If not, does it show the iMessage I sent from my iPad? Pretty much what happened was I was over my buddy's house and his iPhone and iPad are synced to iCloud. I am assuming this because he had been text messaging me all day and all of the most current text messages were showing on his iPad. I used his iPad to send a text message to my wife with some of our bank account information she needed. I immediately deleted the text thread from the ipad (My wife also has an iPhone so I am assuming it was an iMessage). My question is does this iMessage go to his phone still if I deleted it? Or does it delete from his phone because I deleted it from his iPad? |
There are quite a few commands that take subcommands (e.g., git, or task from taskwarrior). Sometimes I have a terminal window that is devoted entirely to running this command with varying subcommands. What I wish is that I would not always need to type the main command. Let me explain this with an example from taskwarrior (a “todo list manager”): $ task add proj:job +hard Refactor the API -- Add task to project 'job' tagged 'hard' $ task proj:job +easy add prio:H Fix typo in README -- Tag is 'easy', priority 'high' $ task proj:job next -- List tasks in project 'job', ordered by 'urgency' As you can see, task is quite flexible in where the subcommand (e.g., add or next) can be placed. Now, if I'm working on a certain project (say 'job') then I would like to drill down. Something like: $ CONTEXT="task proj:job" [task proj:job] $ add +hard Refactor the API [task proj:job] $ +easy add prio:H Fix typo in README [task proj:job] $ next The title of this question is very broad (suggesting you might want to run a sed-script over your command before executing it). However, I would be very happy with one of the following: I can set some variable (like CONTEXT in the example) whose value is prepended to every command, before running it. Alternatively, and even better, the value of CONTEXT could be filled in on the command line before I start typing my commands. In that way, I can occasionaly hit backspace or Ctrl-U if I want to run a command outside of my context. Q. Is there a shell (preferably bash-like, for example zsh) that has the described feature? | I am trying to create a program which require such feature. The flow will be like: User enter a bash command User hit the enter My script will get command, current directory,.. as variables. Program can optionally modify the command. Modified command will get executed normally. Is there any way to do this? Note: I need this for my personal use, I am not going to distribute this program. |
Importing with configuration: ind_adm2, public, geom, C:\Program Files\OpenGeo\OpenGeo Suite\webapps\geoserver\india map\IND_adm2, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=0 Shapefile type: Polygon PostGIS type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."ind_adm2" (gid serial, "id_0" int4, "iso" varchar(3), "name_0" varchar(75), "id_1" int4, "name_1" varchar(75), "id_2" int4, "name_2" varchar(75), "nl_name_2"" Failed in pgui_exec(): ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 17: SELECT AddGeometryColumn('public','ind_adm2','geom','0','MUL... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. Shapefile import failed. | I've tried this a few different ways and keep getting the same error. I have a shapefile currently in WGS84 UTM Zone 15 which is SRID 32615. I used the ArcMap multipart to singlepart tool to create a singlepart polygon. I followed the instructions found at to install postgresql and postgis. I open pgAdmin III and select the postgis_21_sample table. Plugins > PostGIS Shapefile and DBF Loader 21. I check connection details and it connects fine. I add my .shp file. I set Schema to public and Table to postgis_21_sample. I leave geo column alone and set SRID to 3265. When I click import I get ============================== Importing with configuration: postgis_21_sample, public, geom, C:\GIS\forest_buffer\postgres_single.shp, mode=c, dump=1, simple=0, geography=0, index=1, shape=1, srid=3265 Shapefile type: Polygon PostGIS type: MULTIPOLYGON[2] Failed SQL begins: "SET CLIENT_ENCODING TO UTF8; SET STANDARD_CONFORMING_STRINGS TO ON; BEGIN; CREATE TABLE "public"."postgis_21_sample" (gid serial, "shape_leng" numeric, "shape_area" numeric, "orig_fid" int4); ALTER TABLE "public"."postgis_21_sample" ADD PRIMARY KEY (gid);" Failed in pgui_exec(): ERROR: function addgeometrycolumn(unknown, unknown, unknown, unknown, unknown, integer) does not exist LINE 9: SELECT AddGeometryColumn('public','postgis_21_sample','geom'... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. Shapefile import failed. I've also tried projecting this shapefile to WGS84 with SRID 4326 and receive the same error. There are >100,000 features and I need to buffer, dissolve, negative buffer, and finally buffer back to the original size to fill gaps. ArcMap and QGIS fail to do it after days of waiting. |
When I try the command drush sql:sync @dev.dev @self or drush sql:sync @dev.dev @local it errors with: Undefined class constant 'MYSQL_ATTR_SSL_CA' in Drush\Sql\SqlMysql->creds() (line 60 of /Users/kevinquillen/Servers/foo/vendor/drush/drush/src/Sql/SqlMysql.php). [error] Drush command terminated abnormally due to an unrecoverable error. [5.47 sec, 7.92 MB] [error] Failed to import /tmp/foo_20180405_152230.sql.gz into target. [5.48 sec, 7.91 MB] Previously, I could do drush sql-sync @source @destination and it worked just fine (from the host OS). Not really sure where to go from here, I recently upgraded from Drush 8 to 9. The problem also happens on another project. drush @local sql:connect -vvv works. A basic query with sql:query also works. Why can't I sync from remote to local anymore after the upgrade? Remote environment: Acquia Cloud Local environment: DrupalVM DrupalVM config.yml: # Update the hostname to the local development environment hostname. vagrant_hostname: local.mysite.com vagrant_machine_name: mysite # Set the IP address so it doesn't conflict with other Drupal VM instances. vagrant_ip: 0.0.0.0 # Use Ubuntu 16.04 LTS to match Acquia Cloud environments. vagrant_box: geerlingguy/ubuntu1604 # Set drupal_site_name to the project's human-readable name. drupal_site_name: "My Site" # Provide the path to the project root to Vagrant. vagrant_synced_folders: # Set the local_path for the first synced folder to `.`. - local_path: . # Set the destination to the Acquia Cloud subscription machine name. destination: /var/www/mysite type: nfs drupal_build_composer_project: false # Toggling this to `true` would invoke `composer install` with the # projects own `composer.json` successfully. drupal_build_composer: false drupal_composer_path: false drupal_composer_install_dir: "/var/www/mysite" drupal_core_path: "/var/www/mysite/docroot" ssh_home: /var/www/mysite drupal_db_user: drupal drupal_db_password: drupal drupal_db_name: drupal # Set this to 'false' if you don't need to install drupal (using the drupal_* # settings below), but instead copy down a database (e.g. using drush sql-sync). drupal_install_site: false # Drupal VM automatically creates a drush alias file in your ~/.drush folder if # this variable is 'true'. configure_drush_aliases: false # This is required for front-end building tools. nodejs_version: "9.x" nodejs_npm_global_packages: - name: bower - name: gulp-cli - name: yarn nodejs_install_npm_user: "{{ drupalvm_user }}" npm_config_prefix: "/home/{{ drupalvm_user }}/.npm-global" installed_extras: #- adminer - drupalconsole - drush - mailhog - memcached - nodejs #- solr #- selenium - xdebug # PHP 5.6 (PHP 7.1 is being tested, see: https://docs.acquia.com/node/25726). php_version: "7.1" php_install_recommends: no php_memory_limit: "256M" php_display_errors: "On" php_display_startup_errors: "On" php_realpath_cache_size: "1024K" php_sendmail_path: "/opt/mailhog/mhsendmail" php_opcache_enabled_in_ini: true php_opcache_memory_consumption: "192" php_opcache_max_accelerated_files: 4096 php_max_input_vars: "4000" php_packages_extra: - "php{{ php_version }}-bz2" - "php{{ php_version }}-imagick" - imagemagick # XDebug configuration. # Change this value to 1 in order to enable xdebug by default. php_xdebug_default_enable: 1 php_xdebug_coverage_enable: 0 # Change this value to 1 in order to enable xdebug on the cli. php_xdebug_cli_enable: 0 php_xdebug_remote_enable: 1 php_xdebug_remote_connect_back: 1 # Use PHPSTORM for PHPStorm, sublime.xdebug for Sublime Text. php_xdebug_idekey: PHPSTORM php_xdebug_max_nesting_level: 256 php_xdebug_remote_port: "9000" post_provision_scripts: - "../../../acquia/blt/scripts/drupal-vm/post-provision.php" | I tried installing Drush with both methods listed in the drush.org documentation. I think they might be conflicting with each other if that's possible. When I run composer global require drush/drush all the components appear to install correctly. However when I change to a Drupal site (Using XAMPP, /opt/lampp/htdocs/sitefolder) and run drush status I get the following error: PHP Fatal error: Undefined class constant 'MYSQL_ATTR_SSL_CA' in phar:///usr/local/bin/drush/lib/Drush/Sql/Sqlmysql.php on line 56 Drush command terminated abnormally due to an unrecoverable error. [error] Error: Undefined class constant 'MYSQL_ATTR_SSL_CA' in phar:///usr/local/bin/drush/lib/Drush/Sql/Sqlmysql.php, line 56 I do have the following line in my ~/.bashrc: export PATH="$HOME/.composer/vendor/bin:$PATH" Unfortunately I don't know how to troubleshoot from here, as there doesn't seem to be an easy way to uninstall Drush via the main method (), which didn't seem to work for me. composer global remove drush/drush does appear to run successfully. Thanks in advance. |
How to catch alternative into the nested group? I want to return first capturing group of: (.*)((core\/)?\/misc\/drupal\.js) (i.e. anything before the string core/misc/drupal.js which may or might not contain core/). However, the core/ part always gets included to the first capturing group and not the second as supposed. See also for an example. | I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}: The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}? |
I installed Ubuntu 13.04 over my Ubuntu 12.04 installation. I had divided my hard drive into three partitions but when I reinstalled without formatting the disk, it made a single partition and I lost all my data. Is any way to recover my data? | I have a Toshiba satellite A-200 laptop with a Vista OS on it with 4 NTFS partitions (C:) Vista (D:) Entertainment (E:) Work (F:) Sources and I wanted to start using Ubuntu instead. So I tried it first from the live CD and everything was OK and all the partitions were shown and working and so I decided to install Ubuntu to replace Vista on the (C:) drive. After I did that I can no longer find my folders and files on the (D:), (E:), (F:) partitions and the only file system that is shown is one 198 GB although my HDD is 320 GB. I can't access the lost data on the remaining 120 GB which I hope is still there and not totally lost I am now working from the live CD but I am unable to install testdisk. Can I recover the Vista partitions by the product recovery CD to get my laptop back to the factory settings? Can I recover the NTFS partitions using a recovery program for Windows or will that make the problem worse? I need these data badly as I don't have a backup for them. |
I'm working through the course Bayesian Statistics: From Concept to Data Analysis by the University of California, Santa Cruz and there is a that requires me to use R or Excel to find the answer to this: Let $Y ∼ Gamma(2, 1/3)$. Find $P(0.5 < Y < 1.5)$. The answer is given as 0.078. I would like to calculate this using Python. I have tried from scipy import stats stats.gamma.cdf(1.5,1/3,scale=2) - stats.gamma.cdf(0.5,1/3,scale=2) which returns 0.197. I've also tried switching the 2 and the 1/3. Note I am using Python 3.5.3 |Anaconda 2.5.0 (64-bit)| (default, May 15 2017, 10:43:23) [MSC v.1900 64 bit (AMD64)] on win32 What am I doing wrong? | There is something that I am doing wrong in the exercise below and I would appreciate some help figuring it out. Let $X_1, X_2, \ldots, X_5$ be a random sample from a $\Gamma \left(3,3 \right)$ distribution . Define $W=\sum_{i=1}^5 X_i $. Obtain the distribution of $W$ and of $2W/3$ Find $c_1$ and $c_2$ such that $P \left( c_1 < W <c_2 \right)=0.95 $ Since $W$ is the sum of iid gamma variables, $W \sim \Gamma \left(15,3 \right)$ and now a straightforward transformation argument shows that $Y=\frac{2}{3} W \sim \chi^2 \left(30 \right) $. This completes question 1. Now for question 2, my thoughts were to transform these probabilities using the result from question 1, namely that $\frac{2}{3} W \sim \chi^2 \left(30 \right) $. Hence, unless I have made a horrible mistake here: $$P \left( \frac{2}{3} c_1 < Y < \frac{2}{3} c_2 \right)=0.95 $$ We can find the constants from a chisquare table for $30$ degrees of freedom. In my case, they are $16.791$ for the lower bound and $46.979$ for the upper one. Then if we equate $\frac{2}{3}c_1=16.791$ and solve for $c_1$ we should be able to find the constant for the above gamma confidence interval, right? The problem is that according to $R$, $P \left( W<c_1 \right) =1 $, instead of the desired $0.025$ which means I have gone wrong somewhere. I do not think it is in question though $1$ as I have verified the result many times. Thank you. |
I have a string variable, selectors, holding class selectors: .class1,.class2,.class3 I'd like to selectively remove classes from that list depending on certain criteria (e.g. a user clicks button #2 and it removes .class2 from the list). I'm having trouble coming up with the regular expression that allows for an optional comma at the front of the string to be removed. Here's what I've got: var toRemove = '.class2'; var re = new RegExp(/\,\?/toRemove, 'gi'); newSelectors = selectors.replace(re, ''); I realize I'm probably screwing up trying to combine a pattern match with a variable, but I'm not entirely sure how to handle that. | I would like to create a String.replaceAll() method in JavaScript and I'm thinking that using a regex would be most terse way to do it. However, I can't figure out how to pass a variable in to a regex. I can do this already which will replace all the instances of "B" with "A". "ABABAB".replace(/B/g, "A"); But I want to do something like this: String.prototype.replaceAll = function(replaceThis, withThis) { this.replace(/replaceThis/g, withThis); }; But obviously this will only replace the text "replaceThis"...so how do I pass this variable in to my regex string? |
I'm trying to insert a citation after a definition/theorem in the beamer class to resemble the following: Definition [1] Here is my definition. I can partially accomplish the above using \begin{definition}[\cite{ref_01}] but this yields Definition ([1]) with an additional set of brackets. Is there anyway of selectively removing the additional round brackets? | I would like to get rid of the around the optinal header material in my theorem environment. Here is a MWE \documentclass{beamer} \begin{document} \setbeamertemplate{theorems}[numbered] \newtheorem{MyHypo}{Hypothesis} \begin{frame} \begin{MyHypo}[insert text] This is my hypothesis \end{MyHypo} \end{frame} \end{document} Is there another option for the setbeamertemplate to keep the numbering but avoid the ( ) for the text? |
I called sudo apt-get update, i got something like this Err http: //ppa.launchpad.net trusty/main i386 Packages 404 Not Found this Err http: //ppa.launchpad.net trusty/main i386 Packages 404 Not Found and this is what the last line look like W: Failed to fetch http: //ppa.launchpad.net/marlin-devs/marlin-daily/ubuntu/dists/trusty/main/binary-i386/Packages 404 Not Found W: Failed to fetch http: //ppa.launchpad.net/tiheum/equinox/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. SO, anyone can help me?? FYI, this is from Ubuntu 14.04 | When running sudo apt-get update I get these following errors: Err archive.ubuntu.com quantal InRelease Err archive.ubuntu.com quantal-updates InRelease Err archive.ubuntu.com quantal-backports InRelease Err archive.ubuntu.com quantal-security InRelease Err archive.ubuntu.com quantal Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Err archive.ubuntu.com quantal-updates Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Err archive.ubuntu.com quantal-backports Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Err archive.ubuntu.com quantal-security Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Reading package lists... Done W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal/InRelease W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-updates/InRelease W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-backports/InRelease W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-security/InRelease W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-updates/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-backports/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-security/Release.gpg Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Some index files failed to download. They have been ignored, or old ones used instead. I am using Ubuntu 12.04. This is the command I used after installing Ubuntu from window installer. I am sure my laptop is connected to internet. What can I do now? |
I made a class: class configurations { public double lowColumn1 = -1; public double highColumn1 = -1; public double lowColumn2 = -1; public double highColumn2 = -1; public double lowColumn3 = -1; public double highColumn3 = -1; } I want to make an array (con1), and make a copy of it (con2). I would like to change con2 so it will not change con1. I think it is called deep copy, is it? It is important that the copy will not consume a lot of running time, efficiency is important. I tried .Clone() function which didn't help me. Please tell me what is the most efficient way to adjust my code. private void button8_Click(object sender, EventArgs e) { configurations[] con1 = new configurations[3]; con1[0] = new configurations(); con1[1] = new configurations(); con1[2] = new configurations(); configurations [] con2 = new configurations [3]; con2 = (configurations[]) con1.Clone(); con2[0].highColumn1 = 999; } please do not make this as a duplicate. my program is very heavy and in other topics they do not discuss time efficiency. in addition to this aspect. i am very new to programming, and i couldn't made adjustments from other answers of other questions. | I want to do something like: MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone(); And then make changes to the new object that are not reflected in the original object. I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object and then copying each property individually, but it always leaves me with the feeling that there is a better or more elegant way of handling the situation. How can I clone or deep copy an object so that the cloned object can be modified without any changes being reflected in the original object? |
If two triangles $ABC$ and $DEF$ are such that the perpendicular from $A,B,C$ to $EF,FD,DE$ are congruent, prove that the perpendiculars from $D,E,F$ to $BC,CA,AB$ are concurrent. Source: Challenge and Thrills of pre-college mathematics. Thanks in advance! | Let $ABC$ and $PQR$ be any two triangles in the same plane. Assume that the perpendiculars from the points $A,B,C$ to the sides $QR,RP,PQ$, respectively, are concurrent. Prove that the perpendiculars from $P,Q,R$ to $BC,CA,AB$ respectively are also concurrent. I was suggested to prove this using vectors. But I have no idea how to use them... |
I have a process I want to start from Java. The problem is that due to a mismatch between the remote desktop client and the process I want to start I need to modify the environment variables. I will not use this in production, but only for running tests. I will also just do this until this bug is fixed in the tool I use. I do not have root access and I am using Linux RHEL7. Anyone having an idea how I can set this environment variable from Java? I should also add that I run this from an IDE. The following answer was not very helpful due to the lack of actual examples: and the following example was not able to set the variables in the scope I needed to set them: I tried this, Process p = Runtime.getRuntime().exec("setenv " + name + " " + value); But get the following error message, java.io.IOException: Cannot run program "setenv": error=2, No such file or directory EDIT: Someone suggested this post, Unfortunately I do not find any solutions in there. The process I want to start already have a Java API, which does not work in my environment. What I want is an equivalent to the linux command, setenv NAME VALUE for the process which java runs in. | How do I set environment variables from Java? I see that I can do this for subprocesses using . I have several subprocesses to start, though, so I'd rather modify the current process's environment and let the subprocesses inherit it. There's a System.getenv(String) for getting a single environment variable. I can also get a Map of the complete set of environment variables with System.getenv(). But, calling put() on that Map throws an UnsupportedOperationException -- apparently they mean for the environment to be read only. And, there's no System.setenv(). So, is there any way to set environment variables in the currently running process? If so, how? If not, what's the rationale? (Is it because this is Java and therefore I shouldn't be doing evil nonportable obsolete things like touching my environment?) And if not, any good suggestions for managing the environment variable changes that I'm going to need to be feeding to several subprocesses? |
Could you please give me hints may leads to prove the following: Let $X$ be a real vector space, $\,p_1,p_2:X\to\mathbb R\,$ be two , and $\,f:X\to\mathbb R\,$ be a linear functional satisfying $$ f(x)\le p_1(x)+p_2(x), \quad\text{for all $\,x\in X$.} $$ Prove that there exist two linear functionals $\,f_1,f_2:X\to\mathbb R$, such that $\,f=f_1+f_2\,$ and $\,f_i(x)\le p_i(x),\,$ for $i\in\{1,2\}$ and $x\in X$. I think we should use Hahn-Banach Theorem. Thanks in advance. | Let $X$ be a linear space, $p, q$ sublinear functionals on $X$, and $L$ a linear functional on $X$ such that $|L(x)| ≤ p(x) + q(x),$ for all $x ∈ X$. Prove that there exist linear functionals $L_1, L_2$ on $X$ such that $L(x) = L_1(x) + L_2(x),$ and $|L_1(x)| ≤ p(x), |L_2(x)| ≤ q(x),$ for all $x ∈ X.$ My Work: First I thought to use Hahn Banach Theorem. But since there is no known subspace it was useless. Then I tried to make $L(x)$ as $L(x)=\frac{L(x+\lambda)+L(x-\lambda)}{2}$ for some scalar $\lambda$ but failed to find suitable $L_1$ and $L_2$. I think this problem is little bit tricky. I want to try it myself and I only need a hint to start. Can somebody please give me a hint? |
This code what i am using to send mail but unfortunately mail goes to spam folder. I tried both gmail and hotmail but case is same . php code is: <?php if($_POST) { //check if its an ajax request, exit if not if(!isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { die(); } $to_Email = "[email protected]"; //Replace with recipient email address $subject = 'My email from Somebody out there...'; //Subject line for emails //check $_POST vars are set, exit if any missing if(!isset($_POST["userName"]) || !isset($_POST["userEmail"]) || !isset($_POST["userMessage"])) { die(); } //Sanitize input data using PHP filter_var(). $user_Name = filter_var($_POST["userName"], FILTER_SANITIZE_STRING); $user_Email = filter_var($_POST["userEmail"], FILTER_SANITIZE_EMAIL); $user_Message = filter_var($_POST["userMessage"], FILTER_SANITIZE_STRING); //additional php validation if(strlen($user_Name)<4) // If length is less than 4 it will throw an HTTP error. { header('HTTP/1.1 500 Name is too short or empty!'); exit(); } if(!filter_var($user_Email, FILTER_VALIDATE_EMAIL)) //email validation { header('HTTP/1.1 500 Please enter a valid email!'); exit(); } if(strlen($user_Message)<5) //check emtpy message { header('HTTP/1.1 500 Too short message! Please enter something.'); exit(); } //proceed with PHP email. $headers = 'From: '.$user_Email.''; @$sentMail = mail($to_Email, $subject, $user_Message .' -'.$user_Name, $headers); if(!$sentMail) { header('HTTP/1.1 500 Could not send mail! Sorry..'); exit(); }else{ echo 'Hi '.$user_Name .', Thank you for your email! '; echo 'Your email has already arrived in my Inbox, all I need to do is Check it.'; } } ?> Is there any missing function which i need to add or modify to solve this problem | This is a tricky one and I've always relied on techniques, such as permission-based emails (i.e. only sending to people you have permission to send to) and not using blatantly spamish terminology. Of late, some of the emails I send out programmatically have started being shuffled into people's spam folder automatically and I'm wondering what I can do about it. This is despite the fact that these particular emails are not ones that humans would mark as spam, specifically, they are emails that contain license keys that people have paid good money for, so I don't think they're going to consider them spam I figure this is a big topic in which I am essentially an ignorant simpleton. |
My device is stuck in bootloop and my USB debugging is disabled. When I type adb devices in CMD, it says adb is not recognized as an internal or external command operable program or batch file. Please help | When it comes to , I often read recommendations like "Use adb logcat to find some more details". Looking for a good way to backup all my apps including their data, refers to adb backup and adb restore. In several places one can find ways to remotely do on an Android device with the use of , such as transferring files using adb push or adb pull, accessing the via adb shell, and more. So ADB seems to be a good thing to have for an Android user. But how to get this "ADB thingy" on my computer? Not being a developer, installing the entire seems a bit overkill. Is there a more minimalistic approach available? |
For a few month now, the sound doesn't work on my Ubuntu 16.04. I tried some things to resolved that but I can't remember what I did. Today, I checked my CPU usage as every day and I saw PulseAudio with 10-15% of CPU usage but I don't use it (sound off/no source of sound is running). If someone has a idea and/or a solution for this huge CPU usage, i'll be grateful. | On Ubuntu 16.04.3 LTS Pulseaudio causes Xorg to use 100% CPU. After disabling autospawn in /etc/pulse/client.conf and killing pulseaudio CPU immediately drops to acceptable level. After restarting pulseaudio Xorg returns to 100% CPU. pulseaudio --kill pulseaudio --start Installed versions: pulseaudio 1:8.0-0ubuntu3.7 xorg 1:7.7+13ubuntu3 nvidia-390 390.30-0ubuntu1 How to fix this? |
I went through some books and found this problem. I am unable, and am really curious to see the proof. There are 3 different colored balls in an urn: Red, Blue and Green. There are 6 reds, 7 blues and 8 green. Balls are drawn until one color is completely drawn. Find with proof the probability that all the blue balls are drawn first. | Suppose that a box contains 10 red balls, 20 green balls, and 30 blue balls. Suppose also that balls are drawn from the box one at a time at random. What is the probability that all the red balls are drawn before the blue or green balls are themselves exhausted. What is the probability that as the last red ball is drawn, there remains at least one blue and one green left in the box. The answer I was given is $\dfrac{7}{12}$ and a general equation is: $$ \dfrac{b g}{1-b}+\dfrac{b g}{1-g} $$ where $$ g=\dfrac{20}{60},b=\dfrac{30}{60} $$ but why? |
This is a fairly simple problem to explain but it is really annoying me and I could do with some advice. How to I ensure that apache is user : group owner of a dir no matter who uploads to it.. the reason is that WinSCP is used to upload files to /usr/local/bin/builder and this sets the user to root and the group to root. Don't cry I am logging in as root on WinSCP because it is fine for my purposes. I am happy with it. I understand what I am doing by using it and it's my choice to use it. I have 100+ servers and I don't want to introduce too much complexity so I keep it to this: root logs in on WinSCP if you don't think/want/agree that's great but this question is not for you. I then have to manually login on putty as root and # chown -R apache:apache /usr/local/bin/builder in order for apache to have the permissions it needs to this dir. Which apache must or it will cause great evil to befall the server, which will make me have to stop going out or get back into the car at the cinema when I get customers saying the message of doom has reappeared (and I don't go out enough). Now. How do I make it so that at all times chown -R apache:apache /usr/local/bin/builder is true? the only way I feel I can do it is using to imediately run a script but my heart says there must be a better way - I have also thought of maybe adding some sort of script within WinSCP but I have no idea how to do this and seems rather eventful. One last little addendum: (PS: crontab-as-a-solution is a joke beyond epic proportions and I won't countenance it, it makes me cringe you considered it! shame on you!) | I saw several threads about having issues with unexpected file permissions after file upload. I tried their solutions with no luck, I have to raise the problem in my way. I run Nginx as nobody:nogroup on Debian 6. I changed the root web folder /usr/share/nginx/html to nobody:nogroup. Now I use WinSCP to upload file to the machine , but I use root account. If I create a new directory or update a new file, the ownership would be root:root. I am new to Linux world, I currently open a shell to change ownership of wwwroot after I have uploaded something to my server. What is the best practice to upload file as root, but keep files and directories nobody:nogroup? Shall I set a password to account nobody and use this account to upload files? |
I am trying to evaluate $$\lim\limits_{x\to \infty}x^2 \left( a^{1 \over x} - a^{1 \over x+1} \right)$$ for $a>0$. The idea: $$a^{1 \over x} = e^{\ln{a^{1 \over x}}}=e^{{1 \over x}\ln{a}} = 1 + {\ln{a} \over x} + {1 \over 2}{(\ln{a})^2 \over x^2}+{1 \over 6}{(\ln{a})^3 \over x^3}+\dots$$ $$a^{1 \over x}-a^{1 \over x+1} = e^{\ln{a^{1 \over x}}}-e^{\ln{a^{1 \over x+1}}}=e^{{1 \over x}\ln{a}}-e^{{1 \over x+1}\ln{a}} = \ln{a} \left({1\over x} - {1 \over x+1} \right)+ {1 \over 2}(\ln{a})^2\left({ {1\over x^2} - {1 \over (x+1)^2}}\right)+{1 \over 6}(\ln{a})^3\left({ {1\over x^3} - {1 \over (x+1)^3}}\right)+\dots$$ $$x^2 \left(a^{1 \over x}-a^{1 \over x+1}\right) =\ln{a} \left(x - {x^2 \over x+1} \right)+ {1 \over 2}(\ln{a})^2\left({ 1 - {x^2 \over (x+1)^2}}\right)+{1 \over 6}(\ln{a})^3\left({ {1\over x} - {x^2 \over (x+1)^3}}\right)+\dots$$ This is where I get stuck. I suppose the whole sum should converge to $\ln{a}$ but can't quite find the way to get there. I would appreciate any comments. | I have a little problem with limit of this function: $\lim_{x \to \infty} x^2(2017^{\frac{1}{x}} - 2017^{\frac{1}{x+1}})$ I have tried de L'Hopital rule twice, but it doesn't work. Now I have no idea how to do it. |
I cannot seem to find an appropriate verb to use for a professor when he holds an exam, quiz, etc. so that students take it and get evaluated. Can we say a professor takes an exam? I suppose this is for the student side, right? Then, what is the verb for a professor? | As a student you take exams and a professors sets the question. So he is the one who is the authority on the exam. I am looking for a word which can be used in the following sentence- Professor Charles ____________ three exams last month. If I were to translate from my first language, I would use took, but this seems ambiguous because it is students who take exams. Other words that I thought of but am not sure about are gave, and set. Which word should I use? |
I'm disappointed that a couple days ago I answered a reasonable question about git, only to have the user then delete the question instead up upvoting or accepting my answer. I had responded to several follow-up questions and clarifications, and in that time no one else had participated at all. I invested a fair bit of time into that, and now I have nothing to show for it, and that knowledge is lost for everyone. Why would a user do that? Is it wise to let questions and answers disappear like this? Here was the link to the question at hand: | Today I was looking at the question of this . The question was pretty simple, he was looking for the eval function in not knowing of it's existence. He received a comment and while I was finishing reading the question, I saw him commenting Thanks, eval() is what I was looking for. and then he deleted his question. In my opinion, such behavior isn't appropriate. So, should I just ignore this or can I do something about it? |
"Hello Tamanna" will always be in the center after zooming in or out | I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found some solutions, but all of them are missing Internet Explorer 6 support. <body> <div>Div to be aligned vertically</div> </body> How can I center a div vertically in all major browsers, including Internet Explorer 6? |
I would like to colorize my ssh banner. I know I can perform it like so: In /etc/profile I can put: echo -e "\e[1;31m Colorful text" echo -e "\e[0m Reset" But I have some ASCII art in the banner with special characters. Is there any way to colorize this without escaping every single special char in the ASCII art? | It's possible to configure a banner for sshd that is to be displayed as a connection is opened, via Banner /etc/motd.ssh in sshd_config. Note that this is displayed before the authentication occurs, and even when an interactive shell is not launched (e.g. via scp). If this banner contains characters outside of the printable ASCII range, they seem to be escaped, however. Is there any way to either disable this escaping, or an alternative way to send textual output back to the client on connection which supports such characters outside of the printable-ASCII range? This would be useful both for colour escape sequences and Unicode characters. Related: (not a duplicate, however, as this question is about another kind of banner, not about color) |
The Sony NEX-5R has an "AEL w/ shutter" option that Sets whether or not to fix the exposure when you press the shutter button halfway down (On/Off) (from the manual) What are the pros and cons to locking the exposure? Under what situations does it help, or not help? I can think of specific examples where locking exposure helps, and examples where it hurts, but I wanted to check if there's a bigger picture I'm missing. As I understand, this setting controls only the exposure and not the focus, which is controlled by setting the focus mode to AF-S or AF-C. Note that this camera doesn't have an AEL or AE/AF lock button. | What are the typical situations where you should use AE for locking exposure? |
Can anyone help me? I want to create 2 classes which need each other like: class CBullet{ public: bool DetectCollision(CEnemy enemy){ //some code here } }; and class CEnemy{ public: CBullet *shootedBullet; }; this creating an error. I know the reason for this error is because CBullet class want to use CEnemy class which is not created yet. So, i try to create a prototype of CEnemy class before CBullet class like: class CEnemy; class CBullet{ ... but it create another error enemy has incomplete type. Did I make a wrong prototype class? | I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file: Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ? |
Let be $f:[0,\infty[ \rightarrow \mathbb{R}$ a decreasing and continuos, $f(x)>0 , \forall x$. If $\displaystyle \int_0^{\infty}f(x)dx$ converges then $\displaystyle \lim_{x \rightarrow \infty} xf(x) = 0.$ How to prove that? Ok, I know that if $G(x) = \displaystyle \int_0^{x}f(t)dt $ then $ \displaystyle \lim_{x \rightarrow \infty} G(x) = L$, How can I use that for arrive in $xf(x)$?? | Let $f:\mathbb{R}_+ \to \mathbb{R}_+$ be a monotone decreasing function defined on the positive real numbers with $$\int_0^\infty f(x)dx <\infty.$$ Show that $$\lim_{x\to\infty} xf(x)=0.$$ This is my proof: Suppose not. Then there is $\varepsilon$ such that for any $M>0$ there exists $x\geq M$ such that $xf(x)\geq \varepsilon$. So we can construct a sequence $(x_n)$ such that $x_n \to \infty $ and $x_n f(x_n ) \geq \varepsilon$. So $$\frac{\varepsilon}{x_n}\leq f(x_n) \implies \sum_{n\in\mathbb{N}}\frac{\varepsilon}{x_n} \leq \sum_{n\in\mathbb{N}} f(x_n) \leq \int_0^1 f(x)dx.$$ So we get a contradiction. I feal like I have the correct idea but some details are wrong. Any help would be appreciated. |
$x_1, x_2 > 0$ $f(x_1,x_2) = \frac{1}{x_1^3x_2}$ Is this function convex? I think it is because Hessian matrix is $$\begin{pmatrix} \frac{12}{x_1^5x_2} & \frac{3}{x_1^4x_2^2} \\ \frac{3}{x_1^4x_2^2} & \frac{2}{x_1^3x_2^3}\end{pmatrix}$$ How do i show that the matrix is positive? multiply it by vector a^T and a isn't working.. Thanks! can i just say its positive cause every element is positive? | For $x_1, x_2 > 0$, let $$f(x_1,x_2) := \frac{1}{x_1^3x_2}$$ Is function $f$ convex? I think it is because Hessian matrix is $$\begin{pmatrix} \frac{12}{x_1^5x_2} & \frac{3}{x_1^4x_2^2} \\ \frac{3}{x_1^4x_2^2} & \frac{2}{x_1^3x_2^3}\end{pmatrix}$$ And I think the matrix is positive because each value is positive (is it true?) Thanks! |
Current is a scalar quantity. In Watt-less current, we divide current into components like vectors. Moreover, when AC current passes through inductors or capacitors, we put a vector sign over current. Can anyone please elaborate? | Current has both magnitude and direction. As per the definition of vector , current should be a vector quantity. But, we know that current is a scalar quantity. What is the reason behind it? |
I am combining two website-based editors (one for create, one for edit) into one, and am trying to think of a word that encompasses both creating and editing in one. I would appreciate any suggestions. | I want to use a term to covers both creating and editing some entity, say a blog post or a comment in a blog. Which word should I use? |
I've got a variable set at the top of my PHP: $abc = "paid"; Now I need to pass it on to the below query as a column name. I tried the below but it did not work. $sql = "SELECT customerID FROM payments WHERE :myVar = :credit"; $stmt = $connect->prepare($sql); $stmt->execute(array(':credit'=>"0", ':myVar'=>$abc)); How do I pass $abc on to the select query as a column name? | Why can't I pass the table name to a prepared PDO statement? $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) { var_dump($stmt->fetchAll()); } Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do $sql = "SELECT * FROM $table WHERE 1" |
I'm trying to loop through an array of EditText id's to get all of their texts and add them to a single message. I understand how NullPointers work, but I cannot understand how temp and temp2 are NullPointers if I'm initializing them just as I have before, just this time it is in a loop. This is the error I get: Process: com.example.brandon.netflixcalculator, PID: 6369 java.lang.NullPointerException: Attempt to invoke virtual method 'android.text.Editable android.widget.EditText.getText()' on a null object reference at com.example.brandon.netflixcalculator.Exact_Activity.getInfo(Exact_Activity.java:152) at com.example.brandon.netflixcalculator.Exact_Activity.updateFile(Exact_Activity.java:125) at com.example.brandon.netflixcalculator.Exact_Activity$Listener.onClick(Exact_Activity.java:76) at android.view.View.performClick(View.java:5254) at android.view.View$PerformClick.run(View.java:21179) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6895) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Here is the method: int[] editTextIds = {R.id.editTextMon, R.id.editTextTues, R.id.editTextWed, R.id.editTextThurs, R.id.editTextFri, R.id.editTextSat, R.id.editTextSun}; int[] spinnerIds = {R.id.spinnerMon, R.id.spinnerTues, R.id.spinnerWed, R.id.spinnerThurs, R.id.spinnerFri, R.id.spinnerSat, R.id.spinnerSun}; public String getInfo(){ String msg = ""; StringBuffer sb = new StringBuffer(); for(int i = 0; i < editTextIds.length; i++){ EditText temp = (EditText)findViewById(editTextIds[i]); Spinner temp2 = (Spinner)findViewById(spinnerIds[i]); sb.append(temp.getText().toString()); sb.append("."); sb.append(temp2.getSelectedItem().toString()); sb.append("\n"); } msg = sb.toString(); return msg; } Here is my layout. Each of the days of the week is its own fragment, so here is Monday's (they are all the same besides the id's of each component): <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.brandon.netflixcalculator.Monday" style="@style/Main"> <!-- TODO: Update blank fragment layout --> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_horizontal|top"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/editTextMon" android:layout_gravity="center_horizontal" android:background="@drawable/apptheme_edit_text_holo_light" android:hint="Average number of available viewing minutes on Monday" android:numeric="integer" android:layout_marginTop="15dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceLarge" android:text="Probability of above viewing time on Monday" android:id="@+id/textView" android:layout_gravity="center_horizontal" android:textAlignment="center" android:layout_marginTop="15dp" /> <Spinner android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/spinnerMon" android:layout_gravity="center_horizontal" android:layout_marginTop="15dp" /> </LinearLayout> | What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? |
Can we find the integral $$\int_0^{2\pi} \cos(\cos x)\,dx\;?$$ | Evaluate $\int \cos(\cos x)~dx$ I tried to use chain rule but failed. Can anyone help me please? |
I have a function that is called from multiple threads: void func() { static MyObject someobject; someobject.complexFunc(); } At program termination, can I assume that someobject is destroyed after the last thread has been terminated? If no, how can I make sure threads don't access it anymore when say std::exit is called? Thanks | If a variable is declared as static in a function's scope it is only initialized once and retains its value between function calls. What exactly is its lifetime? When do its constructor and destructor get called? void foo() { static string plonk = "When will I die?"; } |
Let $L(-1)$ be the tautological line bundle on $\mathbb{P}^n$. I would like to understand the proof of the following: Fact. The only global section on $L(−1)$ is the zero section. Proof. Let $s : \mathbb{P}^n \to L(−1)$ be a holomorphic section. For any $l ∈ \mathbb{P}^n$ we have $s(l)=(l,z_l)$ for some $z_l \in \mathbb{C}^{n+1}$ lying on the line $l$. Thus, $l \to z_l$ is a holomorphic map $\mathbb{P}^n \to \mathbb{C}^{n+1}$. By the maximum principle this map must be constant, so $z_l \equiv w \in \mathbb{C}^{n+1}$. On the other hand $s$ is fiber preserving, so $w \in l$ for each line $l$ through the origin of $\mathbb{C}^{n+1}$. Hence $w = 0$. How does the maximum principle imply that the map is constant? Thanks a lot. EDIT: my question is slightly different from the linked answer as that result is for holomorphic functions (to $\mathbb{C}$), whereas here I have a holomorphic map (to $\mathbb{C}^{n+1}$). | Is there a simple proof that every holomorphic function $M\to\mathbb{C}$ on a compact complex manifold $M$ is constant? |
I have a main page on my site and I am trying to make a connection to the MySQL server and get some data from the database. But the problem is that when I want to establish a connection I have to put the username and password in the page which doesn't seem wise to me. I added a part of my code related to this problem. <!DOCTYPE html> <html lang="en"> <head> </head> <body> <?php $host = "localhost"; $userName = "username"; $password = "12345678"; $dbName = "MyDB"; $connection = new mysqli($host , $userName , $password , $dbName); if ($connection->connect_error) { die("Connection failed due to this error : " . $connection->connect_error . '<br>'); } else{ echo "Connected successfully"; { </body> </html> | When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way to secure that password? It seems like just writing it in the PHP code isn't a good idea. |
Is it possible to add custom online source to Dictionary app? Like the one for Wikipedia. | The standard Apple Dictionary program in Lion provides access to Wikipedia. This appears to be a direct look-up (i.e., not to a cached local copy of Wikipedia). I'd like to add other sources that way, such as for Urban Dictionary. Can this be done? If so, how? |
We know that linear speed of object going around a circle is $\omega * r $ Now let us take an elastic string and rotate a body of negligible mass with $\omega = 500 rad/s$ It is possible to further stretch this string while maintaining $\omega$ constant using a super powerful motor. If we extend the chord length to say $1,000,000 m$ then the linear speed of the body should come out to be equal to $500,000,000 m/s $ which is greater than the speed of the light. Where is the fallacy in the above argument? | Imagine a bar spinning like a helicopter propeller, At $\omega$ rad/s because the extremes of the bar goes at speed $$V = \omega * r$$ then we can reach near $c$ (speed of light) applying some finite amount of energy just doing $$\omega = V / r$$ The bar should be long, low density, strong to minimize the amount of energy needed For example a $2000\,\mathrm{m}$ bar $$\omega = 300 000 \frac{\mathrm{rad}}{\mathrm{s}} = 2864789\,\mathrm{rpm}$$ (a dental drill can commonly rotate at $400000\,\mathrm{rpm}$) $V$ (with dental drill) = 14% of speed of light. Then I say this experiment can be really made and bar extremes could approach $c$. What do you say? EDIT: Our planet is orbiting at sun and it's orbiting milky way, and who knows what else, then any Earth point have a speed of 500 km/s or more agains CMB. I wonder if we are orbiting something at that speed then there would be detectable relativist effect in different direction of measurements, simply extending a long bar or any directional mass in different galactic directions we should measure mass change due to relativity, simply because $V = \omega * r$ What do you think? |
I have a table skeleton created in the HTML and then added options based on JSON data in my js. I currently have the rows & options for the table created from that js, so that the data can be dynamic. Eventually I'd like to have data show/do something after you hover a row. I decided to just try and implement a background-color change for now, to verify it works. However, I'm running into some issues. It's not able to recognize the different rows inside my table. Here's a code pen link, Is this due to how I'm creating the rows & options inside my javascript? If I change it to look for ".tr", it only finds the header row. If I change it to look for ".tbody", it affects the whole body. I also tried creating a class when my js appends the tr, which you can see in the code shown here. This provided 0 highlighting. $(".myRows").hover( function() { console.log('hover called'); $( this ).css("background","yellow" ); }, function() { $( this ).css( "background","" ); } ); | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
I wrote a server and client Java TCP Socket, It works on private network(192.168.2.x) but how I have no idea how make it work with public ip. I think I should open a port in the router and use my server ip and this port to init client socket! I tried it and did not work. Init of sockets here: Socket clientSocket = new Socket(IP, PORT); ServerSocket server = new ServerSocket(PORT); | I have had no trouble getting the sockets working with localips, but once I made the code change to use public ips, I've consistently gotten java.net.ConnectException. I am using the port 8084, which as far as I know, is not used elsewhere In the command prompt, netstat -a | grep 8084 shows: File STDIN: TCP user-9114eb19a8:8084 user-9114eb19a8:0 LISTENING I have gone into my router and ensured that it is open I get my public ip using a request to Server: serverSocket = new ServerSocket (8084); Client: socket = new Socket (hostaddr, 8084); //hostaddr is a string containing my public-IP //it works when the program is run on a localnetwork and I am using my local-ips |
I had a situation earlier where I was trying to help someone with an issue. If I upvote all their questions so we can move it to chat, is that ok? They did not have enough rep to chat. | I just noticed that I lost a bunch of points from my reputation score, and I used the "reputation" tab on my user profile page to try and track down the cause. During my investigation, I noticed there was an unusual event of type "reversal". In the normal place of a question title, it says "voting corrected". What does this mean, and what caused it? Did I do something wrong? Why did I lose all of that reputation? Is the system punishing me for leaving too many good answers? Is there any way to earn it back? |
I recently upgraded to QGIS 3.2 and followed the install instructions carefully. Under the raster and vector menus I have only 1 tool for vector and only 3 for raster. No analysis, geometry, geoprocessing tools etc... when I use the main search bar to look for any of the tools I would have used in QGIS 2 (polygonize, dissolve, clip) I get no results. python and GDAL were install as per instructed in the QGIS 3.2 README Am I missing something? | I'm sure there is a really simple explanation to this but haven't found any pointers on this forum or elsewhere. I seem to have lost the 'processing' menu from QGIS and can't figure out how/why!? Any ideas what I might have done to make this happen? I'm running QGIS 2.8 built against GDAL 1.10 on Ubuntu 14.04. |
I'm new to frontend web coding and I wanted to make a mockup website to speed up my learning process. I wanted to make the sign-in part align in the middle of the page, i found some tutorial using flex-grow so it would scale with size, but this is what I got instead: What did I do wrong? (I only posted snippets of code I think would matter not to complicate things) .sign-in { display: flex; justify-content: space-between; align-items: center; flex-grow: 1; **<THE PART WHERE THE PROBLEM ARISES>** } .sign-in-text { display: flex; align-items: left; flex-direction: column; font-size: 3.5em; font-weight: bold; margin: 0; padding: 0; } .not-sign-in-text { font-size: 2rem; padding: 0; margin: 0; } .miss-you { font-size: 1.5rem; font-weight: 500; } .sign-in-form { display: flex; align-items: left; flex-direction: column; } <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="style.css" rel="stylesheet" /> <link href="index.css" rel="stylesheet" /> <title>ELOHSSA</title> <header class="secondary"> <section class="sign-in"> <h1 class="sign-in-text"> sign in. <span class="miss-you"> We missed you already :( </span> </h1> <form class="sign-in-form"> <div class="information"> <label> Username: </label> <input type="text"> </div> <div class="information"> <label> Password:</label> <input type="password"> </div> <div class="information"> <button type="submit" class="button"> Sign in. </button> </div> </form> </section> </header> </html> Thanks for helping! | I am working on a web application where I want the content to fill the height of the entire screen. The page has a header, which contains a logo, and account information. This could be an arbitrary height. I want the content div to fill the rest of the page to the bottom. I have a header div and a content div. At the moment I am using a table for the layout like so: CSS and HTML #page { height: 100%; width: 100% } #tdcontent { height: 100%; } #content { overflow: auto; /* or overflow: hidden; */ } <table id="page"> <tr> <td id="tdheader"> <div id="header">...</div> </td> </tr> <tr> <td id="tdcontent"> <div id="content">...</div> </td> </tr> </table> The entire height of the page is filled, and no scrolling is required. For anything inside the content div, setting top: 0; will put it right underneath the header. Sometimes the content will be a real table, with its height set to 100%. Putting header inside content will not allow this to work. Is there a way to achieve the same effect without using the table? Update: Elements inside the content div will have heights set to percentages as well. So something at 100% inside the div will fill it to the bottom. As will two elements at 50%. Update 2: For instance, if the header takes up 20% of the screen's height, a table specified at 50% inside #content would take up 40% of the screen space. So far, wrapping the entire thing in a table is the only thing that works. |
I'd like to know how can I make the little web page icon on the left from the title "running" when I do, for example, a getJSON() to my external server to warn the user that his/her request is being treated. Is there a way to control it? | I have a web application that's branded according to the user that's currently logged in. I'd like to change the favicon of the page to be the logo of the private label, but I'm unable to find any code or any examples of how to do this. Has anybody successfully done this before? I'm picturing having a dozen icons in a folder, and the reference to which favicon.ico file to use is just generated dynamically along with the HTML page. Thoughts? |
Seeking again your expert opinion on how to remove dynamic elements using jquery? Im currently working on a php page with forms with functionality to add and remove new section. Now im having issues when im trying to remove the newly added section using jquery. As the hyperlink doesn't get triggered. HTML page: <div class="form-group"> <label class="control-label col-md-4">File upload</label> <div class="col-md-6"> <input type="file" /> <textarea required placeholder="Description of the document" class="form-control" name="description-of-incident" id="description-of-incident" rows="2"></textarea> <div class="help-block with-errors"></div><br /> <a href="javascript:void(0);" id="addanother">Add another</a> </div> </div> <div id="container"> </div> and this is the jquery i used: $(document).ready(function() { $('input[type="radio"]').click(function() { if($(this).attr('id') == 'peopleinvolvedyes') { $('#involvement-section').show(); } else { $('#involvement-section').hide(); } }); $("#addanother").click(function(){ $("#container").append('<div class="form-group"><label class="control-label col-md-4">File upload</label><div class="col-md-6"><input type="file" /><textarea required placeholder="Description of the document" class="form-control" name="description-of-incident" id="description-of-incident" rows="2"></textarea><div class="help-block with-errors"></div><a href="javascript:void(0);" class="remove-document-upload">Remove</a></div></div>'); }); $(".remove-document-upload").click(function(){ alert("dasdasdas"); //$(this).closest('.addanother').remove(); }); }); Whenever, i get click on the the 'Remove' hyperlink, the jquery function doesn't get triggered. Comments and suggestions are high appreciated. Thanks, Nhoyti | I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off. This happens on page ready and works just fine. The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound. I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option. |
As a land surveyor, I often bring cad data into a GIS and create polygon representing parcels. Traditional tools I have for cleaning topology are inappropriate so I am looking for something different - even if it means teaming up with someone to build additional extensions. (I scanned the list of existing extensions and some pieces are already there). My idea is to fix minor topology errors by constraining key geometric elements. That is, straight polylines and circular arcs which share a common centre point. A key requirement is support for true circular curves. I could keep the data in SQL Server but prefer a GUI for a better user experience. As I am not familiar with QGIS, I am looking for some indication if the data structure used by QGIS can support this. | I am trying to make a floor plan for my office, have managed to make all of the rectangular components (e.g. the rooms) however some of the desk layouts are circular and I haven't been able to work out how to make exact and measured circles. They need to have a radius of 1.45m. |
my bibtex stopped showing refrences. It shows now only '[?]'. The story is like this. I use pdfLatex within the TexWorks. It worked all right. But after i added extra couple of new refs in the bib file, it did not want to show them in the text and showwed only [?]. ted the .AUX files. And it stopped showing ALL refs...just [?]'s. What can i do about it? | I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists. \documentclass[11pt]{article} \usepackage{cite} \begin{document} \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle Blablabla said Nobody ~\cite{Nobody06}. \bibliography{mybib} \bibliographystyle{plain} \end{document} My bibliography (Bib.bbl) @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" } Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg \begin{thebibliography}{} \end{thebibliography} |
I joined on the following networks with blind interest. Stack Overflow. Server Fault. Puzzling. Database Administrator. Game Development. Now I want to leave from all networks, expect Stack Overflow. I googled about exit from a network. It shows me the Delete Profile option. Does Delete Profile remove me from all networks or only the corresponding network? Updates: I got what I need.... Delete Profile will delete an individual account..! | How can I delete my Stack Exchange account(s)? Also, What happens to my content? Can I request it be deleted as well? What if I'm suspended, rate-limited, or banned from posting questions or answers? What will happen to my votes? Will other users be impacted? Why wasn't my account deleted immediately after the timer expiring? What will happen to my pending bounties and close, reopen, delete, or undelete votes? I want my account deleted on all Stack Exchange sites. How do I do this? Will my profile on chat be removed once I delete my site account? For more information, see "" in the . |
This is likely the same problem I saw reported countless times. However, mine comes with a twist, so I wonder if anyone can provide extra insight. Briefly, my laptop randomly shuts down (I think it happens only on battery). It's an early 2011 17" version running the latest macOS. A few weeks ago I reinstalled the whole macOS after it wouldn't turn on anymore. I thought it might've been a hardware issue as many people suggest replacing the motherboard, but I was still able to boot it in the safe mode, which would suggest it's a software component issue. Fast-forward and it's started happening again, although only infrequently and I am able to turn it back on very quickly if I have a charger nearby. Now, here are 2 insights I noticed and wonder if anyone can explain futher. 1/ Once the laptop "dies", I usually need to connect it to the charger to start it again. It feels like giving it some juice to power up. The battery level doesn't seem to play a role here (happens on 90% too). Sometimes if I connect the charger, turn it on, remove charger, it dies instantly. As if I had to keep the charger in for a certain amount of time until it feels confident to run without it. Feels like teaching a child ride a bike. 2/ Lately, I developed a new theory that it happens only when discharging AND I have to have the laptop on my lap, bed, or other unstable surface. I am paying attention now if it happens again when I work on desk, I couldn't replicate it so far. It's this point that drives me crazy, wondering what it could be. Any experience with this issue is welcome. 😸 [UPDATE]: I removed case from the Macbook, dusted it off a bit and since then it's been running without any issues again. I haven't changed any settings or components. Computers are weird. | I have a MacBook Air, 2009, with a recently replaced Apple battery in December 2012. Recently, when power cord comes off, the computer shuts down. Also, it usually will not restart unless power cord is attached. |
I read this in the early 70's The ring in question is surgically grafted onto a convicted criminals finger and enables him to be tracked. It triggers intense pain if the conditions of his parole are breached. Unfortunately, that's all I remember! Can anyone help? | I remember reading one of my father's books when I was younger. It was about a guy who ended up getting in trouble with the law and was required to wear a ring that could not be removed and would shock the wearer any time they committed a crime (No matter how minor.) The book was probably published in the early to mid 80s. I thought the name of the book was 'The Ring', but I am unable to locate anything. The cover had a car with a single wheel driving on a metal I-beam. |
I have purchased an HP 250 G6 Celeron 4GB notebook. Which version of Ubuntu can I load on it? This is a brand new laptop with Windows 10 Home edition running on it. Regards Ali | For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and such as: with a lighter desktop than the usual Gnome and Unity with the even lighter LXDE desktop Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements? |
Why did the man turn on the TV ? Why the man turned on the TV ? Sometimes, I guess, I hear or see these two constructions, so what is the difference ? Does the second is more often in sopken language ? And do both of them are formal ? Thank you | What is the difference between these two sentences? Why are you worried? Why you are worried? Which one is correct? |
In the US graduate universities, Ph.D. students have to take courses. Can a student with low GPA do good research? I think doing research is solving problems. If someone cannot solve a homework or an exam, how the person can even solve more complicated problems to publish? | I was reading the following article by Mathew Might. I saw the following the paragraph What doesn't matter GPA? I don't care if it's 2.0 or 4.0. I won't even look at it. The school you went to? I'll judge you the same whether you went to Nowhere State U or a top-ten school. Transcripts? Never seen one. GREs? Irrelevant. Where you work/worked? Unless it's a research lab, it's not important. I don't think these items have much predictive capacity as to whether or not someone can complete a Ph.D. Is Mathew Might telling the truth? For me it's very hard believe that GPA, GRE scores and undergraduate school don't matter. I used to think that they play an extremely important role in grad school admission. |
I am trying to create an indoor enviroment. I made two windows, added a sun and rotated it so that it could go throug the window and lighten the sofa and part of the wall. But I don't see the sun light anywhere. I checked on settings and is not invisible to the render but it just not reflecting any light. The only light I get is from the image background. This is the picture with sun and this is when I delete the sun Can anybody tell me please why is this? Thanks in advance | My model has a clear plastic (or glass) dome with objects inside. The objects appear dark. I've tried the glass shader with color 100% RGB, with very small IOR, and using just a refraction shader. I know Cycles has problems with caustics, but I just want broad illumination to fall clean through the glass. The light-to-column path can ignore refraction, but is blocked or tremendously attenuated. The camera-column path needs refraction, and seems to work fine anyway. This demo image offers all optical paths of interest: light upon object, seen directly light upon object, seen through glass (looks okay) light through glass onto object, seen directly. This is the shadow on the lit side of the column just below the glass tubing. I expect full illumination, but there is shadow. There is some light, but it's diffuse light from the floor. light through glass onto object, seen through glass. This I did at one point try non-progressive rendering, and find extremely coarse light where there shouldn't be shadow, but this is not a practical way to make nice images. I've even tried cranking up certain sampling settings to many thousands, but still get bad noise though less, at the cost of long render times. I would like to finish my creations sometime before "Star Trek, the Generation After the Next" becomes real life, if you know what I mean. The next image is an example. I think Transmission in Sampling was 5000, but not sure. I'm using Cycles in Blender 2.67 on a quad core Linux machine, 16GB RAM. Machine limits have never been a problem for 3D rendering. Possibly, I screwed up some setting when I made my startup file, and just need to fix it. OTOH maybe this is just a limitation of path tracing, or of the way Cycles does it. If that's the case, what to real-world Blender artists do when they need to produce images on a budget and schedule? What is the practical real-world fix? |
difference between picker parent and ctrl-p parent? when I use the picker to parent the sphere object to cube the sphere moves from place of origin, but if I parent sphere to cube with ctrl-p, sphere does not move from place of origin. why does that happen? I use blender 2.79 | I used Blender2.79 and I think I just find the problem. I have two objects and I want to make parent relations to each other, when I used CTRL + P, the child's transform location still relate to the world's location. However, when I manually use (properties -> object -> Relations: Parent) and select the object that I want to set it to parent. It used the parent's transform. I belive those two ways are doing the same things and I miss the setting or this is a bug?? |
I can show that GK = GJ and GI = GH by drawing the segments from the pentagon vertices to D and using the fact that DK is a diameter. I'm having trouble showing that GK = GI = IH. | In Robert Dixon's Mathographics, a regular pentagon is constructed with straightedge and compass only. It is the pentagon $ABCDE$ pictured below. I am having trouble seeing why the central angles are all $72^\circ$, though. Can anyone provide the proof? Also, does anyone know who this construction is due to? I haven't seen it anywhere, other than in Dixon's book; is it Dixon's result? The result appears much more impressive without all the labels (which are slightly misplaced, please excuse this); however, I provided those so that answering would be easier. Also, it makes it easy to describe the steps in the construction: 1) Draw a circle (the red one) with center $h$. 2) Draw the perpendicular lines $\ell_1$ and $\ell_2$ through $h$. Locate the points of intersection $f$, $B$, and $g$ with the red circle. 3) Bisect the line segment $gh$. Denote the center by $a$. 4) Draw the green circle with center $a$ and radius $ah$. 5) Draw the other green circle (as in (3) and 4)). 6) Draw the line segment through $f$ and $a$. 7) Locate the points of intersection $b$ and $c$ of the line segment with the circle constructed in step 4). 8) Draw the blue arcs (both have center at $f$ and the radii are $fb$ and $fc$). 9) Locate the points of intersection $A$, $C$, $D$, and $E$. I actually have the solution to the first question, and will post it unless a more elegant explanation is provided (which is probably likely). However, I find this construction particularly beautiful, and would like to know who it is attributed to (Dixon doesn't say, explicitly). |
I just got a new pc and installed windows 10 and I am a big linux fan so of course I setup dual boot with ubuntu 15.10 but I would also like to setup linux mint. I have checked out other questions like this but they all start without ubuntu installed. Is it still possible for me to add another distro after I have installed ubuntu? | Triple Booting Xubuntu, Ubuntu and Windows I'm an avid Xubuntu (Ubuntu + XFCE) user but I also dual boot with Windows XP. I originally created 3 partitions and wanted to use the empty one as a storage volume but now I want to install Ubuntu 12.04 LTS (the one with Unity) to do advanced testing and packaging. Ideally I would love to keep these two totally separate as I had problems in the past with conflicts between Unity and XFCE. This way I could wipe the Ubuntu w/ Unity installation if there are problems and really mess around with it. My disk looks like this: Disk /dev/sda: 200.0 GB, 200049647616 bytes 255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Device Boot Start End Blocks Id System /dev/sda1 * 63 78139454 39069696 7 HPFS/NTFS/exFAT /dev/sda2 78141440 156280831 39069696 83 Linux /dev/sda3 156282878 386533375 115125249 5 Extended /dev/sda4 386533376 390721535 2094080 82 Linux swap / Solaris /dev/sda5 156282880 386533375 115125248 83 Linux Keep each in it's own partition and totally separate and be able to select from each of the three systems from the GRUB boot menu... sda1 ---> [Windows XP] sda2 ---> [Ubuntu 12.04] "Unity" sda3(4,5) --> [Xubuntu 12.02] "Primary XFCE" What is the safest and easiest way to do this without messing my system up and requiring invasive activity? |
I have a regex that I've been using for a while to highlight a hashtag (eg. #stackoverflow) or a username/mention (eg. @jeffjohnson) while a user is typing out text. Here is how I create that regex: NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(#|@)(\\w+)|(#|@)" options:0 error:&error]; I want to add to this regex pattern so that it will also highlight a URL. So I changed it to the pattern to the following: @"(#|@|http)(\\w+)|(#|@|http)" This works correctly when they type http it will become highlighted but when they type a colon (:) the colon is not highlighted. If I try adding www to the regex pattern the same way that I added http, the same thing happens. www will highlight correctly but as soon as you type a period (.) the period will not highlight. How can I add full URL detection to this regex pattern? | How can I check if a given string is a valid URL address? My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web. |
I recently studied about Cartesian products and I thought that I understood its concept, Until I ran into this expression: If $S=\emptyset$, $\ne\emptyset$, then $S\times T = \emptyset$ . Is an empty set the same as zero? in the sense that in nullifies a non empty set? Thanks! | If we have a function $f:A \rightarrow B$, then one way to give meaning, I think, to this function, in terms of set theory, is to say, that $f$ is actually a binary relation $f=(A,B,G_f)$, where $G_f \subseteq A \times B$ is the graph of the function. Now my question is: what is $f$ if $\bullet \ A=\emptyset, \ B\neq\emptyset$,? $ \bullet \ B=\emptyset, \ A\neq\emptyset$ ? $ \bullet \ B=\emptyset, \ A=\emptyset$ ? (Another way to formulate this, I think, would be: How do the sets $\emptyset\times B,\ A\ \times \emptyset, \ \emptyset \times \emptyset $ look like? Are they all $\emptyset$ ?) |
I want to add a calendar to my Default.aspx. How is this done? My first try was: <asp:Content ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" EnableViewState="False"> <WebPartPages:WebPartZone runat="server" FrameType="Default" ID="full" Title="loc:full" WebPartVerbRenderMode="TitleBar"> <WebPartPages:XsltListViewWebPart runat="server" ListUrl="Lists/Calendar" IsIncluded="True" JsLink="clientTemplate.js" NoDefaultStyle="TRUE" PageType="PAGE_NORMALVIEW" Default="False" ViewContentTypeId="0x"> </WebPartPages:XsltListViewWebPart> </WebPartPages:WebPartZone> However this way causes my calendar to come out a jumbled mess. How can I properly add a calendar to my Default.aspx? Thank you! | I am attempting to add a calendar to my Default.aspx in my sharepoint hosted add-in in visual studio. I used the default code-snippet for adding sharepoint lists. Here's what I added to my Default.aspx: <WebPartPages:WebPartZone runat="server" FrameType="Default" ID="full" Title="loc:full"> <WebPartPages:XsltListViewWebPart runat="server" ListUrl="Lists/Calendar" IsIncluded="True" JsLink="clientTemplate.js" NoDefaultStyle="TRUE" PageType="PAGE_NORMALVIEW" Default="False" ViewContentTypeId="0x"> </WebPartPages:XsltListViewWebPart> </WebPartPages:WebPartZone> and this is the result... Pretty dang ugly if you ask me. How can I get this looking like a normal share point calendar instead of an unusable mess? Thank you! |
I try to use Darboux's Thm and IVT but end up stuck. Is using mean-value theorem many time can get the result? | Prove that if $f$ is differentiable on $[a,b]$ and if $f(a)=f(b)=0$ then for any real $\beta$ there is an $x \in (a,b)$ such that $\beta \cdot f(x)+f'(x)=0$. (Using rolle's theorem) My attempt: Using Rolle's theorem we can say that there exists some $c \in (a,b)$, where $f'(c)=0$ . Therefore one factor in the expression $\beta \cdot f(x)+f'(x)=0$ is $0$ at $c$ but I am unable to prove that the other factor will simultaneously be $0$ at $c$. |
Can you help me with this problem? Find the center of mass of a lamina whose region R is given by the inequality: and the density in the point (x,y) is : Any help? Thanks | Can you help me with this problem? Find the center of mass of a lamina whose region R is given by the inequality: and the density in the point (x,y) is : The region r is this one: Is this the proper way to set up the integral for m: $$\int_{-1}^{1}\int_{-x-1}^{x+1} \ e^{x+y} \ dy \ dx$$ Any help? Thanks |
I having trouble inserting a gif file into my overleaf latex document. Here is the code I used: \documentclass[conference,10pt]{IEEEtran} \usepackage{graphicx} \usepackage[utf8]{inputenc} \usepackage{epstopdf} \usepackage{psfrag} \usepackage{subfigure} \usepackage{url} \usepackage{stfloats} \usepackage{amsmath} \interdisplaylinepenalty=2500 \usepackage{balance} \DeclareGraphicsRule{.gif}{png}{.png}{% \noexpand\epstopdfcall{convert #1 \noexpand\OutputFile}% } \AppendGraphicsExtensions{.gif} \begin{figure}[h!] \includegraphics[width=\linewidth, angle = 0] {images/Climate_Simulation_of_Surface_Air_Temperature.gif} \caption{NASA's Map of Antarctic Ice Flow} \label{fig:SSBlock} \end{figure} This did not work so I replaced the \begin section with this line of code: \includegraphics[width=\linewidth, angle = 0 {images/Climate_Simulation_of_Surface_Air_Temperature.gif} Still nothing worked. Please let me know how I can insert my .gif file. | Is there any way to include an animated GIF directly in either PDFLaTeX or XeLaTeX? I realize the animate package can include animations in a PDF, but it doesn't support animated GIFs and you have to split them up manually into EPS or PNG files as far as I can tell. |
If two vectors $\vec{A} =A_x\hat{i} + A_y \hat{j} + A_z \hat{k}$ and $\vec{B} =B_x\hat{i} + B_y \hat{j} + B_z \hat{k}$, have angle $\theta$ between them then the dot product (scalar product) of $\vec{A}$ and $\vec{B}$ is $$\vec{A}\cdot\vec{B} = |\vec{A}||\vec{B}|\cos \theta$$ $$\vec{A}\cdot\vec{B} =\left(A_x^2 +A_y^2+A_z^2\right)^{1/2}\left(B_x^2 +B_y^2 +B_z^2\right)^{1/2} \cos \theta $$ $$A_x B_x+ A_yB_y+A_zB_z=\left(A_x^2 +A_y^2+A_z^2\right)^{1/2}\left(B_x^2 +B_y^2 +B_z^2\right)^{1/2} \cos \theta $$ Can we mathematically derive the last equation from right to left or left to right? Is there any proof stating that the equation to be practically and mathematically true? | I have an intuitive understanding of why $a\dot{}b=|a||b|\cos{\theta}$ geometrically. The projection of one vector onto another makes sense to me when explaining the origin of this geometric definition. What I don't understand is why $a\dot{}b=a_xb_x + a_yb_y = |a||b|\cos{\theta}$. How does the algebraic version of the dot product connect to the geometric version? Can you derive the algebraic definition from the geometric? I read the answers , but the proofs seem to depend on the actual algebraic definition to arrive at it. My main question is, why are the two definitions really equal? |
This is a bit naive question bu help me out here. We know that in Arithmetic, we follow the BODMAS rule where first preference is given to Brackets then Exponent then Division and so on. My question is how did we arrive at the conclusion to give the following preference. Was it conventional or has some theoretical twist in it? | After reading through a few other questions I was just asking myself: How was the Order of Operations defined, and why is it this specific order and not a different one? Most of us know things like multiplication/division before addition/subtraction, parentheses first, etc - but what's the actual reason behind it? I'm probably biased by following those rules since childhood, so I can't really think of any other way. 2 + 2 x 2 = 6 and not 8 But if the order would be changed, let's say to "addition/subtraction before multiplication/division" would that order still work if we assume that mathematics would build up on it? Or is there some strange mathematical problem if we would be using a different order? Of course, parentheses have a grouping function so they should always come first - I'm mainly talking about the exponents, multiplication/division, addition/subtraction (and maybe other operations left out). |
The new equipment had a positive effect on the business. The new equipment had a positive affect on the business. Am I right in saying that the top sentence has the correct use of effect/affect and the bottom one is incorrect? Thank you for any help you are able to give. | I've noticed that some people use effect and affect interchangeably. What are the differences between these two and when are the proper situations to use each of them? |
Consider the following model. Find the general solution $\frac{dx}{dt}=-2y$, $\frac{dy}{dt}=8x$ So far this is what I have: $$\frac{dx}{dt}=-2y$$ $$x'=-2y$$ $$y=-\frac{x'}{2}$$ $$y=-\frac{x''}{2}$$ and then $$\frac{dy}{dt}=8x$$ $$y'=8x$$ $$-\frac{x''}{2}=8x$$ $$-x''=16x$$ $$x''+16x=0$$ Is this correct so far? What step should I take next? | Solve the following system: $$dx/dt=-.2(y-2)$$ $$dy/dt=.8(x-2)$$ This is what I have so far, but I got stuck.. $$\begin{eqnarray} dx/dt&=&-.2y-.4\\ x'&=&-.2y-.4\\ x'+.4&=&-.2y\\ y&=&-x/2'-2\\ y&=&-x''/2-2\\ \\ dy/dt&=&.8(x-2)\\ dy/dt&=&.8x-1.6\\ y'&=&.8x-1.6\\ -x''-2&=&.8x-1.6\\ -x''&=&.8x+.4\\ x''+16x+.8&=&0 \end{eqnarray}$$ when I used the quadratic formula I got stuck. Is this correct so far? Can someone finish it off for me? |
I put some wings in the oven last night and then forgot about them and my roommate turned the oven off. They weren't fully cooked but is it still okay to fully cook them now and eat them or would it be better to throw them out? | If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more? |
I have tried all browsers and even the mobile app but I am unable to see any picture that's there, in questions/ answers/ chat. From physics chatroom: As evidence, here are two pictures^ . I have uploaded them but am unable to see them, it reads "enter image description here". I have tried: Logging out then logging in Clearing brwosing data and then logging again As aforementioned, mobile chat, mobile app, web browsers like Mozilla firefox, Microsoft edge, google chrome. Turned off the laptop and restarted. Please fix this. | I just wrote a question before this one and had trouble uploading a screenshot. The drop your image dialog throws no warning or error, but after uploading it won't show. I also noticed that other questions won't load their images. Could this be some issue with imgur or similar? Example: When opening the image in a separate tab, Chrome gives a "too many redirects" error: This might be linked to |
I left the bag in the hall and Robert and I went into the living room where we talked for a couple of hours. Does a couple of hours equal two hours? Or it simply represents several hours? | Today I said some event was a couple of weeks away. A native speaker from Australia corrected me and said, no it's at least three weeks away. What followed was a discussion as to whether a couple always means two, or if it can mean more than two. What does a couple, in particular a couple of weeks, mean to a native speaker? According to : Two partners in a romantic or sexual relationship. Two of the same kind connected or considered together. (informal) A small number. According to : two people or things of the same sort considered together: 'a couple of girls were playing marbles' [treated as singular or plural] two people who are married or otherwise closely associated romantically or sexually: 'in three weeks the couple fell in love and became engaged' 'a honeymoon couple' [informal] An indefinite small number Yet my colleague — a native speaker — insists that a couple never means three, although there can be a small error bar on the two. We asked one other native speaker who agrees with him, yet three non-native speakers point at the above-mentioned sources to claim they're wrong. But it's a bit tricky for non-native speakers to claim native speakers are wrong. Note that both native-speakers are from Australia/New Zealand. |
$C$ = Cantor set. $C$ is closed, so $C^c$ is the . So let $$C^c = \bigcup\limits_{\substack{i~\in~\mathbb{N} \\}} A_i $$ where $A_i$ are disjoint open intervals. For each $i \in \mathbb{N},\ A_i\ $ differs from a closed set by just two points, namely the endpoints of the interval $A_i.$ For each $i \in \mathbb{N},\ $ let $$ B_i = \{x_{i1}, x_{i2} \} = \{ \text{ the two endpoints of } A_i \}. $$ Then $\left|\bigcup\limits_{\substack{i~\in~\mathbb{N} \\}} B_i\right| \leq 2 \left|\mathbb{N}\right| $ is countable. However, $\bigcup\limits_{\substack{i~\in~\mathbb{N} \\}} B_i$ is surely the Cantor set, which is uncountable. Something is incorrect in all of this, but what? | The Cantor set is closed, so its complement is open. So the complement can be written as a countable union of disjoint open intervals. Why can we not just enumerate all endpoints of the countably many intervals, and conclude the Cantor set is countable? |
None of the 26 answers given , or the 5 answers given mentions any similarity between the pronunciation of E = mc² and A = πr², yet I still remain confusioned as to what distinguishes the reading of E = (mc)² and A = (πr)² with the reading of the first two. | According to one of the questions on EL&U, “E = mc²” is read as E equals M C squared. How do we read “E = (mc)²” so that it is not mistaken for “E = mc²”? |
I had Windows 7 one disk. Then I installed ubuntu on a different disk. That went fine. But for various reasons, I wanted to reinstall ubuntu. So I booted my install disk and chose something akin to "reinstall ubuntu and remove files" (not the one that'd also remove Windows 7 files). Well, the installation seemed to go just fine, but after it, I can't boot into either OS. All I'm met with is a prompt for "grub rescue", help! | I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu. How can I get Ubuntu back? |
\documentclass{article} \usepackage{amsmath, amssymb} \usepackage{graphicx} Inside \begin{document} I have: \begin{figure} \centering \includegraphics{supremum} \end{figure} supremum.gif is a gif file inside the same file as this .tex file. I have looked into other solutions but none have worked for me so far. | Related: I have an image file -- a gif file, which is the graph of a function. How do I add it to a LaTeX file? Will it come out OK in the subsequent pdf file? |
For example, almost every dog I've met in my life (more than 20 subjects) uses their right paw touching one while asking for attention. Can it be used as a criterion for calling them dextral? If not, what? However, I realize that even those dogs who live in the street might get influenced by dextral people: There is no domestic animal which has so radically altered its whole way of living, indeed its whole sphere of interests, that has become domestic in so true a sense as the dog (Konrad Lorenz) Is there any research about it? | I have been observing my cat and found that when confronted with an unknown item, she will always use her front left paw to touch it. This has me wondering if animals exhibit handedness like humans do? (and do I have a left handed cat?) One note of importance is that with an unknown item, her approach is always identical, so possibly using the left paw means allowing a fast possible exit based on how she positions her body. This question is related to . However, I question the "paw-ness" as a consequence of how the cat is approaching new items (to be ready to flee), whereas the other question remarks about the high number of "right-pawed" dogs and questions the influence of people for this preference. |
When I use Ctrl+Left_arrow or Ctrl+Right_arrow in bash, I move backward a "word" and forward a "word" respectively. I belive, this is defined in /etc/inputrc # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving "\e[1;5C": forward-word "\e[1;5D": backward-word "\e[5C": forward-word "\e[5D": backward-word "\e\e[C": forward-word "\e\e[D": backward-word Unfortunately, the definition of "word" here is misleading. It considers /foo/bar as two words. Is it possible to modify this so that the only word delimiter is space character ? (one or more spaces, or one or more tabs) i.e. /foo/bar/ should be treated as one word I am using Debian Wheezy | Bash offers many useful emacs-style keybindings for simple commandline editing. For example, Ctrl+w deletes ("kills") word left from the cursor. Another keybinding, Alt+d is supposed to be a "mirror" of the first one. It is supposed to delete a word right from the cursor. However, I have noticed, these two keybindings do not act completely symetricaly. Whereas Ctrl+w treats foo.bar as one word, Alt+d treats it as two words Even more annoyingly, # echo are two words for Ctrl+w, but one word for Alt+d. Is there some logic in this? Is there some reason why they don't treat words in the same way? Is there any way for me to change this? I am using bash on Debian Wheezy |
Do reviewers/editors receive a deadline for reviewing a paper? I wanted to know that whether reviewers/editors receive any kind of deadline for reviewing a manuscript for a journal or they are allowed to submit their reviews any time they wish since they are not paid for this service. If they do receive a deadline what is the average time the reviewers get for evaluating the following in journals owned by Elsevier, Springer, World Scientic, Taylor & Francis etc. Round 1 revision or first review of a paper Major Revision Minor Revision I find that if a major revision is required then the authors receive a time of 2 months for fixing it. For a minor revision the authors get a time of 1 month. What is the time given by the journal authorities to the Editors/Reviewers for checking a major revision and a minor revision? Can someone please let me know as one of my manuscript is in major and other in minor revision? Any help will be greatly appreciated. | What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take? Note that this question is about the typical situation and hence not about: Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or . This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question. |
I am currently connected to the Twitter Stream, and I would like to count the number of lines of data as they come in. I know I can do wc-l to just count the lines, but I want it to be auto-updating. Kind of like how tail -F works, but instead, I want a running tally of how many records I've received. Is there a simple command to do this in UNIX? | I know of course that cat logfile.txt | wc -l 120 will tell me the number of lines in a file. Whereas tail -f logfile.txt will show me the new lines that another program writes to logfile.txt. Is it possible to combine both so that I get a continuous updating line count of logfile.txt with standard text utilities? I do know about watch wc -l logfile.txt but I do not want to re-count the whole file each time, that seems to be a waste. One would need an appended-only count every second or so and probably an \r instead of an \n at the end of line. |
I got notification from one question. One guy replied to my comment. I clicked it and Stack Exchange app started loading. I clicked the notification in in-app notifications bar and it redirected me where it should: . But, when I scrolled up, one answer (DourHighArch's) and its comments were blank. They looked like every text on them was just set to white color. It was tall enough, so its content would fit it. (I mean, it was looking like there was some content, but written in white) Sorry if I made something wrong in this "question", it is first time I report an error and I wasn't sure how do I do that. Also, sorry if duplicate. Screenshots: PS: When I re-visited the linked page, everything was correct, like if this was random issue. App Version: 1.0.85 Device Manufacturer: samsung Device Model: GT-I9305 OS Version: 4.4.4 (I9305XXUFNJ1) | I have white blank on the posts. App Version: 1.0.89 Device Manufacturer: Meizu Device Model: m2 OS Version: 5.1 (1464689330) I can't see the questions and the answers and the comments. I saw that it's a common issue.. Does it have a fix? EDIT - I saw answer. This answer is ~2 years old. It says that it will fix in the next update. His version is 1.0.59 - mine is 1.0.89. Huge different. The problem is still exists! |
I'm trying to automatically generate a smart grid index for data driven pages, though frustratingly, the grid index created by the Grid Index Features tool, seems to start the grid at the bottom left corner (see below) And isn't mart enough to move re-position itself to remove redundant grids, ideally, if it were intuitive it would shift and thus could remove grid one from the equation. Has anyone come into this issue? Or found a workaround to create a nice grid index? Would love to get your insight to this problem. | From time to time I have to produce mapbook to show points of interest. First step to create pages, using regular mesh: I don't like the solution because a) there are some pages with single points (e.g. page 25) sitting on the edge and b) too many pages. First issue is easy to fix using code, - move rectangle of page extent to center of relevant points extent: I still don't like it, it looks very crowded because number of pages remains the same. Remember, they all end up being actual A3 paper pages in multiple copies of report !. So I've cooked a code that reduce number of pages. In this example from 45 to 34. I am not sure if this the best result that can be achieved, What is the best strategy (pseudo code, publication, Python library) to shuffle through points in order to minimise number of given size rectangles to capture all of the points? Surely, someone discovered it in game theory, military art or fishing industry This is update to original question: This shows real extent and page size required: Closer zoom showing 10 out of 164 pages: Rectangle size can change as soon as it stays within the limits, i.e. smaller is fine. |
Could I install certain custom ROMS for other devices e.g. Samsung tab 3 Stock on Samsung Galaxy tab 2? If so, how, and what should I do? | I own a MicroMax A100. I want to install the latest version of a different ROM (Samsung or Nexus). Is it possible? If so, can you tell me how? If not, can I install a ROM made for a different device, but from the same manufacturer? For example, could I install a ROM for the MicroMax A110, which is the successor of A100? |
I am wondering are there any standards for the order of signals on I2C header? We get many I2C devices on the market, but the order of pins on the headers is inconsistent and hence we may not be able to insert any I2C device to our board. For example, some devices have VCC GND SCL SDA, some of them have GND VCC SDA SCL and like this there are many combinations. I understand that I2C is typically used within the board itself and hence order may not be defined. But the order of pins would matter for external devices that may be soldered directly to the header. | EDIT: This has been repeated several times, so putting it on top: Yes, it is well known that there is no "standard" for I2C inter-device connectors, but surely this community can formulate a list of "guidance" points for making such interconnects, based on signal behavior, noise minimization, and mitigation of risk due to wrong connections. NXP defined the without specifying a pin-out for I2C connectors, is my understanding. The only guidance from NXP seems to be a mention of placing a Ground and / or Vss between SDA and SCL if Vss / Gnd are carried across the interconnect. Purchases of various I2C modules has left me with a variety of I2C pin-outs, and a bit of a task keeping track of the various little ribbon-cable-switching shims I've had to make for them. e.g. Mono OLED module: SCL, SDA, GND, 5V (obviously not ideal, since clock and data are next to each other. Sensor Shield for Arduino: SDA, SCL, GND, 5V (again not ideal, plus switched SCL/SDA) Color LCD module: SCL, GND, 5V, SDA (Yay!) No-name I2C repeater: SCL, 5V, GND, SDA (ouch, they switched power pins! Nearly let the magic smoke out.) So my question is this: Is there a definitive / authoritative guideline for the I2C 4-pin connector pin-out sequence to use, where both Vss and GND are to be carried from host to device? Failing this, is there any directory, however incomplete, of I2C modules / devices listing the pin-out each has adopted? Clarification: Looking for guidelines such as "put Vss closer to SCL because..." rather than a defined standard which clearly does not exist. |
Below, in my adjacency matrix method I've created 2 arrays that produce the same results, but when changing values within the arrays I get 2 different results. The one labeled "array_matrixx" was my initial attempt, but altering values within a nested list would not just change one of the list, but would in fact change all of the nested list. On the other hand, the array labeled "array_matrix" uses a different approach to filling the array with zero's, and yields the correct result of changing the indices within the correct nested lists. Why would this occur if prior to the for loop, they are identical? I've listed all of the code needed to run the two lists to make comparisons. Just comment one or the other out. class Node(object): def __init__(self, value): self.value = value self.edges = [] class Edge(object): def __init__(self, value, node_from, node_to): self.value = value self.node_from = node_from self.node_to = node_to class Graph(object): def __init__(self, nodes=[], edges=[]): self.nodes = nodes self.edges = edges def insert_node(self, new_node_val): new_node = Node(new_node_val) self.nodes.append(new_node) def insert_edge(self, new_edge_val, node_from_val, node_to_val): from_found = None to_found = None for node in self.nodes: if node_from_val == node.value: from_found = node if node_to_val == node.value: to_found = node if from_found == None: from_found = Node(node_from_val) self.nodes.append(from_found) if to_found == None: to_found = Node(node_to_val) self.nodes.append(to_found) new_edge = Edge(new_edge_val, from_found, to_found) from_found.edges.append(new_edge) to_found.edges.append(new_edge) self.edges.append(new_edge) def get_adjacency_matrix(self): max_index = self.find_max_index() adjacency_matrixx = [([0] * (max_index + 1))] * (max_index + 1) print(adjacency_matrixx) adjacency_matrix = [[0 for i in range(max_index + 1)] for j in range(max_index + 1)] print(adjacency_matrix) for edge_object in self.edges: adjacency_matrix[edge_object.node_from.value][edge_object.node_to.value] = edge_object.value return adjacency_matrix def find_max_index(self): max_index = -1 if len(self.nodes): for node in self.nodes: if node.value > max_index: max_index = node.value return max_index graph = Graph() graph.insert_edge(100, 1, 2) graph.insert_edge(101, 1, 3) graph.insert_edge(102, 1, 4) graph.insert_edge(103, 3, 4) # Should be [[0, 0, 0, 0, 0], [0, 0, 100, 101, 102], [0, 0, 0, 0, 0], [0, 0, 0, 0, 103], [0, 0, 0, 0, 0]] print(graph.get_adjacency_matrix()) | I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3 The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]] Then I changed one of the innermost values: my_list[0][0] = 5 Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]] which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it? |
What is physically impeding electric current when a transformer steps up voltage? Is there some EM field along the conductor impeding electron movement? FYI, I'm not asking about losses or leakage. (assuming ideal transformer) I'm trying to get an electromagnetic explanation of how increasing turns on the secondary winding exchanges current for voltage. Thank you. | I am happy to always not understand how does a transformer works ... One answer give me 10 questions ... (So I suggest you to not answer to this question, if you do not want to have more questions :D) Here is the circuit : So I put the "coupling" factor to 1, in order to have no leakage inductance and I set the value of the inductors very high in order to have a very low magnetizing current. So the primary current is approximately equal to the secondary current. My question is the following : How the primary current can reach an equilibrium to be equal to the secondary load current ? I will not accept answer which tells Pout is equal to ... So Pin is equal to Pout... There is something happenning into the transformer ... Thank you very much and have a nice day ! |
I am using the following code to generate a table. \documentclass[acmsmall]{acmart} \begin{document} \begin{table}[!t] \renewcommand{\arraystretch}{1.3} \caption{Some text} \centering \begin{tabular}{|p{8.3cm}|p{1.7cm}|p{1.7cm}|} \hline \textbf{Some text} & \textbf{Some text} & \textbf{Some text} \\ \hline \textbf{Some text:} \begin{itemize} \item Some text \item Some text \item Some text \end{itemize} & 43\%{$\newline$} \checkmark{$\newline$} -{$\newline$} -{$\newline$} & 57\%{$\newline$} -{$\newline$} \checkmark{$\newline$} \checkmark{$\newline$} \\ \hline \textbf{Some text} \begin{itemize} \item Some text \item Some text \item Some text \item Some text \end{itemize} & 25\%{$\newline$} \checkmark{$\newline$} -{$\newline$} -{$\newline$} -{$\newline$} & 75\%{$\newline$} -{$\newline$} \checkmark{$\newline$} \checkmark{$\newline$} \checkmark{$\newline$} \\ \hline \textbf{Some text:} \begin{itemize} \item Some text \item Some text \end{itemize} & 0\%{$\newline$} -{$\newline$} -{$\newline$} & 100\%{$\newline$} \checkmark{$\newline$} \checkmark{$\newline$} \\ \hline \end{tabular} \label{table1} \end{table} \end{document} However, as shown in the figure below there are empty spaces (highlighted in yellow). I am just wondering if there is a way to remove those extra lines from the table? I am happy to provide any other details if needed :) | I have a macro that creates itemize environment in it. The issue is that I have extra space after the itemize environment when used in longtable. How to remove the space? \documentclass{memoir} \usepackage{enumitem} \usepackage{longtable} \usepackage{booktabs} \newcommand{\fuda}[2]{% Functions:% \begin{itemize}[nosep] #1% \end{itemize} Data:% \begin{itemize}[nosep] #2% \end{itemize} } \begin{document} \begin{longtable}{p{0.3\textwidth}|p{0.7\textwidth}} \caption[List of components]{List of functions and data allocated to each component} \label{d_plan} \\ \toprule \textbf{Components} & \textbf{Functions and Data} \\\midrule \textbf{Registration} & \fuda{ \item Register capabilities of the device \item Unregister capabilities of the device \item Register context representation }{ \item Interface List \item Capability List \item Protocol List \item Representation List} \\\bottomrule \end{longtable} \end{document} ADDED The solution that uses -\baselineskip: works with article class, but not with memoir class. |
I'm at an impasse here, I'm making the dress part of Gardevoir where the inner(green) and outer(white) faces will be visible, But i am also trying to use Cloth physics to animate the dress as well. But so far none of my own methods have yielded any satisfying results. One where creating the faces for the bottom part so each can have its own color would cause horrible clipping when put to the physics. I really need help with this. I could just keep the single color and call it a day, but no, I really need to know how to do this for any future projects. | How can you have an image as a texture (in this case on cloth) that is only applied to one side of a plane? I would like the reverse side to be a solid color. Please see below image where the cloth has the image texture on both sides. |
Show that $\varphi(m)|\varphi(n) $ whenever $m|n$. I am stuck after writing the formula. I know that if $m$ divides $n$, that means one of the prime factors of $n$ would include $m$ or a multiple of $m$. $$ \varphi(n)=n\prod_{i=1}^{k}\Bigl(1-\frac{1}{p_{i}}\Bigr) $$ | I want to prove that if $d \mid n \in \mathbb{N}$, then $\varphi(d) \mid \varphi(n)$. It's given that $d \mid n$, so we know that $n = dm$, for some $m \in \mathbb{Z}$. Now, I want to show that $\varphi(d) \mid \varphi(n)$, i.e. that $\varphi(n) = k\varphi(d)$, for some $k \in \mathbb{Z}$. Drawing a blank of where to go from here. |
Can you recommend any ready for use PHP scripts that replace certain strings with their html equivalents? | I'm interested in selectively parsing Mediawiki XML markup to generate a customized HTML page that's some subset of the HTML produced by the actual PHP Mediawiki render engine. I want it for BzReader, an offline Mediawiki compressed dump reader written in C#. So a C# parser would be ideal, but any good code would help. Of course, if no one has done it before, I guess it's time to start a project maintaining a free and separate Mediawiki parser, based on Mediawiki's own parser, but less tightly integrated with Mediawiki itself. So, does anyone know of any base I could begin with, that would be better than hacking from the Mediawiki PHP code? |
At Stack Exchange, one's reputation can never decrease below 1. Is negative reputation that is not counted in case of insufficient reputation deducted later on, i.e. when reputation is earned? EDIT: SOLVED. The point of my question was that it is ambiguous from /other Q&A whether, in the case of insufficient reputation mentioned above, the reputation is not decreased to below 1 just for the time being or the negative reputation is permanently ignored. The doubt was considering the fact that every user's reputation change is recorded, and there are reversions in reputation change in case of deletion of posts. | If a user is the type of person to consecutively get downvoted to potential negative reputation, so be it. What's the reasoning to maintain a minimum of one? One reason that may justify this is of trying to not deter new users from the site who haven't read the FAQ and unknowingly and wrongly ask or answer a question. But most of us acknowledge this and not downvote in such a scenario. So what's the reasoning behind this lower bound of 1? |
Can my old laptop with a Intel Atom N450 1.66 GHz run ubuntu without that much lag? It only has 1gb of ram which i feel might be an issue | I am a bit financially strapped and received a Gateway GT5056 tower. The tower has an AMD dual core 64-bit processor in it. Will Ubuntu 12.04 run on this machine? I will not have any other application other than LibreOffice installed. |
Suppose $G$ is a semigroup in which every equation of the form $ax=b$ or $ya=b$ has a solution. Does this solution have to be unique? | I have some difficulties with a task in algebra. I guess it's trivial and really easy but I can't figure out how to solve it. I have a set $G$ and a binary operation on it, let it be $\circ$. I have that the operation is associative and that the equations $a\circ x = b$ and $x\circ a = b$ have unique solutions. I have to prove that $(G, \circ)$ is a group. I already have that the operation is binary and associative, so I have to prove that there is unique identity element and unique inverse element and it will come from the equations, but how exactly? |
I am a graduate in biology and have worked on a thesis in the humanities titled 'Social science in the age of biology'. It discusses how biologists adopt different approaches to questions pertaining to human behaviour and organisation of society. It piqued my interest in the social sciences. I have now begun to study some of the works in the social sciences independently and am frustrated by the lack of learning resources online. Time and again, I feel the need for guidance. I am unable to enroll in a university for personal reasons. Stack Exchange provides a great platform for guided online learning. Is it possible to create a site where questions belonging to the social sciences can be addressed? | I have an idea or subject that should have a Q&A, and want to propose a new site. How can I do this? Related: |
This issue isn't very rare and there are many solution proposals around, but all I've found require some sort of access to the code of the iframe content. So this is the situation: I have a webpage which contains an iframe. The iframe contains another webpage, from a different domain, which content changes with interaction. Now, sometimes the allocated static iframe height is too much, and I get a lot of while space under the content. Sometimes it is too little, and some of the content of the iframe gets cropped out. And, sadly, I do not have access to the source code of the iframe content, so solutions like PostMessage are not an option. I am trying to figure out if JSONP is an option, but I'd like to ask if anyone had to deal with a similar issue before, and how they solved it. Any help is greatly appreciated | I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes. How do I resize the iframes to fit the height of the iframes' content? I've tried to decipher the javascript Google uses but it's obfuscated, and searching the web has been fruitless so far. Update: Please note that content is loaded from other domains, so the applies. |
A person randomly chooses a coin with probability 0.5: Find which coin he chose according to the outcome of 3 tosses: Tossing coin 1 yields a head with a probability P(X1 = H) = .3 (and tail with P(X1 = T) = .7). Tossing coin 2 yields a head with a probability P(X2 = H) = .6 (and tail with P(X2 = T) = .4). You earn $1 if you correctly guessed the coin and $0 otherwise. Design the optimum decision rule and estimate your average earning. Hello folks, I have this problem in hand and I want to understand the following : Are P(X1)=P(X2)=0.5? P(H|X1)=0.3 , P(H|X2)=0.7? How does the Decision Table look like in this problem? How to find the average earning? | A person randomly chooses a coin with probability 0.5: Tossing coin 1 yields a head with a probability P(X1=H)=.3 (and tail with P(X1=T)=.7). Tossing coin 2 yields a head with a probability P(X2=H)=.6 (and tail with P(X2=T)=.4). You earn 1 dollar if you correctly guessed the coin and 0 dollars otherwise. Design the optimum decision rule and estimate your average earning. Can anybody explain me ,how should i go about solving this problem? |
I have found the following formula for the sum of cosines in both and . \begin{align} \sum^n_{l=1} \cos \left(\frac{2 \pi l}{n}\right) = 0 \end{align} I would like to know what the sum would be if there is a multiplicative factor $k$ in the angle. \begin{align} \sum^n_{l=1} \cos \left(\frac{2 \pi l k}{n}\right) = ? \end{align} where, $k$ is a positive integer and $1 \le k \le (n-2)/2 $. Moreover, what if the interval for $l$ is changed from $[1, n]$ to $[0, l-1]$. So, \begin{align} \sum^{n-1}_{l=0} \cos \left(\frac{2 \pi l k}{n}\right) = ? \end{align} | How can we sum up $\sin$ and $\cos$ series when the angles are in arithmetic progression? For example here is the sum of $\cos$ series: $$\sum_{k=0}^{n-1}\cos (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \cos \biggl( \frac{ 2 a + (n-1)\cdot d}{2}\biggr)$$ There is a slight difference in case of $\sin$, which is: $$\sum_{k=0}^{n-1}\sin (a+k \cdot d) =\frac{\sin(n \times \frac{d}{2})}{\sin ( \frac{d}{2} )} \times \sin\biggl( \frac{2 a + (n-1)\cdot d}{2}\biggr)$$ How do we prove the above two identities? |
I can't update the patches below . I get an error. How to solve this? Check if you are using third party repositories. If so disable them, since they are a common source of problems. Furthermore run the following command in a Terminal: apt-get install -f Transaction failed: The package system is broken The following packages have unmet dependencies: libqt5quick5: Depends: libqt5qml5 (>= 5.12.4) but it is not installed Depends: qtbase-abi-5-12-8 but it is a virtual package Depends: qtdeclarative-abi-5-12-8 but it is a virtual package libqt5webchannel5: Depends: libqt5core5a (>= 5.12.8+dfsg~) but 5.12.8+dfsg-0ubuntu1 is installed Depends: libqt5qml5 (>= 5.12.4) but it is not installed Depends: qtbase-abi-5-12-8 but it is a virtual package libqt5webkit5: Depends: libicu66 (>= 66.1-1~) but 66.1-2ubuntu2 is installed Depends: libjpeg8 (>= 8c) but 8c-2ubuntu8 is installed Depends: libqt5qml5 (>= 5.12.4) but it is not installed Depends: libstdc++6 (>= 9) but 10-20200411-0ubuntu1 is installed Depends: qtbase-abi-5-12-8 but it is a virtual package Depends: qtdeclarative-abi-5-12-8 but it is a virtual package Depends: zlib1g (>= 1:1.2.0) but 1:1.2.11.dfsg-2ubuntu1 is installed | There are now errors when updating and I cannot install most software due to a corrupted /etc/apt/sources.list file. Is there a copy I can download to replace it? The file would be for Ubuntu 12.04 (Final Beta) in the United States. |
I read the man crypt and didn't understand what the phrase below means: salt is a two-character string chosen from the set [a-zA-Z0-9./]. This string is used to perturb the algorithm in one of 4096 different ways. | I'm having some trouble understanding the purpose of a salt to a password. It's my understanding that the primary use is to hamper a rainbow table attack. However, the methods I've seen to implement this don't seem to really make the problem harder. I've seen many tutorials suggesting that the salt be used as the following: $hash = md5($salt.$password) The reasoning being that the hash now maps not to the original password, but a combination of the password and the salt. But say $salt=foo and $password=bar and $hash=3858f62230ac3c915f300c664312c63f. Now somebody with a rainbow table could reverse the hash and come up with the input "foobar". They could then try all combinations of passwords (f, fo, foo, ... oobar, obar, bar, ar, ar). It might take a few more milliseconds to get the password, but not much else. The other use I've seen is on my linux system. In the /etc/shadow the hashed passwords are actually stored with the salt. For example, a salt of "foo" and password of "bar" would hash to this: $1$foo$te5SBM.7C25fFDu6bIRbX1. If a hacker somehow were able to get his hands on this file, I don't see what purpose the salt serves, since the reverse hash of te5SBM.7C25fFDu6bIRbX is known to contain "foo". Thanks for any light anybody can shed on this. EDIT: Thanks for the help. To summarize what I understand, the salt makes the hashed password more complex, thus making it much less likely to exist in a precomputed rainbow table. What I misunderstood before was that I was assuming a rainbow table existed for ALL hashes. |
I have a macro \mywonderfulmacro{...} that expects an ordinary floating point number in lieu of .... (For example, \mywonderfulmacro{4.51} is valid.) Now I would like to do something like this: \def\a{1.2} \def\b{1.3} \mywondefulmacro{\a * \b} The hope would of course be that the above code results in \mywonderfulmacro{1.56} being evaluated. Unfortunately, TeX doesn't work this way and I get an error! What is the correct/easiest way to do this? PS: I know the answer is surely implicit in previous questions/answers to this forum, given sufficient discernment, but my know-how is very low so please I please need an answer that addresses this specific question in this specific situation, not a pointer to some technical post with \the \numexpr and whatnot :/ | I am looking for a method to do minimal floating point / integer calculations in LaTeX, not for the purpose of package writing, but for the production of actual text. Here is an example to illustrate. Given the following input text The experiment included running a battery of \bind{T}{21} tests on \bind{S}{13} subjects, for a total of \bind{V}{T*S} expected values. However, since \bind{F}{37} values were defective, our successful measurement rate per subject was \use{100*round((V-F)/T,2)}\% it would be nice if was converted to: The experiment included running a battery of $21$ tests on $13$ subjects, for a total of $273$ expected values. However, since $37$ values were defective, our successful measurement rate per subject was $86$\%. Where \bind{C}{expression} defines a new constant C whose value is expression, and returns C, while \use{C} simply returns the value of C. Any tips? I am aware of the spreadtab package and this question: , but I am looking for something more. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.