So, I got a WiFi USB antenna, and managed to install the drivers both with apt-get and with a Git-hub, I think the problem is not there.  sudo apt-get install rtl8812au-dkms   I verified that it was installed using the following:  sudo dkms status lsmod | grep 8812   wich gave me  rtl8812au, 4.3.8.12175.20140902+dfsg, 5.3.0-28-generic, x86_64: installed rtl8812au, 5.6.4.2, 5.3.0-28-generic, x86_64: built    and    8812au               1290240  0 cfg80211              704512  4 iwlmvm,8812au,iwlwifi,mac80211    That makes me think that the drivers are actually installed, but when I plug the antenna nothing happens. I know similar questions have been asked, but I've found no solution in those questions, sorry if the question is poorly worded or tagged or anything, first time asking.    EDIT1 This is what happens when I run the lsusb command without the device plugged in:  $ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 002: ID 8087:0a2a Intel Corp.  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   And now, with the device plugged in:  $ lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 006: ID 0bda:b812 Realtek Semiconductor Corp.  Bus 001 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller Bus 001 Device 002: ID 8087:0a2a Intel Corp.  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub   EDIT2 SOLVED Thank you so much guys, it was the wrong driver. I needed the rtl88x2BU drivers. For Kernel 5.3, I got the working drivers in this GitHub

So I've been experimenting with Ubuntu on and off for a while, but I honestly have no idea what the hell I'm doing. So I have a realtek RTL8812bu WiFi dongle that I'm hoping to get working. I did some research, and came across  that a couple people across two threads said worked for them:  At the bottom it said there is a new version . So somewhere it said it was confirmed to work on kernels up to 4.16, so I checked and I'm on 4.15.0. But the problem I'm having, is what am I supposed to do? There is some installation guide at the bottom that is about as clear as mud to me since I don't know much.


I've run into some unexpected syntax highlighting mistakes while I  about VB6.  When I use _ after using ' to add comments about my code I see that _ does not work within ', but it should.  Here is a screenshot demonstrating the situation:

I noticed that sometimes my code gets highlighted in different colors when rendered.   What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange?


What am I doing wrong here with cron on boot?  Example:  To launch manually: screen -S example ./script.sh To recover manually: screen -x example  now, I just try to do the same thing (well, the launch part) using cron on boot  @reboot cd /home/administrator/script && screen -S example ./script.sh  I think it works without screen. For example:  @reboot cd /home/administrator/script && ./script.sh  but I also need this to run in the background, independent of the terminal. I have tried other options such as init, init.d, but there seems to be a lot of confusion out there on how it all works on which versions of linux. If you can fix my error above or show me a better solution, that would be great.  I am using Ubuntu 12.04.2 LTS  Thanks  * UPDATE *  So in response to Jan Wikholm, I have tried the absolute path and that completely fails.  Example  If I test this in the console:  screen -S example /home/administrator/script/script.sh  The script does not execute. Am I missing something conceptual here?  I get the screen error message [screen is terminating] immediately  * SOLUTION *  Finally figured it out. The issue with screen was the path to the executable.  Here is the final crontab entry that works like a charm  @reboot cd /home/administrator/script && /usr/bin/screen -dmS example ./script.sh  Thanks for the help Jan

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


I was just wondering how people are handling phone number validation. What im doing is; a user enters in mobile-phone(071412345) number and based on the first three digits assigns an international code(+4401412345) to it. But I had to declare a regex for each country, and how can i make this cleaner/better?  The suggested link is not really what im looking for

I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:   1-234-567-8901 1-234-567-8901 x1234 1-234-567-8901 ext1234 1 (234) 567-8901 1.234.567.8901 1/234/567/8901 12345678901   I'll answer with my current attempt, but I'm hoping somebody has something better and/or more elegant.


I know this question has been answered before, but that was 5 years ago and most airports have changed a lot since then. On 3/6/2019 I will be travelling from Boston to Punta Cana on Delta with a layover at JFK. I only have a layover of 90 minutes and need to get from Terminal 2 to Terminal 4. What is the best way to accomplish that, and do I still not need to go through TSA screening again? I would really appreciate any suggestions.

I have family who does not speak English.  They are changing planes in JFK Airport and will most likely be transferring from Terminal 2 (Delta) to Terminal 4 (China Southern Airlines).  At first I thought that directing them to use the Airtrain would be best.  However, in doing more reading my understanding is that the Airtrain would mean they would need to go through security again.  I found this on Delta's site:   If they use the JITNEY Shuttle to change from Terminal 2 to Terminal 4, does that mean they would not need to re-clear Security?  Edit: They are flying TO China. They are going from Tampa -> NY JFK -> China.


I have created a custom entity "Project" with this fields: id, name.  I have created a rule and added an action "create entity" and selected "Project".  I have added another action "Set a data value" and selected "name" of the newly created entity project and I had this message : "The selected data property doesn't support writing."  Here is the entity property info   /**  * Implements hook_entity_property_info().  */ function project_entity_property_info() {    $info = array();    $info['project']['properties']['id'] = array(     'label' => t('Project ID'),     'description' => t('The ID of the project.'),     'type' => 'integer',     'schema field' => 'id',   );    $info['project']['properties']['name'] = array(     'label' => t('Project name'),     'description' => t('Name of the project.'),     'type' => 'text',     'schema field' => 'name',   );   $info['project']['properties']['description'] = array(     'label' => t('Project description'),     'description' => t('Description of the project.'),     'type' => 'text',     'schema field' => 'description',   );   $info['project']['properties']['deadline'] = array(     'label' => t('Deadline'),     'description' => t('Project deadline.'),     'type' => 'date',     'schema field' => 'deadline',   );    return $info; }

I've got a D7 content type with a few fields; nothing particularly special.  I want to be able to programattically change the values of those fields from time to time, and so wrote a function like so:  function set_field_value($field_name, $node, $value) {     $wrapper = entity_metadata_wrapper('node', $node->nid);     $wrapper->$field_name = $value;     $wrapper->save(); }   This worked in a few test cases (like changing the title of a blog node), but when I try it on content type fields, I get an error like:     EntityMetadataWrapperException: Entity property field_project_video_status_yt doesn't support writing. in EntityStructureWrapper->setProperty() (line 497 of ...)   What I'm doing wrong?


I'm really have trouble even describing the definition of this word, but I saw a post somewhere that was talking about how people these days say things like, "I'm dying" or "I'm dead" or something like that but they obviously don't mean it. Like they are being extreme. This is truly murdering my brain right now. (Kinda like that.)

For example, when you are a little hungry and you say "I'm starving", or when you are so tired and you say "I'm dying". What do you call these type of expressions? Just exaggerations? I don't know how to explain this better.


After a few hours playing with Blender I was able to:   Figure out how to add a background image reference Match the camera position to my bg image using fSpy and fSpy addon for Blender 2.8 Model a simple wood deck     However, I can't get to render the whole thing including the image that is already correctly positioned.   I went through articles that will tell you how to add an image as a background, but not with it as a background for the camera.  Is there a way that I can render this with the setup I already have?  I'm using Blender 2.8.  Here's what I see in the rendering view:

First time I've used cycles rendering engine.  I'm using a movie clip as the background in short animation. Selected RBGA under Property Tab, and Transparent under Film Tab.  It looks good and individual frames in OpenGL active viewport render, and looks fine.  When I try to get it to spit out PNG files of the finished animation the objects render out fine, except no movie clip background as Blender Render engine did when using Paper Sky setting.  Operator error, or am I trying to do something Cycles won't do?  Haven't found an answer in my searches so far.  Can anyone point me in the right direction please.   Addition:  I think I found my problem after a couple more hours of research.  Post should read "operator ignorance" instead of operator error.  Too tired to try the solution tonight, everything looks better in the morning. Thanks anyway.  Sorry, I just saw your posts.  Really tired.  Much appreciation.


I have used 32-bit Kubuntu and am trying out 64-bit Ubuntu 14.04 (Unity). By default Ubuntu when booting only mounts the partition on which it resides. I have several others, in cluding one which Ubuntu calls "37 GB Volume", alias /dev/sdb5 , on which Kubuntu and some data files reside. On the other systems on my computer, namely Windows XP and Kubuntu 12.04, all visible partitions are mounted on booting, and I believe I could achieve this by adding some code to a boot file; but I don't know the code and I don't know which file. A related problem which XP can handle is to get the Numlock to come on while booting so that the number characters in my password are read properly.   Trivial problems, one may say, but I like to believe that anything Windows can do, Ubuntu can do better!

How can I auto-mount all my hard disk partitions?


Bootchart set up png file every time machine starting. How to make bootchart nor working without remove it ?  Thanks

I dont want a Bootchart to be generated on every startup. How do I disable bootchart ?  Once disabled, how do I re-enable bootchart ?  I don't mean uninstall.


#!/bin/sh # This is comment! echo Hello World for file1 in /C:/Users/shubham.tomar/Desktop/Shell/Test1/*;  do filename1=$(basename "$file1") echo $filename1 echo "------------------------" for file2 in /C:/Users/shubham.tomar/Desktop/Shell/Test2/*; do filename2=$(basename "$file2") echo $filename2 if [["filename1" = "filename2"]]; then echo "---File matched---" else mv -f /C:/Users/shubham.tomar/Desktop/Shell/Test2/$filename2 /C:/Users/shubham.tomar/Desktop/Shell/Moved/ fi echo "--------------File Moved-----------" done done   **  NOTE ABOUT PROBLEM  **  There are some files in a particular path for ex: Desktop/Test1 and Downloads/Test2 I want to write a shell script to move all the files present in Test2 and not in Test1 to a path for ex: Documents/MovedFiles  files may be of any type

