I noticed that i return duplicate rows in my listview constructed from my arrayList. I would like to check if the elements exist in the arraylist and if so, ignore that set. The unique value to check would be my id, denoted by KEY_SID.  Here's my code:     public ArrayList&lt;SaleModel&gt; loadSalesFromSQLite() {         ArrayList&lt;SaleModel&gt; sales = new ArrayList&lt;&gt;();         hp = new HashMap();         SQLiteDatabase db = this.getReadableDatabase();         Cursor res = db.rawQuery("SELECT  * FROM " + TABLE_SALES + " ORDER BY datetime(created_at) DESC", null);         res.moveToFirst();         while (!res.isAfterLast()) {             SaleModel l_sales = new SaleModel();              l_sales.setId(res.getString(res                     .getColumnIndex(KEY_SID)));             l_sales.setCode(res.getString(res                     .getColumnIndex(KEY_CODE)));             l_sales.setAttendant_id(res.getString(res                     .getColumnIndex(KEY_ATTENDANT_ID)));             l_sales.setAttendant_name(res.getString(res                     .getColumnIndex(KEY_ATTENDANT_NAME)));             l_sales.setProduct_id(res.getString(res                     .getColumnIndex(KEY_PRODUCT_ID)));             l_sales.setPrice(res.getString(res                     .getColumnIndex(KEY_PRICE)));             l_sales.setCustomer_id(res.getString(res                     .getColumnIndex(KEY_CUSTOMER_ID)));             l_sales.setCustomer_first_name(res.getString(res                     .getColumnIndex(KEY_CUSTOMER_FIRST_NAME)));             l_sales.setCustomer_last_name(res.getString(res                     .getColumnIndex(KEY_CUSTOMER_LAST_NAME)));             l_sales.setCustomer_image(res.getString(res                     .getColumnIndex(KEY_CUSTOMER_IMAGE)));             l_sales.setUid(res.getString(res                     .getColumnIndex(KEY_UID)));             l_sales.setQuantity(res.getString(res                     .getColumnIndex(KEY_QUANTITY)));             l_sales.setP_name(res.getString(res                     .getColumnIndex(KEY_PRODUCT_NAME)));             l_sales.setP_image(res.getString(res                     .getColumnIndex(KEY_PRODUCT_IMAGE)));             l_sales.setCreated_at(res.getString(res                     .getColumnIndex(KEY_PRODUCT_CREATED)));             l_sales.setSvg(res.getString(res                     .getColumnIndex(KEY_SVG)));             l_sales.setOfflineTag(res.getString(res                     .getColumnIndex(KEY_OFFLINETAG)));              sales.add(l_sales);             res.moveToNext();         }         Log.d(TAG, "Fetching sales from Sqlite: ");         res.close();         return sales;     }     Before i return sales arrayList, i would like to check for duplicates there, remove them, the return the arrayList without duplicates. Any suggestions?
I have an ArrayList&lt;String&gt;, and I want to remove repeated strings from it. How can I do this?
I need an appearing effect for text like the one (in javascript) here .  However I don't know how to insert js code into LaTeX (apart from using the AcroTeX Bundle) and that would also force me to use Acrobat Reader, so I'd like to implement a similar effect in Beamer. Is it possible?  (of course I would love to see alternative approaches to this) Select Permissions Across Multiple Schemas Within the Same Database I have been asked by a client to implement some views for reporting purposes, the views will be accessed via PowerBI, Excel and SSRS. The designated user will only have access to the view and no underlying tables must be available to the user.  The problem I have encountered in that the SQL within the view touches 3 different schemas (All within the same database):   Pupil Provider  Security   The view is:  CREATE VIEW dbo.vTestPermissions AS SELECT a.Column1,        b.Column1,        c.Column1 FROM Pupil.Table1 a JOIN Provider.Table2 b ON a.Column1 = b.Column1 JOIN Security.Table3 c ON a.Column1 = c.Column1   The owners of the Tables/View are as follows:   Pupil.Table1 - Owner Pupil Provider.Table2 - Owner Provider Security.Table3 - Owner Security vTestPermissions - Owner dbo   When I select from the view I get an error:     The SELECT permission was denied on the object 'table3', database   'TEST', schema 'Security'   I have tried giving SELECT permission with and without the GRANT option to the schema, and the tables, but that makes the underlying tables available to the user.  Any help on this will be greatly appreciated. I need help with STATS homework about normal distribution The distribution of sale price for new MacBook Air’s is approximately normally distributed with a mean of \$800 and a standard deviation of \$70. (a) Mr. Bob plans to spend between $700 \text{ and } $850 on a new Apple MacBook Air. What proportion of the available MacBook Airs can Mr. Bob afford? (b) What is the 90th percentile of computers of this type? (c) Show that a MacBook Air priced at \$1000 would be considered an outlier using the 1.5 × IQR rule. For a, I tried doing 850-700=50 and $\frac{50}{800} = \frac{1}{40}$, for b, I tried $m+(0.5 \times R)/y$ for c, I tried $1.5 \times 700 - 1.5 \times 850$ How can I have `date` output the time from a different timezone? I have a server running with the timezone set to UTC. It seemed like that was generally a good practice (please correct me if I'm wrong).  Anyhow, one of the servers I connect to, in order to scp files, is running on EDT and stores files that I need to copy in the format /path/to/filename/data20120913  I looked at trying to rsync files using something like find's -mtime -1 flag for files modified in the last day, but I didn't have any luck.  I don't mind just using scp to copy the current day's file, but as of right now there is a 4-hour window where running date +%Y%m%d will give a different day on each server and that bugs me a little.  Looking through man date I see that I can have the time output as UTC, but I don't see a way to have it output as another timezone like EDT  I suppose I could also use something like the GNU date extension date -d 20100909 +%s to get the date in seconds from the epoch, apply a manual 4 * 60 * 60 second calculation, and see about rendering that as a date - but then when daylight time kicks in it will still be an hour off.  Is there a simpler way to output the date in a YYYYMMDD format for EDT on a server that is set to UTC ? Why on average does each bootstrap sample contain roughly two thirds of observations? macOS: Is there a way to show an image constantly on screen (like a watermark)? I'm looking for a very simple way to add a watermark to my screen which should be shown whatever I'm doing, is it during a Zoom call, or is it when giving a presentation, or similar (I don't necessarily need it to show during fullscreen mode). The reason is that I want to record my screen using QuickTime Player, and the watermark should be on the video. I know that there are many post-production tools that offer adding watermarks, but I don't want to do any post-production, I want to have everything on screen while recording already. (I also know that there are screen recorders which offer placing a watermark to the end result. I'd rather also avoid using another screen recording software, but if I don't find any other way to do it, then I'm open to a simple, non-pricy alternative to QuickTime Player.) no wifi in Ubuntu 15.04 I cannot see WiFi option in my Ubuntu 15.04. What should I do? Revert asap  lspci -nnk | grep 0280 -A2 output:-  03:00.0 Network controller [0280]: Qualcomm Atheros Device [168c:0042] (rev 30) Subsystem: Foxconn International, Inc. Device [105b:e09a]   rfkill list output:-  0: hci0: Bluetooth Soft blocked: no Hard blocked: no 1: acer-wireless: Wireless LAN Soft blocked: no Hard blocked: no      dmesg | grep ath [    9.545199] ath10k_pci 0000:03:00.0: pci irq msi-x interrupts 8 irq_mode 0 reset_mode 0 [   10.029684] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/cal-pci-0000:03:00.0.bin failed with error -2 [   10.029701] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-5.bin failed with error -2 [   10.029704] ath10k_pci 0000:03:00.0: could not fetch firmware file 'ath10k/QCA9377/hw1.0/firmware-5.bin': -2 [   10.029711] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-4.bin failed with error -2 [   10.029713] ath10k_pci 0000:03:00.0: could not fetch firmware file 'ath10k/QCA9377/hw1.0/firmware-4.bin': -2 [   10.029719] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-3.bin failed with error -2 [   10.029721] ath10k_pci 0000:03:00.0: could not fetch firmware file 'ath10k/QCA9377/hw1.0/firmware-3.bin': -2 [   10.029726] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware-2.bin failed with error -2 [   10.029728] ath10k_pci 0000:03:00.0: could not fetch firmware file 'ath10k/QCA9377/hw1.0/firmware-2.bin': -2 [   10.029733] ath10k_pci 0000:03:00.0: Direct firmware load for ath10k/QCA9377/hw1.0/firmware.bin failed with error -2 [   10.029735] ath10k_pci 0000:03:00.0: could not fetch firmware (-2) [   10.029737] ath10k_pci 0000:03:00.0: could not fetch firmware files (-2) [   10.029739] ath10k_pci 0000:03:00.0: could not probe fw (-2) Is there anyway to remove denied permissions from a group for a folder if I dont have access? Hello can someone give me short tutorial how to:   Remove Windows 7 from my dual boot system (Ubuntu/Windows7) Let me use free space as new partition for data (so I don't need to extend Ubuntu itself here) Remove windows 7 option from boot screen   Update:  Thanks to Lekensteyn answer I successfully deleted windows. Now I created new partition (formatted to ext4), but I can not use it. I cannot copy files there, only as root.  Also when booting, Ubuntu complains it didn't find /windows partition (of course it didn't, I removed it). I feel like I should update some tables or what, any ideas? Let $a_n=\cos(a_{n-1}), L=[a_1,a_2,...,a_n,...].$ Is there an $a_0$ such that $L$ is dense in$[-1,1]?$ Why is there no analog for $\Theta_\text{QCD}$ for the weak interaction? Is this topological term generated? If not, why not? Is this related to the fact that $SU(2)_L$ is broken? Linear functional on a Banach space is discontinuous then its nullspace is dense. What motivates people to answer questions in Stack Overflow? I want that too - motivation to answer programming-related questions. What is yours? Graphics horribly corrupted on Ubuntu 16.04 in VirtualBox, showing random strips of pixelated colors Do virtual particles actually physically exist? JMeter : How to record HTTPS traffic? Setuid bit seems to have no effect on bash Solving quadratic equations in modular arithmetic Is there a general way to solve quadratic equations modulo n? I know how to use Legendre and Jacobi symbols to tell me if there's a solution, but I don't know how to get a solution without resorting to guesswork. Some examples of my problems:  $x^2 = 8$ mod 2009 $x^2 + 3x + 1 = 0$ mod 13  Thanks Sketch complex curve $z(t) = e^{-1t+it}$, $0 \le t \le b$ for some $b>0$ What is the difference between \big[ (or equivalently \big() and \bigl[? Is it always necessary to mention l (left) and r (right)?