qid
int64
1
74.7M
question
stringlengths
0
70k
date
stringlengths
10
10
metadata
list
response
stringlengths
0
115k
10,578,960
I am using ckeditor in order to edit the text seen in the screen. The information is taken from database and written to the screen in a div element and it is possible to edit the information by double clicking. However, after edited i couldn't get the edited information. Here is my code, i tried to add a form which inc...
2012/05/14
[ "https://Stackoverflow.com/questions/10578960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1343936/" ]
For save form's data you need store information in input/select/textarea. Div and other not form's element not will be stored. You have to store your data in hidden fields: ``` <form method="post"> <p> Double-click any of the following <code>&lt;div&gt;</code> elements to transform them into edit...
13,880,230
I have multiple ~50MB Access 2000-2003 databases (MDB files) that only contain tables with data. The *data-databases* are located on a server in my enterprise that can take ~1-2 second to respond (and about 10 seconds to actually open the 50 MDB file manually while browsing in the file explorer). I have other databases...
2012/12/14
[ "https://Stackoverflow.com/questions/13880230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1689179/" ]
Something like this? ``` var points = File.ReadLines("c:\filepath") .Skip(1) //Ignore the 1st line .Select(line => line.Split(' ')) //Chop the string into x & y .Select(split => new Point(double.Parse(split[0]), double.Parse(split[1])); //create a point from the array ```
73,439,041
Cheers, I have the bellow React code, where i need to send an HTTP Request to check if my actual user have permission or not to access my page. For that, im using useEffect hook to check his permission every page entry. But my actual code does not wait for `authorize()` conclusion. Leading for `/Unauthorized` page ev...
2022/08/21
[ "https://Stackoverflow.com/questions/73439041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11573910/" ]
replace your container with this code: ``` Container( alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), color: (hisseResult?.result[index].rate ?? 0) > 0 ? Colors.green : Colors.red), width: 75...
24,546,513
I had to write a csv sorting code for which I used the following code : ``` foreach(@files){ if(/\.csv$/i) { # if the filename has .csv at the end push(@csvfiles,$_); } } foreach(@csvfiles) { $csvfile=$_; open(hanr, "D:\\stock\\".$csvfile)or die"error $!\n"; # read handler open(hanw , ">D:...
2014/07/03
[ "https://Stackoverflow.com/questions/24546513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3249348/" ]
You have `my $row;` which leaves `$row` undefined, and pushing into `@$row` (or `@{$row}`) automatically creates new array due [`autovivification`](http://en.wikipedia.org/wiki/Autovivification) perl feature. In case of ``` sort { $a->[0] cmp $b->[0] || $a->[1] cmp $b->[1] } @$sheet2 ``` `@$sheet2` is array of...
5,969
I am re-asking this question for Photoshop Elements 10 : [How can I resize an image without anti-aliasing?](https://graphicdesign.stackexchange.com/questions/5519/how-can-i-resize-an-image-without-anti-aliasing) I want the same result as the user got here- the ability to change a layer's angle and scale without having...
2012/02/14
[ "https://graphicdesign.stackexchange.com/questions/5969", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/3722/" ]
I guess you could copy the part of the image you want to resize into a new image; resize that image using "Nearest Neighbor" interpolation; then copy it back into your original image. But that doesn't help if you need to rotate. This might just be one of the features that Elements leaves out...
17,040,671
Goal: If finding the word "Total" in a cell, the current row with word "Total" as a start point (with letter D in the column) and all the way to the letter H shall have a light grey background color. If not having "Total", the background shall be default. Problem: How should I do it by using VBA? ![enter image...
2013/06/11
[ "https://Stackoverflow.com/questions/17040671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/484390/" ]
You could try it with conditional formatting. Just select the cell and go to "Format" -> "Conditional formatting" (well that's the path in Excel 2003, don't know 2007 or later) But you can do it with a macro if you want to. Here is an example how to do it: ``` Sub RowsToGrey() Dim r As Long, i As Long r = Cells(Rows....
200,123
Is there any framework or method that will allow to use browser to run a 2D game made in python with pygame graphical library?
2022/03/31
[ "https://gamedev.stackexchange.com/questions/200123", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/145066/" ]
Since mid-2022, pygame has partial support for WebAssembly as upcoming python3.11 and allows for running the same pygame code on desktops and mobile/web. You can publish your game on itch.io or github pages as some people have already done. use pygbag from <https://pypi.org/project/pygbag> , some documentation is ava...
4,307,222
I am working on the Glen Bredon's ``topology and geometry''. In its proposition 6.10, the degree of a mapping $(x\_0, \dots, x\_n) \mapsto (-x\_0, \dots, x\_n)$ from $\mathbb{S}^n \to \mathbb{S}^n$ is introduced. The statement of that proposition is following. For $\mathbb{S}^n \subseteq \mathbb{R}^{n + 1}$ with coord...
2021/11/15
[ "https://math.stackexchange.com/questions/4307222", "https://math.stackexchange.com", "https://math.stackexchange.com/users/399707/" ]
You consider an arbitrary homology theory $H\_\*$ satsyfing all Eilenberg-Steenrod axioms including the dimension axiom. Thus you should not use the notation $\tilde{H}\_n(\mathbb{S}^n ; \mathbb{Z})$ because that suggests that the functors $H\_n$ have a second variable (the coefficient group). But such a concept is not...
18,074,221
I'm facing an issue with chrome 28. I build an application that use the webcam to take picture. I had no problem with it, but since I upgrade to chrome 28, my application is not working anymore (I'm getting an error with the getUserMedia function). Here is the message : `{"constraintName":"","message":"","name":"PER...
2013/08/06
[ "https://Stackoverflow.com/questions/18074221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2655718/" ]
Try like this: ``` public class TempContext : DbContext { public DbSet<Shop> Shops { get; set; } public DbSet<Certificate> Certificates { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity<Shop>().HasRequired(x => x.Certificate); } } ```
72,904,850
I am struggling to create a new variable named "edu\_category" to indicate whether each person experiences Female Hypergamy (wive's education level < husband's), Female Homogamy (wive's education level == husband's), or Female Hypogamy (wive's education level > husband's). My data looks like this (Female == 1 indicate...
2022/07/07
[ "https://Stackoverflow.com/questions/72904850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19455550/" ]
You can do this in a report visualisation with a few measures, to calculate number of sales, percentage of sales, product rank by sales (then product name), and cumulative sales percentage: ##### # Sales: ``` # Sales = COUNT ( Sales[ID SALE] ) ``` ##### % Sales: ``` % Sales = DIVIDE ( [# Sales], ...
453,030
How can I create a product key for my C# Application? I need to create a product (or license) key that I update annually. Additionally I need to create one for trial versions. > > Related: > > > * [How do I best obfuscate my C# product license verification code?](https://stackoverflow.com/questions/501988) > * [Ho...
2009/01/17
[ "https://Stackoverflow.com/questions/453030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/53605/" ]
You can do something like create a record which contains the data you want to authenticate to the application. This could include anything you want - e.g. program features to enable, expiry date, name of the user (if you want to bind it to a user). Then encrypt that using some crypto algorithm with a fixed key or hash ...
22,213,229
I have this set of number `a=[1 2 3]`. And I want to put this number randomly into matrix 7 x 1, and number 1 must have 2 times, number 2 must have 3 times and number 3 must have 2 times. The sequence is not necessary. The answer look like. `b=[1 2 2 2 1 3 3]'`
2014/03/06
[ "https://Stackoverflow.com/questions/22213229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3386135/" ]
Try [`randperm`](http://www.mathworks.com/help/matlab/ref/randperm.html): ``` a=[1 2 3]; samps = [1 1 2 2 2 3 3]; % specify your desired repeats samps = samps(randperm(numel(samps))); % shuffle them b = a(samps) ``` Or, instead of specifying `samps` explicitly, you can specify the number of repetitions for each elem...
73,214,339
Put the entire code into a question, thank you to all that have replied but this issue is super annoying either way help is appreciated! Context: This code is meant to go onto the top reddit post of the day/week, then screenshot it and once that's done it goes to the comments and screenshots the top comments of said p...
2022/08/02
[ "https://Stackoverflow.com/questions/73214339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13668926/" ]
There is a potential conflict between the class you created `gui.FlowLayout` and `java.awt.FlowLayout`, the layout you have to give to your frame. The error is due to the fact the `JFrame.setLayout()` method expects a `java.awt.FlowLayout` and not a `gui.FlowLayout` which is the only FlowLayout available in your code....
24,696
**The Challenge** Using only lands and Goblins, your goal is to build a Magic: the Gathering deck that can win the game as quickly as possible, against an opponent who does nothing. You may assume that your deck is stacked, so that you will always draw exactly the cards you want. **Scoring** The winning answer ...
2015/12/19
[ "https://puzzling.stackexchange.com/questions/24696", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/7459/" ]
Got it down to turn 1 on the draw if we allow Mons's Goblin Waiters! **Turn 1 - infinite damage on the draw (16 cards used)** > > Turn 0: > > > > Gemstone Caverns, exiling Mons's Goblin Raiders for irony (1 card "used") > > > > > > Turn 1: > > > > City of Traitors, tap both lands for 2...
63,948,882
After calculation I would like to pop up a windows displaying a message and the results. In the following example I would like to display in the pop up windows the value of x. The function winDialog seems to not be able to perform it. ``` library(sp) library(svDialogs) library(rgdal) x <- runif(1, 1, 10) if(x <= 5){ ...
2020/09/18
[ "https://Stackoverflow.com/questions/63948882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11501898/" ]
You can use `paste()` to combine the value of your variable `x` and the text you want to print. Note that the `winDialog()` function only works under windows and not under other OS. ``` x <- runif(1, 1, 10) winDialog("ok", paste(x, ifelse(x <= 5, "is OK", "is too big"))) ``` [![Dialog box](https://i.stack.imgur.com/...
663,821
After choosing between "Express" or "Custom" update it keeps loading forever. ![windows update screen](https://i.stack.imgur.com/MkvQ8.jpg) ![windows update keepes loading forever](https://i.stack.imgur.com/CpMj8.jpg) That's how it looks like. I have been waiting for more than 24 hours, but no success. **SYSTEM & ...
2013/10/22
[ "https://superuser.com/questions/663821", "https://superuser.com", "https://superuser.com/users/229162/" ]
I did have exactly the same problem as stated by RaphaelVidal. In my case the solution was actually simple. Cause of the problem looks to be a cancelled download or install of an earlier update. I could see that in the update history (see left side in Microsoft Update) that an earlier update was cancelled. In that hi...
47,797,157
I am currently doing a project with SQL Server. I am not too familiar with this programming language, and I am required to create relationships. The relationships I have created are * Pet/Owner (One-To-Many) * Pet/Appointment (One-to-One) * Appointment/Vet (One-to-One). I have looked on Google and YouTube, and I THI...
2017/12/13
[ "https://Stackoverflow.com/questions/47797157", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8612039/" ]
You need to add Foreign Keys to support the relationships, for example: ``` ALTER TABLE Owner ADD CONSTRAINT FK_Owner_Pet FOREIGN KEY (PET_NUM) REFERENCES Pet (PET_NUM) ON DELETE CASCADE ON UPDATE CASCADE ; GO ``` This implements a one-to-many relationship. I don't think you r...
4,820,591
I would like to have the SQL Server PowerShell extensions available to me whenever I start PowerShell by loading the snap-ins in my profile.ps1 script. I found an article [here](http://blogs.msdn.com/b/mwories/archive/2008/06/14/sql2008_5f00_powershell.aspx) with a script example that shows how to do this, and this wor...
2011/01/27
[ "https://Stackoverflow.com/questions/4820591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241023/" ]
I've used this script without issue on x64 machines. The problem with the x86 invocation is that the script looks for registry keys which on an x64 instance are only accessible from x64 PowerShell. For the x64 invocation you could try registering the snapins since that is the error message you're receiving. Run as admi...
5,637,650
Test.java ``` package a; import b.B; public class Test { public static void main(String[] v) { new A().test(); new B().test(); } } ``` A.java: ``` package a; public class A { protected void test() { } } ``` B.java: ``` package b; public class B extends a.A { protected void test() ...
2011/04/12
[ "https://Stackoverflow.com/questions/5637650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371623/" ]
Here you go JLS on `protected` keyword: [JLS protected description](http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.6.2) and [JLS protected example](http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.6.2). Basically a `protected` modifier means that you can access field / method / .....
168,350
I'm setting up a site for internal use and it will be served over HTTPS with a self-signed server certificate. To increase security, I want to also secure the site with client certificates. Is there any reason to use a separate certificate authority to sign the client certificates instead of just using the server priv...
2017/08/28
[ "https://security.stackexchange.com/questions/168350", "https://security.stackexchange.com", "https://security.stackexchange.com/users/157901/" ]
When you talk about security, all this self-signed SSL stuff has nothing common with security. In order to implement proper SSL configuration for internal network, you have to: * Create your own CA server (depending on a platform, different products may be used. For example, in Windows you can use Active Directory Cer...
1,578,885
Let $\mathscr A$ be a unital C\*-algebra and let $a,b\in \mathscr A$ such that $0\leq a \leq b$ and $a$ is invertible. How to show that $b$ is invertible? ($0\leq a \leq b$ means that $a,b$ is positive and that $b-a$ is positive. Moreover, a positive element is a hermitian element with a spectrum which is a subset of...
2015/12/16
[ "https://math.stackexchange.com/questions/1578885", "https://math.stackexchange.com", "https://math.stackexchange.com/users/82448/" ]
Let $x=-\cos(\theta)$ so that $$\mu(1-x^2)^2-x=0$$ This polynomial indeed has a single root in the range $[0,1]$ for all positive $\mu$. We can rewrite the above equation as $$\mu=\frac x{(1-x^2)^2}.$$ For small $x$, $x\approx\mu$. For $x$ close to $1$, let $1-\epsilon$, we have $$\mu=\frac{1-\epsilon}{(1-(1-\ep...
57,343
How to determine the order of nucleophilicity for given chemical species? Like I came across this question, to rearrange $\ce{RCOO-, OR-, OH-, H2O}$ (alkyl acetate, alkoxide, hydroxide, and water) in decreasing order of nucleophilicity and it ranked $\ce{OR-}$ first. Shouldn't it be $\ce{OH-}$ since $\ce{OR-}$ would ...
2016/08/12
[ "https://chemistry.stackexchange.com/questions/57343", "https://chemistry.stackexchange.com", "https://chemistry.stackexchange.com/users/30466/" ]
Within a group of nucleophiles with the same atom, the nucleophilicity decrease with **decreasing basicity of nucleophile**. Decreasing basicity means the decreasing affinity of electron pair for a proton. The decreasing order of nucleophilicity is shown in the figure. [![enter image description here](https://i.stac...
34,496,574
No mather what I write in the input fields I only get NaN even from the page load I get NaN Any idea why? I need quantity to \* by price and give a result, here is the code. I will display the code now ``` <form action="?F=save-sale" method="post" name="venta"> <table class="table-global"> <tr> <td...
2015/12/28
[ "https://Stackoverflow.com/questions/34496574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5618056/" ]
Just have this condition `if (aaventa.value && aacantidad.value)` before calculating the product. It makes sure that the values are not *empty*. Everything else is fine. ```js var aaventa = document.getElementsByName('venta')[0]; var aaventatotal = document.getElementsByName('ventatotal')[0]; var aacantidad = docume...
52,141,775
I have a Typscript app and API. I wrote the below test per numerous Google searches and some examples found here on SO and other places. I see no issue in the test code. Googling `TypeError: chai.request is not a function`, so far is getting me now where. Do you see my error below? Thank you, thank you, thank you for...
2018/09/02
[ "https://Stackoverflow.com/questions/52141775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2556640/" ]
I solved this by the following approach (Express.js with TypeScript) ``` import chai from 'chai'; import chaiHttp from 'chai-http'; chai.use(chaiHttp); ``` Hope it helps. *Remember to install* **@types/chai** *and other type definition packages for the block above to work*
68,301,835
I've got the following two methods: ```java public static <T, R> IGetter<T, R> createGetterViaMethodname( final Class<T> clazz, final String methodName, final Class<R> fieldType ) throws Throwable { final MethodHandles.Lookup caller = Method...
2021/07/08
[ "https://Stackoverflow.com/questions/68301835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5841827/" ]
There is no built-in "pretty" way to convert a primitive class to a wrapper class, so you gotta use a map like this: ``` private final static Map<Class<?>, Class<?>> map = new HashMap<>(); static { map.put(boolean.class, Boolean.class); map.put(byte.class, Byte.class); map.put(short.class, Short.class); ...
5,235,998
I wrote a small farad converter to learn GUI programming. It works great, looks fine-ish. The only problem is I can't seem to figure out how to control this strange highlighting that comes up on my `ttk.Combobox` selections. I did use a `ttk.Style()`, but it only changed the colors of the `ttk.Combobox` background, ent...
2011/03/08
[ "https://Stackoverflow.com/questions/5235998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/623985/" ]
You can use the Combobox's [`selection_clear()`](http://effbot.org/tkinterbook/entry.htm#Tkinter.Entry.selection_clear-method) method to clear the selection whenever you want. e.g ``` inUnitsValue.selection_clear() ```
4,433,626
We have a growing mailing list which we want to send our newsletter to. At the moment we are sending around 1200 per day, but this will increase quite a bit. I've written a PHP script which runs every half hour to send email from a queue. The problem is that it is very slow (for example to send 106 emails took a total ...
2010/12/13
[ "https://Stackoverflow.com/questions/4433626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541095/" ]
There doesn't appear to be a method, but I am not surprised. Slugify removes characters from the string and unslugify would not know where to put it back in. For example, if you look at the URL for this question, it is ``` stackoverflow.com/questions/4433620/play-framework-how-do-i-lookup-an-item-from-a-slugify-url ...
84,130
Is there any way to see all publicly shared Google Drive items/documents from a specific Google user?
2015/09/05
[ "https://webapps.stackexchange.com/questions/84130", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/95229/" ]
I wrote a Google Apps Script macro that you can attach to a new spreadsheet (or an old one, if it would make any sense) that accomplishes this task. To attach a script to a spreadsheet, go into that spreadsheet (or create a new one), click "Tools"->"Script editor...", copy and paste the code into the editor, click "Res...
160,333
I'd like to measure a dozen potentiometers with an Arduino UNO. Unfortunately, the UNO only has 6 analog pins, but it does have about a dozen digital pins. Could I effectively measure an analog value with a digital pin by following this procedure? 1. Wire the potentiometer in parallel with a capacitor. 2. Connect one...
2015/03/17
[ "https://electronics.stackexchange.com/questions/160333", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6852/" ]
I would not rely on it. While it may work there could also be some stray capacitance or other factors that also affect the reading of time and voltage value. Remember that there is a no mans land between high and low (where the analog signal would be), that theoretically could change with temperature, time or any varie...
411,968
I am working with VLC from C# by creating a process that opens the command line. Is there any way of knowing when a movie ended in from the command line or something ?
2012/04/13
[ "https://superuser.com/questions/411968", "https://superuser.com", "https://superuser.com/users/128126/" ]
I have googled for solution finally - its not a thing that comes visible with a simple search though. Seems not many people interested. I am writing from a PC where I do not have Outlook installed, but hope I remember that well. 1. You need to enable Developer "ribbon" in Outlook 2. You need to create new form (usi...
42,606,533
I was given an assignment to find the sum of the squares of the first n odd numbers whereby n is given by the user. The assignment was; ``` The script only takes one input, so do not # include any input command below. The print commands below are already given. # Do not alter the print commands. Do not add any other ...
2017/03/05
[ "https://Stackoverflow.com/questions/42606533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7660992/" ]
We want to do iterate through odd numbers so if we want to do n odd numbers we need to go up to 2\*n. For example, 5 odd numbers would be 1,3,5,7,9 and 2\*5=10, but we only want every other number so we have the command `r = range(1, n * 2, 2)` We then start with zero and add to it, hence `result = 0` Now we iterate ...
62,454,336
Env: Python 3.6, O/S: Windows 10 I have the following code that will search for filenames that contain a string either at the start (`.startswith`) of a filename or the end of a filename (`.endswith`), including sub directories and is case sensitive, i.e. `searchText = 'guess'` as opposed to `searchText = 'Guess'`. I...
2020/06/18
[ "https://Stackoverflow.com/questions/62454336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1709475/" ]
A simple `glob`-based approach: ``` #!/usr/bin/env python3 import os import glob # set text to search for searchText = 'Guess' # the root (top of tree hierarchy) to search, remember to change \ to / for Windows TOP = 'C:/works' found = 0 for filename in glob.iglob(os.path.join(TOP, '**', f'*{searchText}*'), rec...
631,694
[![enter image description here](https://i.stack.imgur.com/UBFqR.png)](https://i.stack.imgur.com/UBFqR.png) The supply voltage is 15 V and RL is 100 kΩ. Find the voltage across each diode and RL. Is = 0.1 μA, η = 2, and VT = 25 mV. How can I calculate the net current through RL? I have three unknowns: the net current...
2022/08/18
[ "https://electronics.stackexchange.com/questions/631694", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/293958/" ]
You'd use the Shockley equation, $$ I(V\_D)=I\_S \left( e^\frac{V\_D}{\eta V\_T} - 1 \right), $$ to figure it out. You're given \$I\_S\$, \$V\_T\$ and \$\eta\$. We can invert this equation: given \$I\$, solve for \$V\_D\$. This will be more useful, since the current \$I\$ is the same for both diodes: $$ V\_D(I) = \l...
70,682,367
I'm trying to click on an icon that appears on the page however despite trying everything I can think of I keep getting the following error: ``` waiting for selector "[aria-label="Comment"]" selector resolved to 2 elements. Proceeding with the first one. selector resolved to hidden <svg role="img" width="24" heigh...
2022/01/12
[ "https://Stackoverflow.com/questions/70682367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17914989/" ]
You can use `nth` locator's method to get second element: ```js page.locator('svg[aria-label="Comment"]').nth(1); ``` or shorter version: ```js page.locator('svg[aria-label="Comment"] >> nth=1'); ``` Keep in mind that's zero-based numbering.
635,440
I am using debian 10 and I want to create a user with no home directory. the user should only have access to the directories that his or her group owns. that is the user has only to his or her group directories. This is my command information: `useradd -g mygroup-G mygroup1,mygroup2 -s /bin/bash -M username` However ...
2021/02/19
[ "https://unix.stackexchange.com/questions/635440", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/457004/" ]
1. There are tools to manipulate filesystems as you ask. One such is the [mtools](https://www.gnu.org/software/mtools/) package, which does FAT filesystems. Another is [e2tools](https://e2tools.github.io), which does EXT2 and EXT3 filesystems. Both of these are available in debian linux, and probably many others. 2. Th...
4,490,691
I want to achieve this: ``` public System.Web.Mvc.ActionResult ExposureGrid(Guid? id, decimal stdDev) { //return null; try { var str = "<table border=1>"; str += "<tr><th>Date</th><th>Expected Credit Exposure</th><th>Max Credit Exposure</th></...
2010/12/20
[ "https://Stackoverflow.com/questions/4490691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/534101/" ]
change: ``` dataType: "jsonData", ``` to ``` dataType: "json", ``` hopefully, issue should be resolved.
31,018,912
I am facing an issue probably with int to char conversion. What i am doing? ``` > Create random password using Membership.createPassword() > Create random digit. > Convert password to array > Get random array index and replace character with int ``` I have following code to generate random password with 1 digit at ...
2015/06/24
[ "https://Stackoverflow.com/questions/31018912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1874957/" ]
Change ``` charArray[index] = Convert.ToChar(index); ``` to: ``` charArray[index] = (char)('0' + index); ``` Now... What does it means this line? `char` in c# are more like `int` than like `string`... So you can do ``` int x = 'A' + 1; ``` and you'll get that `x == 66` (that is the unicode code for `'B'`)......
35,030,962
I am following "The Big Nerd Ranch's Android Programming Guide" book (2nd edition) and in a particular chapter (chapter 21), they ask you to use a 9-patch image for some image assets. Up until then, the app that I wrote, called BeatBox, worked perfectly fine and compiled without error. But, when I go ahead and replace...
2016/01/27
[ "https://Stackoverflow.com/questions/35030962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2611713/" ]
First off a little sanity boost for you --------------------------------------- AAPT is exactly related to bundling the resources into your APK. Some great detail [here](http://www.alittlemadness.com/2010/06/07/understanding-the-android-build-process/) including (IMO) the best diagram showing the different build steps...
1,966,030
I'm writing a simple Twitter example that reads the Twitter Search RSS feed via: ``` http://search.twitter.com/search.rss ``` This works well except that the Description in this contains HTML such as Bold Tags and Link Tags, I have looked at the Atom feed via: ``` http://search.twitter.com/search.atom ``` It also...
2009/12/27
[ "https://Stackoverflow.com/questions/1966030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61529/" ]
There is a hack: ``` private void setDimButtons(boolean dimButtons) { Window window = getWindow(); LayoutParams layoutParams = window.getAttributes(); float val = dimButtons ? 0 : -1; try { Field buttonBrightness = layoutParams.getClass().getField( "buttonBrightness"); b...
33,762
I am flying from U.S. to India via Germany(2 stops - Dusseldorf and Munich). There is a 40 min layover at Dusseldorf and 1 h 40 min layover at Munich. I am concerned if I will be able to make to the connection to Munich. Is 40 mins enough time for a transit? Also, I am not a US citizen and will require an airport trans...
2014/07/12
[ "https://travel.stackexchange.com/questions/33762", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/18339/" ]
40 minutes could be enough but it could become scarce. As your second leg is a domestic Schengen flight, you will need to get through security and passport check. With only 40 minutes between the flights it's likely to miss the flight to Munich.
51,857,207
I want to change this: ``` input <- c("Théodore Agrippa d'AUBIGNÉ", "Vital d'AUDIGUIER DE LA MENOR") ``` into this : ``` output <- c("Théodore Agrippa d'Aubigné", "Vital d'Audiguier De La Menor") ``` The only words that should be modified are those that are all upper case. **Edit:** An edge case, where first l...
2018/08/15
[ "https://Stackoverflow.com/questions/51857207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270475/" ]
Form two groups with boundaries on both sides as in ``` \b([A-Z])(\w+)\b ``` and use `tolower` on the second group (leaving the first untouched). See [**a demo on regex101.com**](https://regex101.com/r/gdaEQR/1/) (and mind the modifiers, especially `u`). --- *As a side note: you still have a couple of questions...
603,007
I have had the misfortune to need to clone a dual-booting Windows XP/7 box to replace its hard drive with a smaller one. I had great trouble getting it to boot and would like to understand what's going on and if I could be doing anything better. Background: the machine has a 750Gb drive with 3 partitions on it: * Win...
2013/06/02
[ "https://superuser.com/questions/603007", "https://superuser.com", "https://superuser.com/users/101178/" ]
After cloning partitions containing Windows operating systems, it is necessary to fix up the boot configuration data if the cloned partitions are not in exactly the same position on the cloned disc as they are on the original. The Windows boot mechanism, since Windows Vista, stores its configuration as "Boot Configur...
4,312,386
I know it's similar to [this](https://math.stackexchange.com/questions/265809/sup-gyy-in-y-leq-inf-fxx-in-x) and I proved this inequality, but I'm stuck at finding examples that this inequality is strict. thanks. Edit: range is bounded.
2021/11/21
[ "https://math.stackexchange.com/questions/4312386", "https://math.stackexchange.com", "https://math.stackexchange.com/users/470876/" ]
The inequality can be strict if both $X$ and $Y$ have at least two elements. For an example pick arbitrary elements $x\_1 \in X$ and $y\_1 \in Y$ and define $$ f(x, y) = \begin{cases} 0 & \text{ if } x=x\_1 \text{ and } y = y\_1 \\ 1 & \text{ if } x=x\_1 \text{ and } y \ne y\_1 \\ 1 & \text{ if } x\ne x\_1 \text{ a...
31,607,465
I'm new here and registered because I couldn't find my answer in the existing treads. I'm trying to make a one-page website, and I want the 'landing page' to have a full background. I had the background on the whole page, but when I started placing text in the div, it broke. I used the following css (sass): ``` .int...
2015/07/24
[ "https://Stackoverflow.com/questions/31607465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5151678/" ]
Your problem is with [margin collapsing](https://developer.mozilla.org/en-US/docs/Web/CSS/margin_collapsing): **Parent and first/last child** If there is no border, padding, inline content, or clearance to separate the margin-top of a block with the margin-top of its first child block, or no border, padding, inline...
8,187,082
Suppose I have a class with a constructor (or other function) that takes a variable number of arguments and then sets them as class attributes conditionally. I could set them manually, but it seems that variable parameters are common enough in python that there should be a common idiom for doing this. But I'm not sure...
2011/11/18
[ "https://Stackoverflow.com/questions/8187082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12982/" ]
You could update the `__dict__` attribute (which represents the instance attributes in the form of a dictionary) with the keyword arguments: ``` class Bar(object): def __init__(self, **kwargs): self.__dict__.update(kwargs) ``` then you can: ``` >>> bar = Bar(a=1, b=2) >>> bar.a 1 ``` and with somethin...
148,065
I seem to see the phrase "shake his booty" being used to say something is good and attractive. But does it mean "shake his butt"? And if they are the same, why does "shake his butt" seem a somewhat distasteful action, but "shake his booty" all of a sudden becomes somewhat glamorous?
2014/01/26
[ "https://english.stackexchange.com/questions/148065", "https://english.stackexchange.com", "https://english.stackexchange.com/users/1204/" ]
"Neither is glamorous! "Booty" is [American slang for buttocks](http://www.urbandictionary.com/define.php?term=booty) but almost universally refers to that of a woman. "Butt" is also slang for "buttocks" but does not imply gender. Moreover, "booty" has overt sexual overtones (and is, in fact, slang for having sex in so...
45,541,902
Say we have 3 kafka partitions for one topic, and I want my events to be windowed by the hour, using event time. Will the kafka consumer stop reading from a partition when it is outside of the current window? Or does it open a new window? If it is opening new windows then wouldn't it be theoretically possible to have...
2017/08/07
[ "https://Stackoverflow.com/questions/45541902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3305586/" ]
So first of all events from Kafka are read constantly and the further windowing operations have no impact on that. There are more things to consider when talking about running out-of-memory. * usually you do not store every event for a window, but just some aggregate for the event * whenever window is closed the corre...
63,084
The background of my question relies on the following points. * Quine-Duhem thesis: it is difficult to test a theory with an experiment, because the test would rely on other theories. * The discussion of the previous point is difficult because we do not have a "theory of everything", so it is not clear if the chain of...
2019/04/24
[ "https://philosophy.stackexchange.com/questions/63084", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/39393/" ]
In addition to Nietzsche: --- [Rousseau](https://en.wikipedia.org/wiki/Jean-Jacques_Rousseau) wrote both the music and libretto for an opera - [Le Devin du Village](https://en.wikipedia.org/wiki/Le_devin_du_village). [Rousseau - Le Devin du Village on YouTube](https://www.youtube.com/watch?v=Ld7XDELDnto) --- [Ador...
5,094
Which of the following sentences is better to use? > > 1. Where it is concluded that the report is incorrect it will be returned. > 2. If the report is incorrect then it will be returned. > > > Or do they mean the same thing? These sentences will be used for a description of activities.
2010/11/16
[ "https://english.stackexchange.com/questions/5094", "https://english.stackexchange.com", "https://english.stackexchange.com/users/201/" ]
In your examples, the sentence starting with *if* is easier to understand. But it always depends on the context of what's being written as well as target audience. I find *where* is used more often in formal writings, but not always.
38,552,131
Question ======== I want to separate my prod settings from my local settings. I found this library [django-split-settings](https://github.com/sobolevn/django-split-settings), which worked nicely. However somewhere in my code I have something like this: ``` if settings.DEBUG: # do debug stuff else: # do prod st...
2016/07/24
[ "https://Stackoverflow.com/questions/38552131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/766570/" ]
This is an old question, here is the answer: * with older versions of scapy, it simply was not possible * with newer scapy versions (2.4.0+), simply sniff using the monitor argument `sniff([args], monitor=True)` It shows all packets !
14,321,101
I'm using Flash Builder 4.7. When starting a new Actionscript Project, the first popup box where you define the project name etc doesn't show any SDK's. So under "This project will use" there is just an empty area... And in the created project I also can't link to a Flex SDK in the Actionscript Build Path. When start...
2013/01/14
[ "https://Stackoverflow.com/questions/14321101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278949/" ]
Problem found and solved thanks to this blog post: <http://www.badu.ro/?p=238> Apparantly when moving from Flex Builder 4.6 to 4.7 you have to use new workspaces. If you reuse the existing ones from version 4.6 you run into problems like I was having... Thanks for all your help, Frank
158,224
I am using the below code ``` Web rootWeb = clientContext.Site.RootWeb; rootWeb.Fields.AddFieldAsXml("<Field DisplayName='Session Name' Name='SessionName' ID='"+new GUID()+"' Group='SharePoint Saturday 2014 Columns' Type='Text' />", false, AddFieldOptions.AddFieldInternalNameHint); clientContext.Execut...
2015/09/29
[ "https://sharepoint.stackexchange.com/questions/158224", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/41560/" ]
I removed the ID parameter in the column creation and it worked fine ``` Web rootWeb = clientContext.Site.RootWeb; rootWeb.Fields.AddFieldAsXml("<Field DisplayName='Session Name' Name='SessionName' Group='SharePoint Saturday 2014 Columns' Type='Text' />", false, AddFieldOptions.AddFieldInternalNameHint); ...
18,466,107
I've created some utilities that help me at generating HTML and I reference them in my views as `@div( "class" -> "well" ){ Hello Well. }`. Until now those classes were subclassing `NodeSeq` because they [aren't escaped](https://github.com/playframework/playframework/blob/702d48bf4d9d24b58f247546b0cd0cb893659dc0/framew...
2013/08/27
[ "https://Stackoverflow.com/questions/18466107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1493269/" ]
If the PID is stored in a variable called `x`, then the last digit can be found as `x % 10`.
34,415,375
I have an entity with `@OneToOne` mapped subentity: ``` @Entity @Table public class BaseEntity { @Id private String key; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) private InnerEntity inner; } @Entity @Table public class InnerEntity { private String data; } ``` It was worki...
2015/12/22
[ "https://Stackoverflow.com/questions/34415375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/610215/" ]
If you want `inner` field to be loaded on demand and your relation is `@OnToOne`you can try this `@OneToOne(fetch = FetchType.LAZY, optional = false)`
57,412,417
i have a array `banks` and I need to return one object with all the parameters described below ``` const banks = [{kod: 723,name: "bank",},{kod: 929,name: "bank2"}] ``` i tried to do it with ``` const lookup = banks.map(item => { return ({[item.kod]: item.name }) }) ``` but it returns the result `[ {723: "ban...
2019/08/08
[ "https://Stackoverflow.com/questions/57412417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10473328/" ]
You can use [`.reduce()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce) with the [spread syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) like so: ```js const banks = [{kod: 723,name: "bank",},{kod: 929,name: "bank2"}]; ...
4,055,939
I am having a problem with the asp:Menu control. A menu control 2 levels deep does not play well with internet explorer on https. I continually get an annoying popup. I think in order to fix this I need to override a function in an automatically included script file. change this ``` function PopOut_Show(panelI...
2010/10/29
[ "https://Stackoverflow.com/questions/4055939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/102526/" ]
If you declare the overload later that should be the function that executes ``` function alerttest(){ alert("1"); } function alerttest(){ alert("2"); } alerttest(); ``` Here is another answer: [Overriding a JavaScript function while referencing the original](https://stackoverflow.com/questions/296667/overriding-a...
18,500,368
I'm learning JavaScript from w3schools and it talks about how "If you execute document.write after the document has finished loading, the entire HTML page will be overwritten" and I've seen from examples that this does in fact happen, but "I don't understand what is really going on and the website kind seems to skip ov...
2013/08/29
[ "https://Stackoverflow.com/questions/18500368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2727356/" ]
If you're familiar with programming in general then you'll be aware of `stream`s, which represent something you can read from, or write to, in continuous fashion and (usually) lack random-access. Imagine that the `document` object contains hidden inside it a stream that represents the raw text response from the webser...
72,998,115
My text in the button is not centered. I feel that this happens all the time. The text always seems to be a bit under the center. I tried to open the code with Chrome and Edge. They look the same. Here's a photo of the button ```css .button-container { display: flex; position: absolute; top: 10px; right: 10px;...
2022/07/15
[ "https://Stackoverflow.com/questions/72998115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19480643/" ]
You are trying to position an element using hard coded padding values. My advice would be not to do that. Remove the padding and change your x -> X. Then add these to your class ``` .button {height: 15px; aspect-ratio: 1/1;} ``` Whatever you set the height to the width will follow. With your border radius you can t...
1,685
This question may be interpreted as "too localized", but it is not. I'm interested in what you find to be the best sites for this type of operation, regardless of where they are located. For instance, I want to learn about how do these sites do the following: * How do they work with geographic information? * What sea...
2010/07/07
[ "https://webapps.stackexchange.com/questions/1685", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/567/" ]
The ones I've had most sucess with is: * [Rightmove](http://www.rightmove.co.uk/)
10,051,395
``` public class Main { public static void main(String[] args){ Class2 class2Object = new Class2(); //class2Object //num1 class2Object.setNumber(class2Object.number1, 1) ; class2Object.getNumber(class2Object.number1); } } public class Class2 { public int numb...
2012/04/07
[ "https://Stackoverflow.com/questions/10051395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1050548/" ]
Your setter doesn't do anything: ``` public void setNumber(int x, int value){ x = value; // This just overwrites the value of x! } ``` A setter should have only one parameter. You need to assign the received value to the member field: ``` // The field should be private. private int number; public void setNum...
19,772,164
I'd like to transition to a template but reloading the page content through a JSON request. In other words, I load initially my index template through a `getJSON` request and then I go to another template where I modify some data. Later, I'd like to return to my initial template through an action handler with the the ...
2013/11/04
[ "https://Stackoverflow.com/questions/19772164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2886221/" ]
You can do this purely at the UI level by handling the text box's KeyDown and KeyPress events: ``` Private Sub txtPostCode_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeySpace Then KeyCode = 0 End Sub Private Sub txtPostCode_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case Asc("a") To ...
68,656,785
If my code is: ``` context('The Test', () => { let testStr = 'Test A' it(`This test is ${testStr}`, () => { expect(testStr).to.eq('Test A') }) testStr = 'Test B' it(`This test is ${testStr}`, () => { expect(testStr).to.eq('Test B') }) testStr = 'Test C' it(`This test is ${testStr}`, () => { ...
2021/08/04
[ "https://Stackoverflow.com/questions/68656785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16595273/" ]
`it()`'s callbacks will be executed only after parent's one (`context` in your case). You can play with it in debugger and see it live: [![enter image description here](https://i.stack.imgur.com/AFUOV.gif)](https://i.stack.imgur.com/AFUOV.gif) So mocha will assign the final 'Test C' value and call the first `it()` cal...
27,420,848
My understanding of Oblique font styling in CSS3 is that it's the same as the normal font, with an angle applied. Italics on the other hand, is a separate set of glyphs, that while slanted also feature unique characters, like an extra curly z, or a pronounced y, whatever. Now, I've been running font-style: oblique, a...
2014/12/11
[ "https://Stackoverflow.com/questions/27420848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4345631/" ]
Oblique and Italic are two different styles. They don't look the same; the fact that they *seem* to look the same is caused by the program that displays the font (i.e. the browser); it shows the variant that is present, so if you specify `oblique`, it uses italic if oblique isn't available, and vice versa. Now it's po...
39,328,291
I'm building a CMS where Administrators must be able to define an arbitrary number fields of different types (text, checkboxes, etc). Users then can fill those fields and generate posts. How can this be done in Rails? I guess that the persistence of these "virtual" attributes will be done in a serialised attribute in ...
2016/09/05
[ "https://Stackoverflow.com/questions/39328291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/182172/" ]
What you describe is called [Entity-Attribute-Value model](https://en.wikipedia.org/wiki/Entity%E2%80%93attribute%E2%80%93value_model). MattW. provided 2 possible solutions, but you can also use one of these gems that implement this data pattern instead of handling this yourself: * [eav\_hashes](https://github.com/ios...
66,998,989
I am working on a Rest API in TypeScript. The part I'm working on receives as a parameter a Type object containing a body attribute as being of type "Unknown". I have to check that the body attribute that I received in my object as a parameter is strictly compliant with my Type / Interface, here in the exemple : "acc...
2021/04/08
[ "https://Stackoverflow.com/questions/66998989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15345150/" ]
You seem to want: Your query can be radically simplified: * The outer join is really an inner join due to the `WHERE` clause. * The boolean conditions are much more complicated than necessary ( "(A OR B) AND A" is really just "A"). * No subquery is necessary. * The `JOIN` conditions can be expanded. So: ``` SELECT ...
459,801
I'd like to ask for the community's opinion regarding the correct usage of a comma for a quoted question. In a situation such as this, which of the two following sentences would be correct? The placement of the comma is the only difference, and I can't seem to pinpoint which one is correct. > > A popular answer to t...
2018/08/12
[ "https://english.stackexchange.com/questions/459801", "https://english.stackexchange.com", "https://english.stackexchange.com/users/312127/" ]
Berserk is an odd option here. **Violent** would provide better meaning. (i)Brusque implies a lack of manners. That's a very *hoity-toity* way of putting it. Pacific is just flat out wrong, it means 'peaceful'. No one stops for picnics in the park in the middle of a revolution. (ii) "more peaceful" implies a calming do...
4,082,537
I am kind of stuck with a simple type check on a generic helper class I am writing. The idea will be clear if you take a look at the source code. It works nice for normal things, like DateTime and bool, but I got a problem with generics. How do I check for e.g. ObservableCollection < **something** > and count it. I do...
2010/11/02
[ "https://Stackoverflow.com/questions/4082537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109646/" ]
Is it necessary to go this route? ``` if (parent is DateTime) return new TextBlock() { Text = ((DateTime)parent).ToShortTimeString() }; if (parent is ICollection) return new TextBlock() { Text = ((ICollection)parent).Count }; if (parent is IEnumerable) return new TextBlock() { Text = ((IEnumerable)parent).C...
34,876,623
I got part of a sentence in my database like : ``` beautiful house close to the beach this peaceful touristic area under a beautiful tree behind the property ``` I would like to select sentence that does not contain a list of word like 'to','a' Wanted result: ``` this peaceful touristic area behind the property ...
2016/01/19
[ "https://Stackoverflow.com/questions/34876623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5809722/" ]
You can use *word boundaries* applied to the *group* of two alternatives listed after `|` operator: ``` WHERE semi_sentence NOT RLIKE '[[:<:]](to|a)[[:>:]]' ``` See [what this regex matches](https://regex101.com/r/vA5dB1/1) (you will get those that do not match since you are using `NOT`, and `\b` is used in PCRE ins...
47,724,573
I have: ``` myColCI<-function(colName){ predictorvariable <- glm(death180 ~ nepalData[,colName], data=nepalData, family="binomial") summary(predictorvariable) confint(predictorvariable) } ``` One of the names of the column is parity so when after making my function, when I put `myColCI(parity)`, it says the ...
2017/12/09
[ "https://Stackoverflow.com/questions/47724573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9075008/" ]
Your formula is wrong here, hence you are getting the error, The right hand side after tilda side shouldn't be a reference to a dataframe. It should be column names separated by plus signs : From the documentation of `?formula` > > The models fit by, e.g., the lm and glm functions are specified in a > compact symbo...
51,374,752
Trying to deal with CORS set up a simple Node / Express server like so: ``` const express = require('express'); var cors = require('cors'); const app = express(); const port = process.env.PORT || 3000; app.use(cors()); app.use(express.static('public')); app.listen(port, () => { console.log('Server active on port...
2018/07/17
[ "https://Stackoverflow.com/questions/51374752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4750401/" ]
You may try setting the options to be passed to your `cors` package, like this, ``` const corsOptions = { origin: process.env.CORS_ALLOW_ORIGIN || '*', methods: ['GET', 'PUT', 'POST', 'DELETE', 'OPTIONS'], allowedHeaders: ['Content-Type', 'Authorization'] }; app.use(cors(corsOptions)); ``` Hope this he...
264,238
I was making some changes to a remote file in vi using the terminal when I accidently pressed `Ctrl`+`S` instead of `:wq`. Now everything got hanged. I tried `Escape,:q!` and all sorts of vi commans but nothing is responding. The Terminal Screen is stuck. I can't close the Terminal session as of now as it will lead to...
2013/03/05
[ "https://askubuntu.com/questions/264238", "https://askubuntu.com", "https://askubuntu.com/users/86687/" ]
`Ctrl`+`Q` will undo `Ctrl`+`S`. These are ancient control codes to stop and resume output to a terminal. They can still be useful, for instance when you are `tailf`-ing a log file and something interesting scrolls by, but this era of unlimited scrollback buffers has really obsoleted them.
14,085,881
I would like to implement a simple authentication in an JSF/Primefaces application. I have tried lots of different things, e.g. [Dialog - Login Demo](http://www.primefaces.org/showcase/ui/overlay/dialog/loginDemo.xhtml) makes a simple test on a dialog, but it does not login a user or? I also have taken a look at Java ...
2012/12/29
[ "https://Stackoverflow.com/questions/14085881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1936452/" ]
> > Is there a way to authenticate a user without defining something in the application server? > > > This is a long and *very* thorny story. It often comes up as one the main points of criticism against Java EE. The core of the story is that traditionally Java EE applications are supposed to be deployed with "un...
620,445
I am using a very simple model to show the unity gainbandwidth of a closed loop sample and hold with a closed loop gain of 2. One would expect an ideal OTA to have a GBW independent of rout as GBW is just \$ \frac{g\_m\*r\_{out}}{r\_{out}\*C\_L} \$ or \$GBW = g\_m/C\_L (\frac {rad}{s}).\$ Yet, the simulation I contriv...
2022/05/20
[ "https://electronics.stackexchange.com/questions/620445", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/11779/" ]
If it helps anyone, I figured out (through a fairly tedious analysis) that it's more complicated than the numerous texts, literature, and theses using sample and hold and multiplying dac calculations make it out to be (it can be quite sensitive to low feedback factor and output impedance for example). I found an [exce...
5,847,598
i heard that domain driven design pattern but do not know what it is exactly. is it design pattern? if so then how it is different from mvc or mvp. please discuss this. how to implement domain driven design pattern with c#.
2011/05/01
[ "https://Stackoverflow.com/questions/5847598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/728750/" ]
In short: It's not a design pattern. You can see it as **set of patterns** and **principles** where you write code that reflects real life objects and concepts in a specific domain (problem area): From the StackOverflow tag: > > Domain-driven design (DDD) is an > approach to developing software for > complex needs...
43,202,012
I argued with a friend the other day about those two snippets. Which is faster and why ? ``` value = 5; if (condition) { value = 6; } ``` and: ``` if (condition) { value = 6; } else { value = 5; } ``` What if `value` is a matrix ? Note: I know that `value = condition ? 6 : 5;` exists and I expect it ...
2017/04/04
[ "https://Stackoverflow.com/questions/43202012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3439945/" ]
**TL;DR:** In unoptimized code, `if` without `else` seems irrelevantly more efficient but with even the most basic level of optimization enabled the code is basically rewritten to `value = condition + 5`. --- I [gave it a try](https://gcc.godbolt.org/) and generated the assembly for the following code: ``` int ifonl...
23,572,110
I have the same command button called "Output" on many sheets in the same workbook. All of the buttons call the same "sub Output()" in module ModMain. I need to know what sheet the command call came from?
2014/05/09
[ "https://Stackoverflow.com/questions/23572110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3621609/" ]
Make sure this is at the top of every VBA module: ``` Option Explicit ``` Then change this: ``` Sub Output() ``` to this: ``` Sub Output(strSource as String) ``` You have added an argument to the `Sub`. Now your code will fail to compile. (Refer to help if you don't know this part.) Fix the code so it compil...
155,428
Our Wordpress website was hacked. I couldn't find anything intelligible from my limited experience from the limited logs my hosting gives. However, browsing in the FTP files I found a post.php file in the root and two more themes. Nothing strange in the DB, nor a new user. In the index I found the string "Silence is go...
2017/03/31
[ "https://security.stackexchange.com/questions/155428", "https://security.stackexchange.com", "https://security.stackexchange.com/users/143619/" ]
the entry points for attacker can include: outdated - PHP, themes, plugins, weak passwords, misconfigured php.ini file that can lead to issues. Please check if any of these have been overlooked.
6,662,087
I'm making an flight search app with Sencha Touch and have encountered a small problem. I want to create a textfield for all the airports and need autocomplete functionality for in order to make it easy for the user to choose departure airport and return airport. How can i implement this? The airports will be loaded ...
2011/07/12
[ "https://Stackoverflow.com/questions/6662087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618162/" ]
Since there were no custom components out there and I needed something like this myself as well, I smashed it together. So, here it is. **Sencha Touch 2 Autocomplete Textfield component:** <https://github.com/martintajur/sencha-touch-2-autocomplete-textfield> It currently uses AJAX request response for populating the...
5,209,031
I'm trying to make a C++ library available as a Python module. It seems SIP is the best tool for the job. (If wrong, please correct me.) One class looks like the programmer was trying to get around c's lack of dynamic typing: ``` class Item{ private: enum ITEMTYPE{TYPE_INT,TYPE_FLOAT,TYPE_INT_ARRAY,TYPE_FLOAT_A...
2011/03/06
[ "https://Stackoverflow.com/questions/5209031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/360886/" ]
There are 26 characters, So you can use [`counting sort`](http://en.wikipedia.org/wiki/Counting_sort) to sort them, in your counting sort you can have an index which determines when specific character visited first time to save order of occurrence. [They can be sorted by their count and their occurrence with sort like ...
7,495,932
Sometimes I accidentally leave blank lines at the end of the file I am editing. How can I trim them on saving in Vim? ### Update Thanks guys, all solutions seem to work. Unfortunately, they all reset current cursor position, so I wrote the following function. ``` function TrimEndLines() let save_cursor = g...
2011/09/21
[ "https://Stackoverflow.com/questions/7495932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/423585/" ]
This substitute command should do it: ``` :%s#\($\n\s*\)\+\%$## ``` Note that this removes all trailing lines that contain only whitespace. To remove only truly "empty" lines, remove the `\s*` from the above command. **EDIT** Explanation: * `\(` ..... Start a match group * `$\n` ... Match a new line (end-of-line ...
2,893,751
Here's a problem from Cohn's *Measure Theory*. > > [Cohn, 2.1.3] Let $f$ and $g$ be continuous real-valued functions on $\mathbb{R}$. Show that if $f =g$ for $\lambda$-almost every $x$, then $f = g$ everywhere. > > > Here $\lambda$ denotes Lebesgue measure. Here's what I do. Let $h: \mathbb{R} \to \mathbb{R...
2018/08/25
[ "https://math.stackexchange.com/questions/2893751", "https://math.stackexchange.com", "https://math.stackexchange.com/users/503984/" ]
I would say that $\{x:h(x)\ne0\}$ is an open set in $\Bbb R$. (Since it is the inverse image of the open set $\Bbb R\setminus\{0\}$ under the continuous function $h$). Each nonempty open set contains a nonempty open interval, which has positive Lebesgue measure. So if $h$ is continuous, and not identically zero, then i...
123,917
I've been trying to train a model that predicts an individual's survival time. My training set is an unbalanced panel; it has multiple observations per individual and thus time varying covariates. Every individual is observed from start to finish so no censoring. As a test, I used a plain random forest regression (no...
2014/11/13
[ "https://stats.stackexchange.com/questions/123917", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/32018/" ]
Although there is structure to your data, it may be that the variation in baseline risk does not vary substantially enough among your subjects to cause a model without a frailty term to form poor predictions. Of course, it's perfectly possible that a model with a frailty term would perform better than the pooled random...
37,252,793
I have the following ARM assembly code: ``` mov r0, SP mov r1, LR bl func ``` Is there a way of calling the function func using C code? something like `func(SP, LR)` Thanks!
2016/05/16
[ "https://Stackoverflow.com/questions/37252793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6340494/" ]
Depends on what exactly you want to do and what compiler you use. With `gcc` something like this could work: ``` extern void func(void*, void*); void foo() { int dummy[4]; func(&dummy, __builtin_return_address(0)); } ``` This might not always give you the exact stack pointer, though. As per [godbolt](https:/...
18,786
> > **मानुष्यं च समासाद्य स्वर्गमोक्षप्रसाधनम्।** > > **नाचरत्यात्मनः श्रेयः स मृतः शोचते चिरम्॥३०॥** > > > The human body is the means for achieving of the heaven and moksa and even after achieving the same, he does not do good to himself. After death he keeps on thinking for a long time. > > > > > > I...
2017/06/09
[ "https://hinduism.stackexchange.com/questions/18786", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/-1/" ]
We all live in Mrityu Lok or Karma Lok. It is called karma lok because we do Karma in this world/lok and get karma phal in return. Whatever deeds we do, we will surely get Karma phal of that deed in return. The grief or joy we experience in life is nothing but result of our karma referred as karma phal. If we do good ...
71,996,211
I'm only learning Java and Spring and after several projects/tutorials went well I'm stuck with this error on a new project: > > org.springframework.beans.factory.BeanCreationException: Error > creating bean with name 'entityManagerFactory' defined in class path > resource > [org/springframework/boot/autoconfigure/or...
2022/04/25
[ "https://Stackoverflow.com/questions/71996211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13447185/" ]
So to fetch all the unused docker images without actually pruning them, you could do the following 1. Fetch all the images belonging to the running containers(which are not stopped or exited) 2. Fetch all the images on the machine 3. Then filter the images in step 1 from step 2 Below are the shell commands ``` runni...
3,220,890
`DataServiceRequestException` was unhandled by user code. An error occurred while processing this request. This is in relation to the previous post I added ``` public void AddEmailAddress(EmailAddressEntity emailAddressTobeAdded) { AddObject("EmailAddress", emailAddressTobeAdded); SaveChanges(); } ``` Agai...
2010/07/10
[ "https://Stackoverflow.com/questions/3220890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/388592/" ]
I was looking into implementing something like this a few month ago. Since GWT compiles your code to JavaScript there is no way for you to do that on the client side, JavaScript can't access the file system. So you would need to upload the file to the server first and do the conversion on the server side and send...
253,693
Consider the following code: ``` \documentclass{article} \begin{document} \noindent Can I make \LaTeX{} reduce a fraction automatically?\\[\baselineskip] For example, I would like the fraction \[ \frac{278\,922}{74\,088} \] to be reduced to \[ \frac{6641}{1764} \] \end{document} ``` ![output](https://i.stack.imgu...
2015/07/04
[ "https://tex.stackexchange.com/questions/253693", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/15874/" ]
An [`expl3`](https://ctan.org/pkg/expl3) implementation: ``` \nonstopmode \input expl3-generic \relax \ExplSyntaxOn % -*- expl3 -*- \cs_new:Nn \svend_gcd:nn { \int_compare:nNnTF {#2} = { 0 } {#1} { \svend_gcd:ff {#2} { \int_mod:nn {#1} {#2} } } } \cs_generate_variant:Nn \svend_gcd:nn { ff } \int_new:N ...
34,520
In den letzten Wochen fällt mir immer öfter auf, dass in Sätzen, in denen früher »man braucht« gesagt wurde, seit neuestem »es braucht« verwendet wird. > > früher: »Wenn das so ist, dann braucht *man* keine Regierung mehr. > > heute: »Wenn das so ist, dann braucht *es* keine Regierung mehr. > > > (Soeben in ...
2017/01/25
[ "https://german.stackexchange.com/questions/34520", "https://german.stackexchange.com", "https://german.stackexchange.com/users/1487/" ]
Im geschriebenen Deutsch würde ich immer eher eine Formulierung im Passiv erwarten, die ohne Pronomen auskommt: > > * Wenn das so ist, *wird* keine Regierung mehr *gebraucht*. (*benötigt*) > * *Wird* die EU noch *gebraucht*? (*benötigt*) > * In dieser Region *wird* dringend mehr Regen *gebraucht*. (*benötigt*) > > ...
55,275,032
I am new in PL/SQL for this reason sorry for easy question.I hope you will help me. My goal is add values to table with for loop.If you have a question please replay I will answer as soon as posible. This is my code which do not work. ``` declare cursor c_exam_info is select result1 from exam_info; begin for ...
2019/03/21
[ "https://Stackoverflow.com/questions/55275032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11075976/" ]
I can't view images. Anyway: `INSERT` seems to be inappropriate - wouldn't `UPDATE` be a better choice? Something like this: ``` begin for i IN (select id, result1 from exam_info) loop update exam_info set result_type = case when c_exam_info.result1 > 60 then 'pass' else '...
38,680
I'm trying to find an efficient way to compute maximum of a signal using its DFT. More formally: $$\max\left\{ \mathcal F^{-1}\left(X\_k\right)\right\}, X\_k\text{ is the DFT of the signal and } \mathcal F^{-1} \text{ is the IDFT}$$ The original signal $x(n)$ is real, and it has some noise when sometimes there are wi...
2017/03/27
[ "https://dsp.stackexchange.com/questions/38680", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/25521/" ]
This sounds like a good candidate for the Sparse Fast Fourier Transform (sFFT). Have a look at H. Hassanieh, P. Indyk, D. Katabi, and E. Price, **[sFFT: Sparse Fast Fourier Transform](http://groups.csail.mit.edu/netmit/sFFT/)**, 2012. I don't know details of the algorithm. You have the domains swapped, which should be ...
37,441,689
I am working on a simple app for Android. I am having some trouble using the Firebase database since it uses JSON objects and I am used to relational databases. My data will consists of two users that share a value. In relational databases this would be represented in a table like this: ``` **uname1** **uname2** sh...
2016/05/25
[ "https://Stackoverflow.com/questions/37441689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3973615/" ]
Is there a reason why you don't invert this? How about a collection like: ``` { "_id": 2, "usernames":[ "Bob", "Alice"]} { "_id": 4, "usernames":[ "Bob", "Cece"]} ``` If you need all the values for "Bob", then index on "usernames". EDIT: If you need the two usernames to be a unique key, then do something like this...
21,272,847
I have got a terminal app that gets user input stores it in a string then converts it into a int. The problem is if the user inputs anything that is not a number the conversion fails and the script continues without any indication that the string has not converted. Is there a way to check of the string contains any non...
2014/01/22
[ "https://Stackoverflow.com/questions/21272847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2558108/" ]
You can find out if a read of an `int` has been successful or not by checking the `fail()` bit of your input stream: ``` getline (cin,mystr); //gets user input stringstream priceStream(mystr); priceStream >> price; if (priceStream.fail()) { cerr << "The price you have entered is not a valid number." << endl; } ``...
22,492,338
I am working on a Chrome extension that will add content to a particular set of pages. From my research, it sounds like what I want is a [content script](https://developer.chrome.com/extensions/content_scripts) that will execute for the appropriate pages. I can specify the "appropriate pages" using the `content_script....
2014/03/18
[ "https://Stackoverflow.com/questions/22492338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450668/" ]
By far the best choice is to rename the function parameter so it does not conflict with the global variable, so there is no need for circumventions. Assuming the rename option is not acceptable, use `::foo` to refer to `foo` at the global scope: ``` #include <iostream> int foo = 100; int bar(int foo) { int sum ...
63,547,065
I am setting up a discord game which uses folders as profiles, how do I fix the problem that if someone changes their username the bot can no longer access their profile?
2020/08/23
[ "https://Stackoverflow.com/questions/63547065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14128938/" ]
Use the UserID instead of the Username. This never changes unless they change to a different account, so you won’t have to worry about usernames changing.
31,306,027
I'm working on an FAQ type project using AngularJS. I have a number of questions and answers I need to import into the page and thought it would be a good idea to use a service/directive to load the content in dynamically from JSON. The text strings are quite unwieldily (639+ characters) and the overall hesitation I h...
2015/07/09
[ "https://Stackoverflow.com/questions/31306027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4933483/" ]
I replaced ``` var listeRef = from r in db.refAnomalies select r; ``` with ``` String sql = @"select * from refAnomalie"; List<refAnomalie> listeRefference = new List<refAnomalie>(); var con = new SqlConnection("data source=(LocalDb)\\MSSQLLocalDB;initial catalog=Banque;integra...
29,042,618
The app has a controller, that uses a service to create an instance of video player. The video player triggers events to show progress every few seconds. When the video reaches to a certain point, I want to show a widget on top of the video player. The view has the widget wrapped in ng-show directive. It takes more t...
2015/03/13
[ "https://Stackoverflow.com/questions/29042618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/979535/" ]
Solved it! $scope.$apply() did the trick. My guess is, due to other complex logic ad bindings inside the app, there was a delay in computing the change by angular the default way. @floribon Thanks for the subtle hint about "complex angular stuff". The code inside the service function changed to: ``` function showWi...
19,291,746
I have a string: `{2013/05/01},{2013/05/02},{2013/05/03}` I want to append a { at the beginning and a } at the end. The output should be: `{{2013/05/01},{2013/05/02},{2013/05/03}}` However, in my shell script when I concatenate the curly braces to the beginning and end of the string, the output is as follows: `{20...
2013/10/10
[ "https://Stackoverflow.com/questions/19291746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2844037/" ]
The problem is that when you have a list in braces outside quotes, the shell performs [Brace Expansion](http://www.gnu.org/software/bash/manual/bash.html#Brace-Expansion) (`bash` manual, but [`ksh`](http://www2.research.att.com/sw/download/man/man1/ksh.html) will be similar). Since the 'outside quotes' bit is important...
7,056,634
I'd like to read and write window registry in **window xp and 7** by using **vb6**. I'm not much strong in vb6. I tried this below ``` Dim str As String str = GetSetting("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines", "Text", "ImportMixedTypes") ``` My coding doesn't work. Please point out my missing.
2011/08/14
[ "https://Stackoverflow.com/questions/7056634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/305732/" ]
You can't use `GetSetting` for that setting. That method is only for reading/writing configuration settings for your own application. If you want to read anywhere in the registry you have to use the Windows API function [RegOpenKeyEx](http://msdn.microsoft.com/en-us/library/ms724897%28v=vs.85%29.aspx) and friends. Her...
74,514,734
I want to fit parent div height to fit it's child that means I want height of parent div to fit red color and green part will hide <https://jsfiddle.net/zfpwb54L/> ``` <style> .container { margin-left: auto; margin-right: auto; padding-left: 15px; padding-right: 15px; width: 100%; } .section { padding: ...
2022/11/21
[ "https://Stackoverflow.com/questions/74514734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9779942/" ]
For testing your agent in a custom environment alter the endpoint URL to `https://dialogflow.googleapis.com/v2/projects/my-project-id/agent/environments/<env-name>/users/-/sessions/123456789:detectIntent` curl command: ``` curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "x-go...
20,365
I cannot open a SQLConnection to a SQL vectorwise database and I assume the JDBC driver is the problem. A JAR file was provided to me - the only info additionally provided to me was the java class: **com.ingres.jdbc.IngresDriver** What would I have to do to add it to the JDBCDrivers that Mathematica can use? Hope thi...
2013/02/27
[ "https://mathematica.stackexchange.com/questions/20365", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/5797/" ]
Finally found the answer on how to connect MM to Actian vectorwise via SQL :) ``` Needs["JLink`"] AddToClassPath["C:\\Users\\Desktop\\iijdbc.jar"]; Needs["DatabaseLink`"]; OpenSQLConnection[ JDBC["com.ingres.jdbc.IngresDriver", "jdbc:ingres://HOST:VW7/DATABASE;user=xxx;password=yyy"]] ``` Feeling good! Pat