You've got three folders:   folder current, which contains your current files folder old, which contains an older version of the same files folder difference, which is just an empty folder   How do you compare old with current and copy the files which are different (or entirely new) in current to difference?    I have searched all around and it seems like a simple thing to tackle, but I can't get it to work in my particular example. Most sources suggested the use of rsync so I ended up with the following command:  rsync -ac --compare-dest=../old/ new/ difference/   What this does however, is copies all the files from new to difference, even those which are the same as in old.  In case it helps (maybe the command is fine and the fault lies elsewhere), this is how I tested this:   I made the three folders. I made several text files with different contents in old. I copied the files from old to new. I changed the contents of some of the files in new and added a few additional files. I ran the above command and checked the results in difference.   I have been looking for a solution for the past couple of days and I'd really appreciate some help. It doesn't necessarily have to be using rsync, but I'd like to know what I'm doing wrong if possible.


I really need help because people are killing me and steeling my stuff.

On the iOS version for a tablet is there a way to password protect the multiplayer game so that other people on the same wifi network can not access the world?


I am inserting data into a MySQL Table using PHP/SQL Queries and when i use a £ (pound) symbol its inserting a Â character before so it looks like  Â£ then the rest of the string   My SQL Query is just simple:  $sql="INSERT into table (column1, column2) values (value1, value2)"; $rs=mysql_query($sql,$conn);   is there any way i can stop the Â from inserting into the MySQL table?  Thanks

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


About twenty years ago (so, late 90s, but the book could've been older) I remember my mother read me a book. The basic premise was that for some reason, modern society had collapsed, been destroyed, or otherwise been forgotten, and a new human civilization had developed. Humans from this far future then rediscovered various items from modern times and tried to interpret what they were used for; this book described their findings.   I remember this being a picture book, but not being very colorful. Possibly it was going for a sort of Victorian/Planet-of-the-Apes aesthetic. I recall the future society being less advanced than our own, and they ascribed religious significance to a lot of the things they found (and were generally wrong about everything). I think the idea of the book was to be satirical and/or humorous, but also as a young child I was freaked out by the idea of everyone dying in some cataclysm.   I'd like to find this book again because I think I'd more appreciate the humor and I want to see if it's still as unsettling as I remember, but I have no idea how to even begin to look for it.

I read it in Reader's Digest in the seventies. Archaeologists interpreted everyday objects as the TV set and the toilet seat to be sacred and precious.


When not all comments are shown, often only the start of the discussion and the end is seen, with some comments in the middle cut out. Often this makes the discussion incomprehensible. Please mark the place where comments are elided.

When there are several comments some of them get hidden, which I don't mind, except when comments in the middle are hidden and I don't realize it till I get to the end. Then I have to unhide the comments and try to figure out which ones I haven't read.  The comments stay in order as they should so you can follow them but when you hide random ones in the middle you can loose the context of the comments until you unhide them all.  I have a couple of ideas that could help with this.  Put the Show X more comments at the top of the comments instead of the bottom  Put some indicator that there or hidden comments between these two  Comment this is the first comment Comment this is the second comment ... Comment this is the fourth comment, comment three is hidden indicated by the dots Comment this is the fifth comment ... Comment this is comment number nine, comment 6, 7, and 8 are hidden    Where the dots equals some indicator that there are hidden comment between two comments  Finally you could highlight the newly shown comments when you hit the unhide comments link like you do when you post your question.  Update  Just wondering if this could get a second look? Seems the community really likes the idea, and Jeff is ultimately who made the decision not to do it.


Long story short I've got my local development machine into a bit of a mess with MSDTC and I have the horrible red arrow in DCOM. I have an application that uses MSDTC and MSMQ, and it's got itself stuck. Just to be clear, the SQL Server instance is Express and it is running on my machine. Everything is local to my machine is this case for my development purposes. I have uninstalled MSDTC, MSMQ and then reinstalled MSDTC and reset the log and then installed MSMQ again, however the issue remains. Clicking on COM+ gives the following error:  Delving into MSDTC I can see no active transactions, but curiously the summary totals show 5 transactions, even though none are in the list:  Moving over to SQL Server, the following commands all return no rows:  SELECT @@trancount DBCC OPENTRAN SELECT XACT_STATE()  However, the last query against sys.dm_tran_active_transactions returns 5 rows:  It looks like my machine was in the middle of a debugging session, I left it running and then early in the morning, my machine rebooted. I would like to remove these orphaned transactions, but I'm not sure how. Can I just DELETE FROM sys.dm_tran_active_transactions without any negative impact so I can go back to using MSDTC without issues.

today I used the system object sys.dm_tran_active_transactions (to be honest for the first time). I had an issue with distributed transactions (Microsoft DTC) and went digging there after I had no clue with the sp_whoIsActive oputput alone.This issue is solved but now I see that there are quite old transactions in the table with type "worktable". Here's the output for the following query  SELECT  *,  case transaction_type          when 1 then 'Read/Write'          when 2 then 'Read-Only'           when 3 then 'System'          when 4 then 'Distributed'         else 'Unknown - ' + convert(varchar(20), transaction_type)       end as tranType,      case transaction_state        when 0 then 'Uninitialized'        when 1 then 'Not Yet Started'        when 2 then 'Active'        when 3 then 'Ended (Read-Only)'        when 4 then 'Committing'        when 5 then 'Prepared'        when 6 then 'Committed'        when 7 then 'Rolling Back'        when 8 then 'Rolled Back'        else 'Unknown - ' + convert(varchar(20), transaction_state)   end as tranState,   case dtc_state        when 0 then NULL        when 1 then 'Active'        when 2 then 'Prepared'        when 3 then 'Committed'        when 4 then 'Aborted'        when 5 then 'Recovered'        else 'Unknown - ' + convert(varchar(20), dtc_state)   end as dtcState FROM    sys.dm_tran_active_transactions  ORDER BY transaction_begin_time     The transaction_begin_time happens to correlate with the time the SQL Server Service was last restarted.  Should I be concerned about this in any way? I did have a look at  to learn more about the dmv. However it just mentions that worktables are used for storing temporary query results in tempdb. However my understanding is that if I kick off a query whose execution plan decides to spool to tempdb and use a worktable a new worktable is created each time it is needed. Therefore it seems odd that therer are 6 worktables so old.  I could hypothesize that these are tables reused since service restart for monitoring queries which run constantly or internal SQL server stuff. Anyway the transaction type read only seems to be harmless and I noticed no sign of blocking or version store growth.  Thanks in advance for your assistance  Martin


How does the selection process to attend Hogwarts happen? Do they look at all the residents in the country and find the ones with magic: this seems quite time consuming to me. Do they have a process to narrow down candidates then look more closely?

So all wizards get an invitation to Hogwarts at 11... How do they know whom to invite?  If a wizard is Muggle-born, then nobody would know about their existence.  Or do they register some weird magical stuff being done by them before 11?


I have a simple question. What does     Shared a link to a question that was visited by 25 unique IP addresses. This badge can be awarded multiple times.   for announcer badge means?

On Stack Overflow, I see a set of :  (bronze),  (silver), and  (gold). Their common description is "Shared a link to a question that was visited by x unique IP addresses in y days". Now, how do I share a link? Is this a harbinger of assimilation by Reddit/Facebook/whatever? The blog is quiet...too quiet... There is now  for this. Later, many of the actual numbers in the blog post changed, like  and .


We all know why there are 3-base codons, and why there aren't any 2-base codons. But why is there not a 4-base a 5-base codon?

DNA is made of 4 unique nucleotides. When coding for a protein, a sequence of 3 nucleotides is used to code for each amino acid. Why are codons 3 nucleotides in length?  A related question can be found here:


Is there a way to setup Skydrive sync service on Ubuntu?  According to winehq I can not use wine to install skydrive so I am looking for a way to install it on Linux

I have Ubuntu 13.10 and I don't know how to install OneDrive on ubuntu 13.10 x64.


I am working on a simple app to take a picture and place it in an ImageView, it works if I accept the picture, however if I choose not to use the picture, I get "java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.os.Bundle.get(java.lang.String)' on a null object reference". Debugging it I can see mExtra=null, there I implemented a if\else statement but to no avail the app still crash if I reject the picture.  Here is the code snippet:   public class MainActivity extends AppCompatActivity { int scoreTeamA = 0; int scoreTeamB = 0;  Button btnTakePhoto; ImageView imgTakenPhoto; private static final int CAM_REQUEST = 1313; // private static final String EXTRAS_CAMERA_FACING = "android.intent.extras.CAMERA_FACING";  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);      btnTakePhoto = (Button) findViewById(R.id.take_left_picture);     imgTakenPhoto = (ImageView) findViewById(R.id.left_player_image);//left_player_image imageView name      btnTakePhoto.setOnClickListener(new btnTakePhotoClicker()); }  public void imgClick(View view) {     Toast.makeText(this, "imageview clicked", Toast.LENGTH_SHORT).show();     Intent cameraintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);     startActivityForResult(cameraintent, CAM_REQUEST); }  @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) {     super.onActivityResult(requestCode, resultCode, data);      if (requestCode == CAM_REQUEST) {          Bitmap thumbnail = (Bitmap) data.getExtras().get("data");          if (thumbnail == null) {             //if picture not accepted to be used set the imageView to the star2.png file             imgTakenPhoto.setImageResource(R.drawable.star2);             Toast.makeText(this, "no image to include", Toast.LENGTH_SHORT).show();         } else {             //if picture accepted use it to populate the imageView             imgTakenPhoto.setImageBitmap(thumbnail);          }     } }     class btnTakePhotoClicker implements Button.OnClickListener {         @Override         public void onClick(View v) {             Intent cameraintent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);             startActivityForResult(cameraintent, CAM_REQUEST);         }     }          My issue seems to be in the onActivityResult method in the if/else statement, but I am not seeing it?  I would greatly appreciate your help, Thanks, Olivier

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?


I'm confused, perhaps unnecessarily by which term to use:     What programs is company X involved in?     OR     What programs are company X involved in?

I'd say Microsoft have a way of bending the rules and I know that McLaren have won the championship. While this sounds strange, I believe it is correct English (sorry, I'm not native).   But when it's a small company, would you still use it this way? Is a company always plural, or are small companies singular? I.e., would you say Bakery Johnson makes fine bread or Bakery Johnson make fine bread? Is it My book seller, Woody's, have moved or is it has moved?


We are doing a new website and the current  website www.domains.com has been running for almost 3 years and is quite visible on search engines.  Now we are working on new website with multilingual features and we are also using custom cms that is developed using asp.net webform.  and we have new url for which will render old url useless.  for example in current website internship page can be accessed via two url  Internship    and Employment page can also be accessed via two url     Now with new cms following for the above mentioned internship page we use following url    since new website actually doen't contain folder internship i was thinking of  creating a folder internship and default.aspx and make it 301 redirect  from http://www.domain.com/internship/Default.aspx to http://www.domain.com/en/internship/1/21/internship  is this approach correct.  I looked for best approach on net and found this article which has also confused me  as it now showing any practical example. as other article save we should use 302 redirect etc...  Please advise how can i make a redirect from the old website link which is http://www.domain.com/internship/Default.aspx TO new website link http://www.domain.com/en/internship/1/21/internship which basically has same contents.  appreciate reply on this

I have done major updates to my website, and renamed all my URLs.  How can I tell Google that I have renamed these URLs and let Google refresh its index?  My website URL: http://www.pndmasr.com/  My sitemap: http://www.pndmasr.com/sitemap.xml  I have uploaded my sitemap via Google Webmaster Tools many times.  However, every time I search Google for "pndmasr", I still get results with old pages. I have waited more than 3 days but the problem remains. Any suggestions?  Is there a problem with my sitemap?


i want to create a QGIS action which copies features between two points layers using pyqgis .  i have read  and i try to use this code:  # only QGIS < 2.0 iface = qgis.utils.iface # Make the source layer active iface.setActiveLayer( sourceLayer ) # Set the selection on the source layer (Could also be done manually with the selection tools sourceLayer.setSelectedFeatures( [ 1, 5, 10 ] ) # Copy iface.actionCopyFeatures().trigger() # Set destination layer active iface.setActiveLayer( destinationLayer ) # Turn on editing on destination layer, so we can paste destinationLayer.startEditing() # Paste features iface.actionPasteFeatures().trigger() # Uncomment to automatically save edits # destinationLayer.commitChanges()   but in my case i dont need to copy selected features but i need to copy all features from sourceLayer to destinationLayer,and i need to transfer common attributes from sourceLayer to destinationLayer .  What changes do I need in this code?

I have created a table join between two shapefiles which I've named 'OSMM' and 'Mastermap'. I want to copy and paste all features (polygons) without a match from the target layer ('Mastermap') into the parent shapefile ('OSMM'). I can't find any up-to-update code for QGIS 3.6. Here is my code so far: #1. loads the SHP files uri = 'C:/Users/xx/Downloads/OSMM.shp' vlayer = iface.addVectorLayer(uri,"","ogr") uri = 'C:/Users/xx/Downloads/Mastermap.shp' vlayer = iface.addVectorLayer(uri,"","ogr")  #2. Joins "InvoiceNum" from OSMM to Mastermap layerToJoin = QgsProject().instance().mapLayersByName('OSMM')[0] target = QgsProject().instance().mapLayersByName('Mastermap')[0] myJoin = QgsVectorLayerJoinInfo() myJoin.setJoinFieldName('InvoiceNum') myJoin.setTargetFieldName('InvoiceNum') myJoin.setJoinLayerId(layerToJoin.id()) myJoin.setUsingMemoryCache(True) myJoin.setJoinLayer(layerToJoin) myJoin.setJoinFieldNamesSubset(['InvoiceNum']) target.addJoin(myJoin)  #3. Selects NULL features from Mastermap params = { 'EXPRESSION' : '\"OSMM_InvoiceNum\" is NULL', 'INPUT' : 'C:/Users/xx/Downloads/Mastermap.shp', 'METHOD' : 0 } processing.run("qgis:selectbyexpression", params)  So how do I perform the PyQGIS version of Ctrl+C on 'Mastermap' and Ctrl+V into 'OSMM'? Presumably I will then need to use the following code: #5. Save the changes OSMM.commitChanges()


Just want to check if my computer can run Ubuntu. It is an old IBM ThinkPad, so here are the basic stats I could find:  IBM 28832ZU  Processor Intel(R) Celeron(R) M processor 1300MHz  Processor Speed 1.27 GHz  Memory (RAM) 2048 MB  Operating System Microsoft Windows XP Professional  Operating System Version 5.1.2600  Intel Extreme Graphics 2M   And here is some info pulled from the graphics panel  NTEL(R) EXTREME GRAPHICS 2 FOR MOBILE REPORT  Report Date:        06/28/2013 Report Time[hr:mm:ss]:  17:53:20 Driver Version:     6.14.10.3943 Operating System:   Windows NT* 5.1.2600 Service Pack 2 Default Language:   English DirectX* Version:   9.0 Physical Memory:    2038 MB Min. Graphics Memory:   8 MB Max. Graphics Memory:   64 MB Graphics Memory in use: 7 MB Processor:      x86 family 6 Model 9 Stepping 5 Processor Speed:    1296 MHZ Device Revision:    2   Output Devices Connected to Graphics Accelerator   *   Active Notebook Displays:1

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?


If you click on any tag, it opens up the main page for that tag. One of the options on that page is a link to the "top users" of that tag. If you follow that link you get various statistics relating to the top users of that tag. On the side of that page, though, is a list of "related tags". For some reason, the top related tag is always the tag itself. E.g. if you are on the "top users" page for  the first tag displayed under "related tags" is .  This seems a bit odd — the point of "related tags" is to show other similar tags, not the very tag that you are already viewing. Can this be fixed so that "related tags" only displays actual related tags and not the current tag itself?  Note, It is apparently only under the "top users" page the "synonyms" page, the "hot" page, and the "new" page that the tag itself appears as a related tag; on other pages that display related tags, such as the main page of a tag, the tag itself does not appear.   I checked various tags on various sites, and the issue appears to be the same on all of them. Here is a sample screenshot:

Only seems to be for the "Top Users" page of a tag.  Confirmed for multiple sites and tags.


I am trying to install php5-curl via terminal in Ubuntu 14.04.  I got following error.  sanchit@sanchit-Satellite-A660:~$ sudo apt-get install php5-curl  Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  php5-curl : Depends: php5-common (= 5.5.9+dfsg-1ubuntu4) but 5.5.9+dfsg-1ubuntu4.6 is to be installed E: Unable to correct problems, you have held broken packages.   I then did sudo apt-get upgrade. And I am getting the same error.   sanchit@sanchit-Satellite-A660:~$ sudo apt-get upgrade Reading package lists... Done Building dependency tree        Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. sanchit@sanchit-Satellite-A660:~$ sudo apt-get install php5-curl Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  php5-curl : Depends: php5-common (= 5.5.9+dfsg-1ubuntu4) but 5.5.9+dfsg-1ubuntu4.6 is to be installed E: Unable to correct problems, you have held broken packages.   At some places it is advised to use Synaptic, but I am keen on solving it using terminal.

After upgrading from 10.04 to 12.04 I am trying to install different packages.  For instance ia32-libs and skype (4.0).  When trying to install these, I am getting the 'Unable to correct problems, you have held broken packages' error message.   Output of commands:  sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   After running this:  sudo dpkg --configure -a foo@foo:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.


I'm new to FireStore and I'm building an app for a educational institute. I have 2 different batches and each batch with 2 different classes.     {CBSE > xi, xii  &  CHSE > xi, xii}  I want the student to login to my app with FirebaseAuth and FireStore already have those students data as   User(collection) >> users(Document)(using the userID given by FirebaseAuth)  >>  FullName: (Student's name)                                                                                Phone:(number)                                                                                Board:(There Batch or Board, i.e., CBSE or CHSE)                                                                                Class:(class, i.e., XI or XII)                                                                                email:(email)   so if a student belongs to CBSE and XI, I want them to go to a different activity and if from XII of the same batch then go to a different activity. Similarly for the other Batch (CHSE) also.  I have written a code check this out  public class test extends AppCompatActivity {  FirebaseAuth fauth; FirebaseFirestore fstore; String userID, mboard, mclass; TextView Board, Class; private Object testB, testC;  @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_maths);     Board = findViewById(R.id.Board);     Class = findViewById(R.id.Class);      fauth = FirebaseAuth.getInstance();     fstore = FirebaseFirestore.getInstance();      userID = fauth.getCurrentUser().getUid();      final DocumentReference documentReference = fstore.collection("users").document(userID);     documentReference.addSnapshotListener(this, new EventListener<DocumentSnapshot>() {         @Override         public void onEvent(@Nullable DocumentSnapshot documentSnapshot, @Nullable FirebaseFirestoreException e) {             Board.setText(documentSnapshot.getString("Board"));             Class.setText(documentSnapshot.getString("Class"));             mboard = Board.toString();             mclass = Class.toString();             testB = String.valueOf(documentSnapshot.getData().get(Board));             testC = String.valueOf(documentSnapshot.getData().get(Class));               if (testB == "CHSE") {                 if (testC == "XI") {                     startActivity(new Intent(new Intent(getApplicationContext(),MainActivity.class)));                 }                 if (testC == "XII") {                     startActivity(new Intent(new Intent(getApplicationContext(),test.class)));                 }             }         }     });   } }   From a YouTube tutorial I got this but with 2 problems :- 1. I have to use a textView on the layout. How can I just store the value to a variable??? 2. the if...else doesn't work. I just want that to happen. How will I let students go to there respected activities with there Batch and Class????  Please help me out and thank's in advance....

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Let's say I have two cities with one inquisitor and one unit blocking the road between the cities. In theory, if the two cities are far apart enough, the AI great prophet shouldn't be able to convert either city because it has to leave the road at some point and that's when I move my inquisitor from one city to the other. However, the AI doesn't seem to realize this and the great prophet never gives up and keeps running around my two cities forever (until I slip up). Is there a way to stop this behavior besides DoW? It's a little annoying to have to deal with the great prophet every turn until endgame. I know that the great prophet will leave if I have an inquisitor in every city but I think that seems a little excessive.  Also, in general, the great prophet seems to know which of my cities have inquisitors stationed (pre-spy). The unit itself has a very limited sight range. Is this a bug or is it an intended map hack?

The strongest player in the game is a close ally of mine and we each founded and follow of one of the strongest two religions in the game, with little cross-over between religions within our territories.  I've just spotted that he has a Great Prophet approaching my territory. According to the Civopedia they are powerful at spreading religion, and I'd rather not have a huge hit to the followers of my religion in my cities.  How can I prevent another players Great Prophet from damaging the religion in my cities, preferably without causing a major diplomatic incident.


Hi I am trying to understand the if it is ever possible to use Life's. I know technically the plural for the word life is Lives but I am still curious.   Sorry maybe I am not to clear on it. I would use the term Life's Boats not in the typical manner of a Life Boat. But in the descriptive manner for a boat that fits every aspect of life.

Why does the plural form of "life" is "lives", while the plural form of "still life" is "still lifes"?  From Wikipedia:     A still life (plural still lifes) is a work of art depicting mostly   inanimate subject matter, typically commonplace objects which may be   either natural (food, flowers, plants, rocks, or shells) or man-made   (drinking glasses, books, vases, jewelry, coins, pipes, and so on).


Just like we get to mark questions as favorites, is there any scope/relevance of being able to mark individual answers as favorites as well. Of course, there is an indirect way to do that by 'upvoting' the answer and it will be recorded in the user profile's upvotes. But if we can mark favorite answers, it helps coming back later and referring to the concept (which supposedly has been explained in the answer).

Lots of questions are very generic, "share an experience" kinds of questions. In these cases, I am quite often interested in specific answers that may not have gotten that many upvotes. These questions also tend to elicit lots of responses, so going back to find the answers I'm interested in somewhere in the middle of a sea of responses is a pain. Is there a way to favorite or bookmark these answers?


Let $p: Y \to X$ be a covering space and $X$ is connected. I want to show that $\forall x \in X$ the cardinality of $p^{-x}$ is the same.   $\textbf{My Attempt:}$ Let us first fix a point $x_0 \in X$ such that $|p^{-1}(x_0)|=\kappa$.  Then let $H=\{x \in X \mid  |p^{-1}(x)=\kappa| \}$  Then let $f: H \to \text{Cardinals}$ be defined as  $f(x)=|p^{-1}(x)|$. Then $f$ is a constant function on $H$.   How do I  show that $H$ is open? $H$ is the inverse image of $\{\kappa\}$ but this is a singleton set from the collection of cardinals. I am not really sure what to do with that.  If I can show that $H$ is open, then I can prove by contradiction, using the assumption of connectedness, that all $x \in X$ are such that $|p^{-1}(x)|= \kappa$.

In "Knots and Primes: An Introduction to Arithmetic Topology", the author uses the following proposition   Let $h: Y \to X$ be a covering. For any path $\gamma : [0,1] \to X$ and any $y \in h^{-1}(x) (x = \gamma(0))$, there exists a unique lift $\hat{\gamma} : [0,1] \to Y$ of $\gamma$ with $\hat{\gamma}(0) = y$. Furthermore, for any homotopy $\gamma_t (t \in [0,1])$ of $\gamma$ with $\gamma_t = \gamma(0)$ and $\gamma_t(1) = \gamma(1)$, there exists a unique lift of $\hat{\gamma_t}$ such that $\hat{\gamma_t}$ is the homotopy of $\hat{\gamma}$ with $\hat{\gamma_t}(0) = \hat{\gamma}(0)$ and $\hat{\gamma_t}(1) = \hat{\gamma}(1)$.  The author then follows with; "In the following, we assume that any covering space is connected. By the preceding proposition, the cardinality of the fiber $h^{-1}(x)$ is independent of $x \in X$."   I am not sure why this results is true. This is my attempt at explaining it to myself. Take two different $x_1, x_2$ and their fibers $h^{-1}(x_1), h^{-1}(x_2)$ such that $y_1 \in h^{-1}(x_1)$ and $y_2 \in h^{-1}(x_2)$. Take two paths $\gamma_1, \gamma_2$ such that $\gamma_1(0) = x_1$ and $\gamma_2(0) = x_2$. Then we get two lifts $\hat{\gamma_1}, \hat{\gamma_2}$ with $\hat{\gamma_1}(0) = y_1$ and $\hat{\gamma_2}(0) = y_2$. Now, since our covering space is connected we can continuously deform $\hat{\gamma_1}$ into $\hat{\gamma_2}$ and conclude that every elements in $h^{-1}(x_1)$ is also in $h^{-1}(x_2)$ and vice versa. I feel that this is wrong but cannot figure out the right way to see this. Any help would be appreciated.


I have run into a dilemma where I have a bunch of VF page markup and code that is to be used on Two different VF pages. I would like to put all of this code, javascript, etc into a component so it is easier to maintain. The problem,   Component uses VF components that require them to be children of an <apex:form> tag The component will be used on a VF page which has its own <apex:form> tags.  The location of the component is within a  tag so I cannot break up the main page form tags as the  will not be properly closed and other TDs have components that require them to be a child of a form.    Since a VF component that contains a form tag cannot be placed within form tags I cannot figure out how to do it.  Anyone have any wise advice?

I would like to create a VF page and call a custom component inside it.    <apex:page controller="MyController"> <apex:form> <c:mycomponent id="myId" attributeName="{attributevalue}"/> </apexform> <apex:page>   But this returns me: 'c:mycomponent' component cannot be nested within form tags'  I have tried to without the  and call this page from another one using the  tag, but it doesn't work either.  I read somewhere that is not possible to do what I need, but in the past I was allowed because I have some examples in my old code.  Is there a workaround now?  Thanks in advance


When I enter sudo apt-get upgrade, this message shows up:  dpkg: error: cannot scan updates directory `/var/lib/dpkg/updates/': No such file or directory E: Sub-process /usr/bin/dpkg returned an error code (2)   Any Help ?!

I want to install a package in Ubuntu 14.04, but every time I run the ./configure command it gives me this error:  E: Cannot get debconf version. Is debconf installed? debconf: apt-extracttemplates failed: No such file or directory Extracting templates from packages: 35%E: Cannot get debconf version. Is debconf installed? debconf: apt-extracttemplates failed: No such file or directory Extracting templates from packages: 70%E: Cannot get debconf version. Is debconf installed? debconf: apt-extracttemplates failed: No such file or directory Extracting templates from packages: 100% dpkg: error: cannot scan updates directory `/var/lib/dpkg/updates/': No such file or directory E: Sub-process /usr/bin/dpkg returned an error code (2)


Centixels-MacBook-Pro:~ Centixel$ /* some command */ Centixels-MacBook-Pro:~ Centixel$ ./a.out Centixels-MacBook-Pro:~ Centixel$ ./a.out Centixels-MacBook-Pro:~ Centixel$ ./a.out Centixels-MacBook-Pro:~ Centixel$   I want to be able to access /* some command */ in two upkey presses, rather than 4 or N upkey presses. Is this possible to implement in settings? I hate having to upkey a million times through repeat commands to access a previous command. If this is a repeat question, please refer me, I was not sure how to ask the question. Thank you in advance for your help. Centixels-MacBook-Pro:~ Centixel$ bash --version GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19) Copyright (C) 2007 Free Software Foundation, Inc.  Edit: # .bashrc  # User specific aliases and functions . .alias alias ducks='du -cks * | sort -rn | head -15'  # Source global definitions if [ -f /etc/bashrc ]; then     . /etc/bashrc fi  PATH=$PATH:/home/username/bin:/usr/local/homebrew export PATH export HISTCONTROL=ignoreboth:erasedups  This is my edited .bashrc file (in my home directory), and the changes seem to not have been enacted, I have restarted my terminal as well.

The same command is listed in my history again and again. How can I avoid this? I know it's possible via HISTCONTROL but I haven't found the right way.


I am looking for a simple way to see if this array:  array('apples', 'bananas');  is associative or not, that is key=>value. Now PHP will give you something like:  array(2){     [0]=>'apples'     [1] => 'bananas' }   if you var_dump the above array. So in theory I have my associative array. But what I am looking for is to see if array('key' => 'some value', 'some_other_key' => 'some other value'); is a "true" associative array or if its just a regular array.  I have seen a couple posts on this through out stack but a lot of their answers are really complicated or poorly written or not even OO at all.

PHP treats all arrays as associative, so there aren't any built in functions. Can anyone recommend a fairly efficient way to check if an array contains only numeric keys? Basically, I want to be able to differentiate between this: $sequentialArray = [     'apple', 'orange', 'tomato', 'carrot' ];  and this: $assocArray = [     'fruit1' => 'apple',     'fruit2' => 'orange',     'veg1' => 'tomato',     'veg2' => 'carrot' ];


I want to hide a column on the NewForm of a list but it should be visible on the EditForm.  How to do this?

I have 5 columns in the custom list. Out of which only 3 have to displayed in the NewForm.aspx page.  All of the 5 columns have to be displayed on the EditForm.aspx page. While googling, I have come across the following  :  When I implemented the code that was given on this page, I get an error which says that parentNode is not found. Please guide me how can I implement this requirement.  Any other alternatives other than this are also appreciated.


I'm tried to get this type of mail from my HTML website.  Name: XYZ  Email: xyz@gmail.com  Message: msg  Can anybody help me to get this type of mail when somebody fills my HTML form, Remember I don't want to use any programming language like PHP. If anyone has javascript code for it then please share it.

What techniques are available for sending an email via a webpage or a form on a webpage?   I've got some background idea that you POST the form data to a script but I've don't really know what a cgi script is (I'd love to learn if this is the suggested method!) or what the current practice is.  This is just to provide some way for users to contact the operators. The in-page form seems like it would be easier on the user than ask them to open their mail client. I was also concerned about bots harvesting the contact email address (in the case of mailto: links).


Let $X$ be a Hausdorff space and $\{C_s:s\in S\}$ be a family of non-empty connected compact subsets of $X$. Suppose that for every $s_1,s_2\in S$ there exists $s_3\in S$ such that $C_{s_3}\subseteq C_{s_1}\cap C_{s_2}$. Show that $C=\displaystyle\bigcap_{s\in S}C_s$ is compact, connected and non-empty.   The condition $C_{s_3}\subseteq C_{s_1}\cap C_{s_2}$ implies $\{C_s:s\in S\}$ has the finite intersection property, because every $C_s$ is non-empty. Also, every $C_s$ is closed because it's compact and $X$ is Hausdorff. Fix $s_0\in S$. Then the family $\{C_s\cap C_{s_0}:s\in S\}$ is formed by closed subsets of $C_{s_0}$ with the finite intersection propery. Because $C_{s_0}$ is compact then $C=\displaystyle\bigcap_{s\in S}C_s\neq\emptyset$.  Also, $C$ is a closed subspace of $C_{s_0}$, hence $C$ is compact.  It remains to show $C$ is connected. This I can't do yet. Would anyone give me a hint?

This is an old exam question that I don't have a solution to:  Let $X$, a compact Hausdorff (T2) space, and let $\phi$ a family of closed, non-empty, and connected subsets of $X$, such that for every $A, B \in \phi$, $A \subset B$ or $B \subset A$.  Prove that $Y:= \cap \{A: A \in \phi\}$ is connected.   I tried to solve this question with a friend, and this is what we came up with:   Obviously, $X$ is normal space (T4). We tried to see what happens if $Y = U_1 \cup U_2$, disjoint and open sets (and?) We tried to use nets and maybe see if we can create a net that converges to $x \neq y$ (and contradict X being Hausdorff space). We tried to work with continuous functions, but this idea didn't lead us anywhere either.   I feel like there is a simple observation that we are missing. Any ideas?  Thanks!


I know that significance tests don't make sense on population data. But how then can I figure out if effect sizes are meaningful? Is it purely a judgement call?  Background: I have a census for an entire population. I want to look at correlations between income and the different things studied in the population, e.g. income vs education level, income vs religion, income vs family size, etc.   I will calculate correlations for all the variables across incomes, and look at the ones with the highest correlations.   However, with enough variables, one would assume that at least some of the correlations would then be due to chance, and who knows, perhaps all of them are due to chance.   Is there any way to account for this, and state whether there is more or less chance than we would expect? Or do I just have to report the results as I find them, and let the reader draw their own conclusions about whether they are purely chance?

Is it even possible to use a statistical test in this case? Specifically, I'm analysing cities in two different regions. The aim is to determine if there is a statistically significant difference between the amount of cities that have UK names in each region.   The data look like this:                   region1    region2 UK_named_cities  553        3255 total_cities     9155       55327   The percentages of cities with UK names:  region 1: 6.07% region 2: 5.88%   The difference is 0.19%.   My first thought was an $χ2$ test, which yielded this result:  Test Statistic (X-squared): 0.2840672425979418 p-value: 0.5940477093071286 Degrees of Freedom: 1   I'm not sure this is right though. I don't have expected and observed counts as such. And a p-value of 0.59 doesn't seem that intuitive when there is a difference (albeit a very small one). I can't see how a t-test or z-test or reporting CI's would apply either.  Fundamentally, I'm confused. Can I only report that there is indeed a difference, but not test it for significance?


Please help me find the value of the following integral: $$\frac{(5050)\int^1_0(1-x^{50})^{100} dx}{\int^1_0(1-x^{50})^{101} dx}$$ I tried solving both numerator and denominator via by-parts but it isn't giving me a conclusive solution. Any other suggestions?


The help center says the following on the review privilege:    But there are no first posts and late answers queues on MSO:

When I visit Stack Overflow, I see the review option in the bar at the top of the screen.    However when on MSO, I don't see it. I assumed this was because I didn't have enough reputation to access the queue. I was curious what the requirement was on meta, so I moseyed on over to the privileges page. To my surprise, I saw that the privilege is listed as only requiring 500 rep and informs me I already have it:    Confused, I manually typed in meta.stackoverflow.com/review to see what would happen. The page did in fact load, but as you can see meta has no "First Posts" or "Late Answers" queue.    Seeing on that page that a minimum of 2k reputation is required to access any queues on MSO, I report the following bug:  1) On the privileges list on MSO, the 500 rep privilege of "Access first posts and late answers review queues" should not appear.  I also have the following feature request:  2) On the privileges list on MSO, it would be useful if instead there was a 2k privilege that informed you that you have access to the "Suggested Edits" and "Low Quality Posts" queues.


Reading "Great Expectations", I noticed that numbers (I don't remember if this refers to all numbers, but I'm sure it was used when age was concerned) were given in the German way, namely, for instance:     one-and-twenty for twentyone   I'm asking why and when did the two languages split in this sense, that is, when did English start to tell numbers in the reversed order with respect to German.  Google N-grams does not shed any light on the topic.

19th century English texts occasionally use Germanic-style number words, such as "four-and-twenty", but the same text would also have the modern "twenty-four" in places (see e.g. Conan-Doyle for several examples).   How did the usage of germanic-style numbers change historically? When did the Germanic forms fall out of use?   (I have asked this question previously on  (German) and got a short , but would appreciate any additional input.)


I am using two screens. The menu (Ubuntu dock) is shown at the left screen. I would like to have it on the right screen:  Changing the right monitor as primary screen does not help. Only the top bar is now shown at the right monitor and on the left monitor is a gap between the menu at the top. Is it not possible to have the menu at the right in 18.04?

I updated to Ubuntu 18.04 a few weeks ago with little to no problems until now. After an update I installed and a reboot, my sidebar (Ubuntu dock) shows on the secondary screen, which is my Laptop, while my HDMI monitor is saved as the primary and has the top bar with time, battery and so on.   How can I get the sidebar back to my primary screen?


In alpha decay, a $\text{He}$ nucleus is emited along with a daughter nuclide. Now suppose $\text{U}$ with atomic number 92 and atomic mass 238 emits an alpha particle and a daughter nuclide is formed with atomic number 90 and atomic mass 234, then my question is:   what happened with the electrons in this process? Some say that this is only a nuclear reaction, so electrons are not concerned. If so, then why do we say that half of the atoms decay at half-life? Should we not say that half of the nucleus decayed?

Where do the electrons go? In alpha decay do 2 electrons follow the alpha particle and make stable Helium or does the larger daughter nucleus become an anion?  Also what do the electrons do in the mixture of fission and alpha decay? With Beryllium-8 it decays into two alpha particles and 4 lonely electrons or do you get two Helium atoms?If someone could add an entry to Holocron it would be greatly appreciated, thanks.


The plus operator is not center aligned. Please help.

How to write the plus/minus signs aligned with the bottom of the fraction. I can write the rest of the part of equation (1.1) and (1.2). but can cot write the plus/minus sign at the bottom.


We know that Dumbledore marched and faced Grindelwald on his own. However why did he not do the same for Voldemort before? What was he waiting for or was he afraid of facing Voldemort?

During the First Wizarding War, why didn't Dumbledore just hunt Voldemort down, as he had done with Grindelwald?  By 'hunting down', I mean finding, defeating and imprisoning him, exactly as in Gridelwald's case, and not, say killing him, something which Dumbledore would not do, as the answers to a previous question (as to him not hunting down Death Eaters) show.  Dumbledore knew that Voldemort had delved into the Dark Arts deeper than anyone else in history and hence "had powers he will never have". But he must have also known well that he could have defeated Voldemort at a direct confrontation, given that he had defeated Grindelwald earlier even against the Elder Wand, and now had that same wand at his disposal. He is seen confident about this throughout the series.  At the Battle of the Department of Mysteries, he did not go beyond outweighing Voldemort and forcing him to flee, probably because, by then, he had reasons to suspect that there was more to Voldemort's survival than his physical body, and thus, destroying that body which had Harry's blood without permanently disposing him off would not have been wise.  But why did he not do that at the First Wizarding War? Is it just that they could not track him down, or did he suspect even then that Voldemort had more sinister things about his soul? is there any canon confirmation of the latter suspicion?


Sometimes I want to avoid oil and oil-related food. How do I remove oil from soup?

I've read that adding cork (from wine bottles) absorbs the fat. I'm not sure if this works or not.    Are there any other ways to remove excess fat without standing there and spooning out or refrigerating and then removing the solidified fat?


Will someone please explain how a basic  works? I have a feeling it has something to do with pressure and the Venturi effect, but I'd really like to know precisely how they work as completely as possible.  If you know, please feel free to use  as a reference in explaining.  EDIT: Please note that I'd specifically like to know how atomizers of the type pictured in the link I provided, the kind with a spring-based finger pump, work. I'm not talking about e-cigarette atomizers or .

This is the critter spray gun.   The liquid in the jar is at atmospheric pressure (there's a vent hole connecting it to the atmosphere). A fast jet of air flowing right over the end of the pickup tube sucks the liquid up the tube and into the air stream. How exactly does this fast stream of air creates suction? It's released in the atmosphere, so shouldn't it also be at atmospheric pressure?


I've only recently started using blender and have been using the difference Boolean quite a bit. Most of the time there are no problems, however when trying to create a hole in a phone model I'm working on the result in smooth shading is a massive dark shape across the object. This does not appear when using flat shading.   Like I said, I'm new to blender so any help would be appreciated! I've looked through forums and videos but have found no answer.  Thanks.

I am trying to slice up my models using the Boolean modifier.  After applying the modifier on my smooth mesh, I get the expected result, a flat dissection to separate my mesh into two.  The problem lies in how I can resolve the visual "jaggered" edge that separates my (smooth) mesh exterior from the flat dissection face.    Is it possible to achieve a smooth-to-flat variation without this artifact?   I tried to alter a mixture of the two but end up with artifacts, or unwanted blocky flat mesh faces around the dissection edge of my mesh.


I have the program below which takes the user input from a string, parses into another format and then prints it again in another format. How can I prevent the user from introducing a wrong format that would cause the date either to be displayed erroneously (ex. year 20222) or to cause a forward roll of the date (ex. introducing day 31 for a 30 day month causes to roll the month and set day to 01 of next month.). ex. 2020-10-33 => 2020-11-3 I hope it makes sense! public class Solution { public static void main(String[] args) throws Exception {     BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));     SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");      String dater = reader.readLine();      Date newDate = dateFormat.parse(dater);     SimpleDateFormat dateFormat2 = new SimpleDateFormat("LLL dd, yyyy");      System.out.println(dateFormat2.format(newDate).toUpperCase());     reader.close(); }  }

I find it curious that the most obvious way to create Date objects in Java has been deprecated and appears to have been "substituted" with a not so obvious to use lenient calendar.  How do you check that a date, given as a combination of day, month, and year, is a valid date?  For instance, 2008-02-31 (as in yyyy-mm-dd) would be an invalid date.


Define: $ \left(f*g\right)\left(x\right)=\frac{1}{2\pi}\intop_{-\pi}^{\pi}f\left(t\right)g\left(x-t\right)dt $ I want to prove that $ f*\left(g*h\right)=\left(f*g\right)*h $ I havent really learned double integrals so I used some information I found online and Im not sure that I've change variables correctly. here's what I've tried: By definition: $ f*\left(g*h\right)\left(x\right)=\frac{1}{2\pi}\intop_{-\pi}^{\pi}f\left(t\right)\left(g*h\right)\left(x-t\right)dt=\frac{1}{2\pi}\intop_{-\pi}^{\pi}f\left(t\right)\left(\frac{1}{2\pi}\intop_{-\pi}^{\pi}g\left(s\right)h\left(x-t-s\right)ds\right)dt $ $ =\frac{1}{2\pi}\cdot\frac{1}{2\pi}\intop_{-\pi}^{\pi}\intop_{-\pi}^{\pi}f\left(t\right)g\left(s\right)h\left(x-t-s\right)dsdt $ Now change variables : $ s=u-v,t=v $ so $ dsdt=\begin{vmatrix}\frac{\partial s}{\partial u} & \frac{\partial s}{\partial v}\\ \frac{\partial t}{\partial u} & \frac{\partial t}{\partial v} \end{vmatrix}dudv$ Thus $ dsdt=\begin{vmatrix}1 & -1\\ 0 & 1 \end{vmatrix}dudv=dudv $ My problem is with the bounderies of the new integral. Is this correct ? : $ f*\left(g*h\right)\left(x\right)=\frac{1}{2\pi}\cdot\frac{1}{2\pi}\intop_{-\pi}^{\pi}\intop_{v-\pi}^{v+\pi}f\left(v\right)g\left(u-v\right)h\left(x-u\right)dudv $ $ =\frac{1}{2\pi}\intop_{v+\pi}^{v-\pi}\left(\frac{1}{2\pi}\intop_{-\pi}^{\pi}f\left(v\right)g\left(u-v\right)dv\right)h\left(x-u\right)du $ Feels a bit of a lie because Im integrating over the variable $ v $ while v still appear outside of the $ dv $ integral (in the bounderies of the outside intergral ) If its not correct I'll be glad if someon can show me how to change the variables correctly (namely what to do with the bounderies) if its true it will solve that problem because $ (f*g) $ is periodic with period $ 2\pi $ according to former assumptions in this discussion, so if I could treat the $ v $ in the integral as a regular constant, that wouldnt bother me since the length of the segment is $ 2\pi $. Thanks in advance.

I intend to prove the associativity of convolution but failed after several trials, i.e. $(f \ast g) \ast h = f \ast (g \ast h)$ where $(f \ast g)(t) = \int^{t}_{0}f(s)g(t-s)ds $  There are a number of proves considering $(f \ast g)(t) = \int^{\infty}_{-\infty}f(s)g(t-s)ds $. Those did not help since I have a different definition.  Would anyone be able to show the proof here?  Thanks.


I usually include .pdf figures (vector graphics) in LaTeX files. The problem is that when I compile everything, the resulting file, which also has .pdf extension, is too large.  The size of the final PDF document is approximately equal to the sum of the size of the PDF document without figures plus the total size of the .pdf figures that are to be included.

I feel that the PDFs produced by pdflatex are too huge. So for example my 50 page book with no illustrations is 500KB. I feel it should be more like 50K or even less. The .tex files together are just 40KB. Anyone knows why the final PDF is so huge and is there a way to compress it to make smaller?


When I view the  in the review queue and click "Edit", it takes me to the top of the page, and does nothing.  However, when I open it up as a regular page, then clicking "Edit" gives the following error:     Another edit is awaiting approval for this post. Further edits cannot be submitted until the pending edit is reviewed.   Even if this edit goes through by the time you view this, this should be a replicatable bug.

While reviewing First Posts on Super User, I noticed that I couldn't edit this question (see below). Clicking the "edit" link simply does nothing. Editing is not possible for me right now because I have already five suggested edits pending. It used to be the case that the link would've been grayed out (and the reason shown as a popover). , and while I'm not sure it's an improvement, the current implementation needs some fixing at least.  This bug appears regardless of the actual reason that the edit isn't possible; for instance,  is another user experiencing the same bug who couldn't suggest an edit because of an already pending one. Apparently, I'm far from the only one who experiences this issue. As of last Sunday morning,  have been posted networkwide (and are still alive) and  is #16.


We consider $G$, a noncommutative group which contains $n$ elements.   Show the probability that $2$ elements of $G$ commute is lower than $\frac{5}{8}$.

Suppose that $G$ is a finite group. If $P( ab=ba ) >5/8$, prove $G$ is abelian.


Using the  built-in browser, I can't hit the flag button on Stack Exchange sites. The edit button next to it works perfectly, but the word 'flag' is behaving as though it's not a link of any sort at all. Nothing of any sort happens when I click on it, not even the highlighting that the browser uses to help you make sure you've hit the right link, which suggests that it's the link, not the resulting popup.

This morning (it's about six AM here) I find that I can no longer submit close votes; the link just jumps to the beginning of the page.  I'm on iOS, using a third-party browser called Grazing, but a brief check with Mobile Safari shows the same problem there.   Here on Meta, where my score is much lower, I only get a "delete" link on my own question, and that works fine. (Oops :-))   Update: As per comments, this affects the "flag" link, too, which doesn't even scroll to the top of the page. Update 2: Latest comment suggests this affects Android, too. Update 3: This also affects desktop computers when viewing mobile (when you click "mobile" in the footer) Update 4:  mentions Windows 8, too; simply deleting platform-specific tags


Somehow My visual studio code froze  when  It was idle for some time and I was using my Injellij application.  When I found, I tried quitting the application by doing right +click on visual studio code icon and quit- nothing happened. Then I tried force quit -still nothing happened. opened activity monitor-saw electron(not responding)- tried quit and force quit- still nothing. then tried everything from this post  - still nothing.  Also in taskbar, the vscode icon is not present but if I try to relaunch, I get an error message saying  "Another instance of Code is running but not responding Please close all other instances and try again." I am not sure what actually happened but if someone can help me to trace this and fix without restarting my system . I would also be happy if someone can help me find error logs for vscode or macos to investigate what actually happened. below are app and system information. visual studio code package name: VSCode-darwin-universal.zip version : 1.57.1 system mac Os catalina version 10.15.7

I have a small shell script called "k" that i call everytime when i want to reset my complete Development Cycle:  killall node killall Xcode killall Terminal   How can i find out the final name of the "Visual Studio Code"-Prozess to kill it also this way?  I've tried:  killall "Visual Studio Code"      No matching processes belonging to you were found   killall "Code"      No matching processes belonging to you were found   Any ideas? I am looking for a generic approach without any manually lookup of PIDs necessary.  This application looks like this in Activity Monitor:


If every black adult male in the U.S. bought & registered a   semi-automatic rifle tomorrow, Congress would Pass gun control laws by   Friday.         Should not the "bought & registered" should be in their base form (buy & register)? If not then what type of sentence it is? Passive Sentence? If yes then what would be the active form of this sentence?

We use simple past to state a hypothetical present situation that we would like to speculate about (If they were here, I would be happy), past perfect for a hypothetical past (had they been here, I would have been happy), and simple present to a hypothetical future. Any explanation why this makes sense, as opposed to past for past, present for present, and future for future?


For weather forecasts on TV, many claims are made about the probability of single events like there is a “40% chance of thunderstorms tomorrow.” Can claims like this make sense given the definition of probability as a ratio of favorable outcomes to possible outcomes? Is there another way of thinking about probability that help these claims make more sense?

If I have an "experiment", the results of which can be classified clearly into "outcomes" (like rolling a die), then I can make a concrete and verifiable empirical claim that "if you repeat this experiment many times, the frequency of this outcome will tend towards this number". This is what I mean when I say that the probability of something is such and such a number.  But then what is the meaning of the phrase "there is a 25% chance of rain tomorrow"? If I repeat the experiment of it being tomorrow many many times... what? It just doesn't make any sense, the definition of probability given above just doesn't apply.  To take an even more concrete example, let's say someone presents you a box containing one million black balls and one white. You get to take out one ball (and only one). If it's white, they give you a thousand dollars. Otherwise, you give them a thousand dollars. They're very stubborn and won't let you refuse to play unless you can give a satisfying philosophical explanation as to why you don't want to. What could you say?  Is there a name for this "paradox"? Is there a solution to it?


I bought an iPhone 6 from someone and the phone is still logged into his iCloud and find my iPhone is still on.    I need to reset the phone.  If I restore the phone using the home button and then connect it through my iTunes will it ask me for the the iCloud password of the previous owner?

I bought a used iPhone 4.  The previous owner re-set the phone, but did not remove the device from their iCloud.  It is asking me for their iCloud information when I try to set-up the phone.  I don't have contact with the previous owner anymore.  Is there a way to remove the device from their iCloud so I can use a new one?


As a non native English speaker I've always found the following form strange:  Said Hamlet, "To be, or not to be".   I would more naturally say:  "To be, or not to be", said Hamlet.   Is there a stylistic difference between the two?

I recently read the following in a schoolbook:     Wrote the researchers, "[...]"   I wonder if this is correct English. I have seen it a couple of more times. Is this just a matter of preference? English doesn't really have a very liberal word order, unless you're writing poetry or the like.  Can anyone tell me what this is called? I found some information on subject-verb inversion, but it only seems to be when the object is in front, but in this case, the word order is verb-subject-object.


Can Superman still x-ray behind stuff with his eyes closed?

Given that his x-ray vision allows him to see though skin, can he use this ability with his eyes closed? Or do they prevent it somehow?


I have a filter by text search in my wpf application. However when I do a string comparison to check if it contains a buzzword like, oh say "error", I want it to update/refresh my datagrid with all entries that have the Error keyword; regardless if I typed Error, or error, or eRRor in my search box.  Here is my code:  public class Foo  {   private void GetFilteredResults(MessageDetails detail, FilterEventArgs e)   {     foreach (MessageValue value in detail.MessageValue)     {        if (value.Value.Contains(txtFilterValue.Text))        {            //Returns true...        }     }     //Otherwise false   } }   The Messagedetails is a container class and holds all of the datagrid row values.   The MessageValue is a struct that holds the actual message value in an ObservableCollection   Finally, the txtFilterValue is the control name of the textbox I am using to for my word filter  What I want to do is setup something to where I remove case sensitivity in order to cache all entries that match my keyword, regardless of how I type it. How would I go about that?

Is there a way to make the following return true?  string title = "ASTRINGTOTEST"; title.Contains("string");   There doesn't seem to be an overload that allows me to set the case sensitivity.. Currently I UPPERCASE them both, but that's just silly (by which I am referring to the  issues that come with up- and down casing).  UPDATE This question is ancient and since then I have realized I asked for a simple answer for a really vast and difficult topic if you care to investigate it fully. For most cases, in mono-lingual, English code bases  answer will suffice. I'm suspecting because most people coming here fall in this category this is the most popular answer.  answer however brings up the inherent problem that we can't compare text case insensitive until we know both texts are the same culture and we know  what that culture is. This is maybe a less popular answer, but I think it is more correct and that's why I marked it as such.


I'd want to extrude the face go this mesh but i can't understand how to eliminate the edges inside it

So, I'm working on a control station that has buttons. It is a one-mesh creation, that means, I don't want to create buttons and things like that separated from the main mesh, but as you can see, I have problems. I would like to make the highlighted parts to be one with the main part around them. I've tried everything, and I have this problem on multiple creations. Any idea?  Update: I've added another example of the problem. I want them to be one face, instead of two. (2nd picture)


I just recently found out that password_verify($string, $hash) only works for 5.5 and above.  I am therefore looking for the correct way to do it in 5.4?

It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection.  This question,   suggests that hashing multiple times may be a good idea, whereas  suggests using salt.  I'm using PHP. I want a safe and fast password encryption system. Hashing a password a million times may be safer, but also slower. How to achieve a good balance between speed and safety? Also, I'd prefer the result to have a constant number of characters.   The hashing mechanism must be available in PHP It must be safe It can use salt (in this case, are all salts equally good? Is there any way to generate good salts?)   Also, should I store two fields in the database (one using MD5 and another one using SHA, for example)? Would it make it safer or unsafer?  In case I wasn't clear enough, I want to know which hashing function(s) to use and how to pick a good salt in order to have a safe and fast password protection mechanism.  Related questions that don't quite cover my question:


Im suppose to create a loop that takes in a string input number and turn it to a integer variable so i could add 1 to the number and then turn it back to a string and print it out 5 times with 1 added to the number per print.The problem is, it only works up to 9 digits. if you put more then 9 then it starts giving other different numbers like -125346543.   if you put 9 digits 101010101. it will print it out 101010101 -> 101010106, but if you put 10 digits like 1010101010. it will print out -128764798 -> 128764804. I need it to print a least up to 13 digits  #include <iostream> #include <string> #include <sstream>  int main() {     int l=0;     int x=0;     string nope;     cout<<"please provide 13 digit code : ";     cin>>nope;                                // ask for 13 digit code for(i=0; i < 5 ; i++) {     stringstream geek(nope);                 // turn string to Int     geek>>x;     l = x + 1;                               // add 1 to Int     stringstream ss;                         // turn it back to string     ss << l;     string q = ss.str();     nope = q;     cout<<nope;                              // prints out }

I can never remember the number. I need a memory rule.


I'm going to try to keep this simple.   I have a function that calls a modal pop up via ajax, it loads in all the images saved to a database. This modal displays the images, and gives you the option to click another button to "insert" an image into a form. (It puts the image on the main page, and inserts the image id into a hidden input field.)  I had this working with an 'onclick="functionName()"' option, but since I'm still learning js and jQuery, I found this way was older. So I've been working on updating my code.  Here is what I've got, and I've done a few hours of research, and from what I can guess, since the ajax loads these new function calls, the DOM isn't recognizing them as a "call" to the JS function?  If anyone can help or point me in the right direction, I'd greatly appreciate it.  //Ajax Modal Button: <img/> <button type="button" class="insertPageImages">Insert Image</button>  //JS Function $(function(){      $('button.browsePageImages').on('click', (function(e){           //Loads Ajax Modal For insertPageImages Button      }));       $('button.insertPageImages').on('click', (function(e){         e.preventDefault();         alert("TEST WORKING");     })); });

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.


In high school I was taught that it is not proper grammar to end a sentence with a preposition. My instructor was very strict about grammar on every paper we wrote. He always said to not end a sentence with a preposition and showed the ways to not do this. Is this different now with modern English as opposed to the English I was taught in high school?

Like many others, I commonly find myself ending a sentence with a preposition.  Yes, it makes me cringe.  I usually rewrite the sentence, but sometimes (in emails) I just live with it.  To, with... you know who you are.  Should I keep fighting myself on this one, or is it okay in some circumstances?


For example, I have a human head model, which is cut in half, because i want to mirror it. But the problem here is that some faces are over the Y axis and some do not touch the axis. When I then try to mirror this shows up, where let's say some points don't touch and other ones, where faces are over the axis just collide. Is there a possibility to align the "edge" faces to a certain axis, so the mirroring becomes perfect?

When I add a mirror modifier it sometimes doesn't mirror correctly, giving me an overlapping mesh. How can I fix this?


I read about the Tenacious & Unsung Hero badges. I have 36 total answers, out of which 16 are accepted. Among these, 7 are with 0 votes.  As per the definition, I am eligible for the Tenacious badge, but I haven't been awarded it yet.  What are the hidden criteria?

Just curious whether the process takes a while, and whether it scrapes through history to determine if it was once valid or not. Currently, I have 6 0-vote accepted answers and 20 1+-vote answers (), and that makes it > 5 and > 20% but not for long if voting goes up or down from here. ;-P  Update:  Special thanks to Grace Note for pointing out the  to follow. I upgraded this to a bug because it's been 48 hours during which the criteria supposedly were met. 6 0-votes, 20-23 1+ votes during the whole period. The criteria only last so long, so it may go out of scope soon. If it only checks every 3 days, I'm not sure if that's intentional or a bug.


I have a problem when I want to calculate the following:  Let's say that I have an online class for only 5 students. The class costs **6000 NOK per student.** I want to withdraw money every 5 seconds. If we calculate the cost for 5 seconds, we need to calculate the cost for one second which would be:  6000 NOK/3600 = 1.666666666666667 and let's approximate the result to 1.67 NOK per second.   So every 5 seconds I have to withdraw:  5x1.67 = 8.35 NOK  Let's say that the class lasted for 1 hour. That means 3600/5 = 720 times I have to charge the students. I end up charging every student with this amount  720x8.35 = 6012 NOK  So my question is that there is a difference between the initial cost of the class which is 6000 NOK, but in the end, I charged 6012 NOK from each student. How do I solve this issue when I write this in code?   Thanks in advance.

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


Want to use PC broadband connection on the phone connected via USB [no Bluetooth or wifi] to surf on the phone or install app. The android device is running 4.0.4 and the PC running Windows 7 I dont want to root the phone. I've the phone driver installed.

My HTC G2 phone is rooted and running Cyanogenmod 7 I don't have a data plan. Sometimes I want to connect the phone to the Internet when there isn't Wi-Fi, to update Market apps, backup SMS messages to Gmail, sync new contacts from Gmail, etc.  Things I can't do with USB mass storage mode. I have a Windows 7 Professional computer connected to the Internet, but I'm not allowed to set up an ad-hoc Wi-Fi network.  (If I do, they will notice and hunt me down.)   Is there a way for the phone to access the Internet through the USB connection to the computer?  If so, how do I set it up?


public class Test {     public static void main(String args[])     {         String a="meow";         String b=a+"deal";         String c="meowdeal";         System.out.println(b==c);     } }   According to me == operators compares refrences . So b==c should print "true" But it prints "false" . I checked by printing hashcode of "b"and "c" .   Hashcode of both are same

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I have learned the position of 'not when I use to-infinitive is before the to-infinitive like:     I didn't go home not to meet my cousin.   but, sometimes I have seen 'not' is behind the to-infinitive like.     While patience is one of the most important parts of finishing a task, we sometimes cannot bring ourselves to not just expect quick results.   I am wondering if the expression,'to not just expect~', is right or wrong.  Please help me.

This is one thing that keeps bugging me, and maybe there's a direct answer. Grammatically, which one is more correct of these two?  Does it make a difference?  I tried not to do that. I tried to not do that.


My shortcuts often get broken because I move stuff around and unfortunately, the Windows link tracker can't keep up. Is there a way to programmatically (with Powershell) read and edit the properties of the shortcut? I would like to run a script that searches the whole hard drive (or wherever I specify) for a file that matches the target name and then update the shortcut with that new location assuming it is the right file.

I've found a nasty VBS way to do this, but I'm looking for a native PoSh procedure to edit the properties of a .LNK file.  The goal is to reach out to remote machines, duplicate an existing shortcut with most of the correct properties, and edit a couple of them.  If it would just be easier to write a new shortcut file, that would work too.


I am trying to do something a bit unexpected. I want to parse a Python code in which some specific comment lines define a block of text or of code that I would like to extract. For this example, I will be using two types of tags, one for code, one for text description. #c print ("this is the tag I used for code I want to find") #-c  #d """This is the tag I used for a description I want to find""" #-d  Why am I tagging my code this way? Well, that's for another question. More details in  if you are interested. Now, I have been trying to catch those tags with regular expression, and as it's my first time using regex, I obviously didn't succeed... Here is my current attempt: file = 'script.py' with open(file, 'r') as f:     text = f.read()  text = read_python_script(file)  code_blocks = re.compile(r'(?s)(?<=#c\n)(.*\n)(?=#-c)') desc_blocks = re.compile(r'(?s)(?<=#d\n)(.*\n)(?=#-d)')  code = re.findall(code_blocks, text) desc = re.findall(desc_blocks, text)  Here is an example of a script I would like to parse: # -*- coding: utf-8 -*- """ Title: blablabla Author: Mathieu  Description: Report the some measurements """  import time import uuid  from database.model import TestLimit, TestResult from util import log  #d """ blablabla some description which might be multiline """ #-d # Constants #c CONSTANT_1 = 10     # Unit CONSTANT_2 = 2      # Unit #-c  class Foo(Fp):     def __init__(self, #some parameters):         # some init      def _run(self, #some parameters):         #%% Section Title 1         #%%% Sub section Title 1         #c         code I would like to catch         can be multiple liens         #-c                   with something.open():             #%%% Sub section title 2             #d             """some description I want to catch"""             #-d                          #c             some more code I want to catch             #-c  At the moment, I am getting only the first occurrence and I don't know why... EDIT: As mentioned, I should change my expression to a lazy format: r'(?s)(?<=#c\n)(.*?)(?=\n#-c)'  This doesn't completely solve the problem as I am still only catching the first occurence.

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 am using Codeignitor for programming and coming from c#. its look like a newbie question ,but i want to do something like this.  I have some functions that which return some values :   Example :  function Create_db() {  //do something        if (PassWordError) //some errors here it is password incorrect        {          return "PASS_ERROR";        }  }   and in some places i am using like this  $result = Create_db(); //assume that there are some problems and returned "PASS_ERROR"   so that the $result is string now,  is there anything like ENUMS in php ? or something like that ?  so that i can do something like this :  if (passWordError) {   return $error->PasswordError(); }   i assume that i can have some others types too  like  Maximum_name_error,authenticationFailedError etc  Thank you.

I know that PHP doesn't yet have native Enumerations. But I have become accustomed to them from the Java world. I would love to use enums as a way to give predefined values which IDEs' auto-completion features could understand. Constants do the trick, but there's the namespace collision problem and (or actually because) they're global. Arrays don't have the namespace problem, but they're too vague, they can be overwritten at runtime and IDEs rarely know how to autofill their keys without additional static analysis annotations or attributes. Are there any solutions/workarounds you commonly use? Does anyone recall whether the PHP guys have had any thoughts or decisions around enumerations?


Problem I can't install libpq-dev in ubuntu 20.04.2 I ran this command: $ sudo apt-get update  $ sudo apt-get install libpq-dev  then I got errors bellow. Reading package lists... Done Building dependency tree        Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:  The following packages have unmet dependencies:  libpq-dev: Depends: libpq5 (= 12.7-0ubuntu0.20.04.1) but 13.3-1.pgdg20.04 + 1 is to be installed E: Unable to correct problems, you have held broken packages.  Then I try to install the library directly with this command: $  sudo apt-get install libpq5=12.7-0ubuntu0.20.04.2  I got this error: Reading package list ... Done Creating dependency tree Reading status information ... Done E: The version «12.7-0ubuntu0.20.04.2» was not found for «libpq5»  Status Ubuntu version $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 20.04.2 LTS Release:    20.04 Codename:   focal  Kernel version $ uname -a Linux IdeaPad-S340-15API 5.8.0-55-generic #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux  Updated $ apt-cache policy libpq-dev libpq5 libpq-dev:   Installed: (none)   Candidate: 12.7-0ubuntu0.20.04.1   Version table:      12.7-0ubuntu0.20.04.1 500         500 http://security.ubuntu.com/ubuntu focal-security / main amd64 Packages         500 http://archive.ubuntu.com/ubuntu focal-updates / main amd64 Packages      12.2-4 500         500 http://archive.ubuntu.com/ubuntu focal / main amd64 Packages libpq5:   Installed: 13.3-1.pgdg20.04 + 1   Candidate: 13.3-1.pgdg20.04 + 1   Version table:  *** 13.3-1.pgdg20.04 + 1 500         500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 / main amd64 Packages         100 / var / lib / dpkg / status      13.2-1.pgdg20.04 + 1 500         500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 / main amd64 Packages      13.1-1.pgdg20.04 + 1 500         500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 / main amd64 Packages      13.0-1.pgdg20.04 + 1 500         500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 / main amd64 Packages      12.7-0ubuntu0.20.04.1 500         500 http://security.ubuntu.com/ubuntu focal-security / main amd64 Packages         500 http://archive.ubuntu.com/ubuntu focal-updates / main amd64 Packages      12.4-1.pgdg20.04 + 1 500         500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 / main amd64 Packages      12.3-1.pgdg20.04 + 1 500         500 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 / main amd64 Packages      12.2-4 500         500 http://archive.ubuntu.com/ubuntu focal / main amd64 Packages

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 am trying to set up a hero section where the div takes up 100vh minus the height of the header. I originally set the css height property to calc(100vh - 310px). 310px is the height of the header on my monitor. However I am trying to find a responsive solution, where the height of the header is dynamic and can change based on screen size. Not sure how to go about doing this. I assume it is not possible using css and am fine using javascript/jquery to solve this.

  .heroSection {    height: calc(100vh - 310px) }

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; */ }

...

...

     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.


In my database there is a table without geometry. how to read that from from pyqgis. self.uri = QgsDataSourceUri() self.uri.setConnection(self.Hostname, self.Portid, self.Dbname, self.Username, self.Password) db = QSqlDatabase.addDatabase("QPSQL") db.setHostName(self.uri.host()) db.setDatabaseName(self.uri.database()) db.setPort(int(self.uri.port())) db.setUserName(self.uri.username()) db.setPassword(self.uri.password()) self.dbresult = db.open() self.uri.setDataSource(self.Schema, "project_ids", "geom", "") lay = QgsVectorLayer(self.uri.uri(True), "project_ids", "postgres")  print("Layer fields Names",lay.fields().names())   is shows not showing any fields How to read the No geometry Tables in pyqgis?

I had to backup a PostGIS model in a geopackage and I wonder how to load a non-spatial table, aka a table with NO geometry_column.


There have been many questions that ask if a user is allowed to cross-post a question on multiple sites, and the general conclusion is that they are not allowed to do so. However, sometimes there are questions which are asked on multiple sites by different users not knowing another SE site had an answer already, where it is on topic on both sites, that have some overlap. What is the policy for such questions? Should they be closed on one site, migrated, or is each site independent enough to allow the question to remain on both sites?

What's the right course of action for cross-site duplicates?  There are two flavors:   A question is posted which belongs on another site and ends up already having been asked there. I can't find an example right now, but it's bound to happen soon if it hasn't already. The same question is posted in two places at the same time. Take  for example, which is a duplicate of , posted within a half hour of each other by the same user.   Possible actions:   Move it to the proper site and close it once it gets there as a duplicate. Provide a way to close it right away as a cross-site duplicate, without moving it first. Flag it and let a moderator merge them. Close it as "no longer relevant" or something else.   Additionally, flavor 2 is a bit of a special case; perhaps the question really spans both sites in terms of content and intended audience. Should multiple-postings in this case be allowed? If so, should they somehow be linked to each other? If not, how do we avoid a migration war?


I was reading  and trying out all of the commands in the first answer... I don't really have anything else better to do right now.  Anyways, I ran through them all in regards to rm. What piqued my interest is this:  root@headdesk:~# type ls ls is /bin/ls root@headdesk:~# hash ls root@headdesk:~# type ls ls is hashed (/bin/ls) root@headdesk:~#   Running help/man hash is not very helpful, and help type isn't really either (it does not mention hash anywhere). Since I can't seem to find a relation in the man/info/help pages unless I am missing something, could someone please explain what hashing is doing in regards to the type command?

I'm going through  and came across this:  $ type rm rm is hashed (/bin/rm) $ type cd cd is a shell builtin   Just a little earlier, the guide listed the various types of commands understood by Bash: aliases, functions, builtins, keywords and executables. But there wasn't mention of "hashed". So, in this context, what does "hashed" mean?