qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
41,534
I use my Raspbery PI model B for capturing images for a timelapse. I capture an image every 30 seconds (roughly) using the build in `raspistill` command within a simple bash script seen below: ``` #!/bin/bash imagePath="/home/pi/weatherPi-images/" echo "Press [CTRL+C] to stop.." echo "AutoImage process started @ "`d...
2016/01/23
[ "https://raspberrypi.stackexchange.com/questions/41534", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/40352/" ]
The OOM killer prints a table summarizing its evaluation when it decides it must kill a process. Generally the biggest one goes. That table is at line 244 in your paste from comments, it begins: ``` Jan 23 16:16:10 horizon kernel: [3070531.743375] [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_scor...
Same issue with a Pi Zero while trying to set up LED lights using Hyperion. Had an issue where the Pi would shut off and my capture card I was using would also shut off and fail to be recognized. I ran a test and my CPU was just getting hammered from something that shouldn't take too much of it. Entered the code above ...
42,994,378
I have this array ``` Array ( [0] => stdClass Object ( [TransactionNo] => OPM-EC-K-LFMCD2-21.4 [StokOpnameTransNo] => OPM-EC-K-LFMCD2-21 [ItemCode] => BBG150400005 [ItemName] => BIG BAG [OriginalPrice] => 289900.00 [Price] => 289900...
2017/03/24
[ "https://Stackoverflow.com/questions/42994378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6354277/" ]
First I working for improving my English. Second: I have a solution for this issue, try this I hope some help. Idea -> I try to compare Item code from array return by SQL (You mutch sort **Itemcode** by asc order. then try thís code php Code ``` <?php class Item{ protected $data; public function _const...
You could use ``` <?php $x=0; foreach ($datadetail as $data) { $x++; $value= $data->QtyBeginning + $data->QtyIn + $data->QtyOut; ?> <tr> <td><?=$x;?></td> <td><?=$data->ItemCode;?></td> <td><?...
19,958,566
I have the below that I am trying to replicate this mock-up --> ![DoorPanelImage](https://i.stack.imgur.com/vD0w8.jpg) I am stuck on how to make my elements display horizontally? Would I need to make a list or another "table"? Was able to accomplish it using `style` but it seems like I shouldn't need to. Here's what ...
2013/11/13
[ "https://Stackoverflow.com/questions/19958566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46724/" ]
Not sure this is exactly what you are looking for, but I'd work at having a single row and getting my panels to just iterate inside the row. Something like this: ``` <div class="row"> <div class="col-2 col-sm-5 col-md-3 col-lg-2 panel panel-primary"> <div class="panel-heading"> <span class="badge">01</sp...
the col-lg- should be in total 12 for every row you can find this and many other informations at the docu: <http://getbootstrap.com/2.3.2/scaffolding.html> besides this you can also realize something like this without bootstrap by few css lines: ``` width:20% height:250px; display:block; float:left; ```
17,244
More than two years after <http://meta.math.stackexchange.com/q/4569/>, this may be the time for reconsideration. A brief update: 1. In July 2012, when the aforementioned discussion took place, the site received $11000$ questions. In October 2014, the number was $41000$. ([Source](http://data.stackexchange.com/math/q...
2014/11/07
[ "https://math.meta.stackexchange.com/questions/17244", "https://math.meta.stackexchange.com", "https://math.meta.stackexchange.com/users/-1/" ]
It's... uh... been a while since this request was made. We require a few things before turning a switch like this - it's pretty harmful to small sites to have what is a large chunk of potential askers to be blocked. But... Maths isn't a small site, and it hasn't been one for a loooong time. So when this request was fir...
Yes, I agree with you that atleast email verification should be a must. Another important disadvantage is that it helps people build their own reputation. I've often noticed questions asked anonymously and then answered by registered accounts to earn reputation. I tried it myself and earned 236 reputation from just 4 s...
212,054
For this year's April Fools, Google has a Pac-Man option on GoogleMaps. However, it cryptically references clues in which you can play the Pac-Man maps on, as apparently not all cities are supported. There's a list of clues i[t has on its FAQ page](https://support.google.com/maps/answer/6178227?hl=en), but I don't un...
2015/03/31
[ "https://gaming.stackexchange.com/questions/212054", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
On the desktop version, you can go anywhere with enough roads for Pac-Man to move around (I did it around my house), but on the app it's limited to the places previously mentioned by Thebluefish.
12 (radiating streets) also works for DC, which was my first guess. :P ======================================================================
4,563
In my custom component, I need to enter date and time. Joomla's standard calendar-element supports a date picker - but no time picker. Can anyone help me and point me to an alternative date and time picker?
2014/09/24
[ "https://joomla.stackexchange.com/questions/4563", "https://joomla.stackexchange.com", "https://joomla.stackexchange.com/users/371/" ]
The only downside to @johanpw's solution is by using #datetimepicker2 that means this field type can only be used once. Good solution otherwise! Instead try the following in your /modules/mod\_yourmodule/fields/datetime.php ``` $id = str_replace('jform[','',str_replace(']','',$this->name)); return '<div id="datetime...
JHTML::\_( 'behavior.modal' ); echo JHTML::calendar('2015-04-03','name','id','%d.%m.%Y %H:%I');
39,066,298
My file structure is: ``` dist css style.css index.html js bundle.js src css style.css index.html js main.js node_modules webpack.config.js package.json ``` My webpack.config.js looks like: ``` module.exports = { entry: './src/js/main.js', output: { path: __dirname, ...
2016/08/21
[ "https://Stackoverflow.com/questions/39066298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1515187/" ]
**100% Working Solution** You have to just follow 3 steps and you will get your hot reloading as you expected 1. Include "publicPath" key in "Output" property of webpack config. "publicPath" should contain path to your bundle.js file so that dev-server will know if there is any change in your bundle.js file and it wi...
Try this: In your `package.json` file, delete the line that contains `"test" "echo \"Error: no test specified\" && exit 1"` under the scripts object, and replace it with: ``` ... "scripts": { "start": "webpack-dev-server --hot" }, ... ``` Then to restart your project, just use `npm start`. This worked for ...
59,374,786
I am following [Transfer data with the Data Movement library](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-data-movement-library) to upload a video (mp4) from my local machine to Azure Blob Storage. Here the code. ``` using System; using System.Threading; using System.Threading.Tasks; using Syst...
2019/12/17
[ "https://Stackoverflow.com/questions/59374786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2922388/" ]
You can add seconds like this: ``` echo $newTime = date('H:i:s', strtotime("$eta + $newseconds seconds")); ``` output: ``` 14:12:06 ``` Try it [here](http://sandbox.onlinephpfunctions.com/code/7307992f0f0b20e150160df7ca224f43b9c7f0e1). As you see, you can enclose the whole calculation between `" "`, so it's more...
Why not using PHP 's own `DateTime` class? ``` $seconds = 6; $time = '14:12:00'; echo DateTime::createFromFormat('H:i:s', $time) ->modify('+' . $seconds . 'seconds') ->format('H:i:s'); ``` Using the `DateTime` class enabled method chaining and you can use all methods this object includes. Read more in the ...
2,859,005
I have a large data-set of emails sent and status-codes. ``` ID Recipient Date Status 1 someone@example.com 01/01/2010 1 2 someone@example.com 02/01/2010 1 3 them@example.com 01/01/2010 1 4 them@example.com 02/01/2010 2 5 them@example.com 03/01/2010 1 6 others@ex...
2010/05/18
[ "https://Stackoverflow.com/questions/2859005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/138033/" ]
You cannot easily do this is a single query because count(\*) is a group function whereas the latest status comes from a specific row. Here is the query to get the latest status for each user: ``` SELECT M.Recipient, M.Status FROM Messages M WHERE M.Date = (SELECT MAX(SUB.Date) FROM MESSAGES SUB WHERE SUB.Recipien...
You can use the ranking functions for this. Something like (not tested): ``` WITH MyResults AS ( SELECT Recipient, Status, ROW_NUMBER() OVER( Recipient ORDER BY ( [date] DESC ) ) AS [row_number] FROM Messages ) SELECT MyResults.Recipient, MyCounts.EmailCount, MyResults.Status FROM ( SELECT Recipient, Coun...
33,122,216
We've configured Apache to redirect to an instance of tomcat through a diferent port of the AJP default 8009 . It only works for the default port but it's not working with the one we set (8109) on the worker.properties This is our scenario **worker.properties on /etc/apache2** ``` worker.list=sacmimexico # Set proper...
2015/10/14
[ "https://Stackoverflow.com/questions/33122216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5444447/" ]
In this particular case, this is your shortest method ``` <input type="button" value="1" onclick="pressNumber(1)"> <input type="button" value="2" onclick="pressNumber(2)"> function pressNumber(number) { document.getElementById("calc-output").innerHTML = number; } ``` The problem in your original code was that...
Note that onclick events always come with a link to the div that triggered the event. You should make use of that to capture which button was clicked. e in below function will refer to the clickevent. e.target will refer to the div, e.target.id will refer to the id of said div. ``` function buttonClicked(e){ cons...
31,415,844
Python allows dictionaries to be compared with `==` ``` import copy child = {'name': 'child'} parent_1 = {'name': 'parent', 'child': child} parent_2 = copy.deepcopy(parent_1) print(parent_1 == parent_2) ``` Prints `True`, as you would expect it to. Python also allows dictionaries to reference each other circularly...
2015/07/14
[ "https://Stackoverflow.com/questions/31415844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2859614/" ]
You need to write your own comparison procedure that takes four arguments, two things to compare, and two stacks of dictionaries/lists (one for each thing being compared). If either thing being compared is contained in the corresponding stack, return true if they are both in their own stack in the same position, and f...
``` import copy child = {'name': 'child'} parent_1 = {'name': 'parent', 'child': child} child['parent'] = parent_1 # Create the circular reference parent_2 = copy.copy(parent_1) print(parent_1 == parent_2) ``` If you use `copy.copy` instead of `copy.deepcopy`, it runs without an error. > > The difference between...
12,529,489
I created a new project and working with eclipse (used `eclipsify` command). basically, I moved the `app` directory from an old project to the new one I created. the problem is that eclipse doesn't recognize the views. I get errors like: > > views.html.viewTopic cannot be resolved to a type > > > I tried to...
2012/09/21
[ "https://Stackoverflow.com/questions/12529489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1000971/" ]
According to jetbrains, the issue with templates is fixed. If you have play 2 generated source sources included in the IDEA project then you should exclude this folder from the project <http://www.jetbrains.com/idea/webhelp/configuring-folders-within-a-content-root.html> and do File | Invalidate caches and restart. ...
OK, I solved it. * I created a new app again * moved `app` dir * **only then** ran the command `play idea`
1,910,881
What is the height of a regular PDF page in pixels? I heard it was something like this: ``` Dim pgSize As New iTextSharp.text.Rectangle(595, 792) ``` but I am adding an image that takes up maybe half the height, and even though pgSize looks like a full page and the image takes up only half of it, I am getting a hei...
2009/12/15
[ "https://Stackoverflow.com/questions/1910881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117700/" ]
Your page size depends on what you set it when you create the document, probably using the PageSize object (eg. PageSize.LETTER). Once you've established that, most elements in iTextSharp use points and 1 in = 2.54 cm = 72 points. So if you used a standard letter page (8.5x11) it would be 612 by 792. I'm not sure I ...
``` Dim xDoc as new Document(PageSize.A4) ```
57,434,481
I am quite new to SQL. I couldn't find solution and I want your expertise here. I have one table "boxes" and contains the color and type and condition. I want to get the number of types per color WHERE Condition = 'NEW'. Thanks in advance :) My tale looks like that: ``` Boxes COLOR TYPE CONDITION ...
2019/08/09
[ "https://Stackoverflow.com/questions/57434481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7272307/" ]
You need a [`SELECT...INTO`](https://learn.microsoft.com/en-us/sql/t-sql/queries/select-into-clause-transact-sql?view=sql-server-2017) statement if `ColorPerType` does not exist: ``` select color, sum(case when condition = 'new' then 1 else 0 end) as NumberOfTypes into ColorPerType from boxes group by color ``...
That depends, when you say you need a new table, do you want this table to update when new data goes in the original table? If so, you need a view not a table. `CREATE VIEW ColourPerType AS SELECT b.Color, COUNT(b.Type) FROM Boxes b WHERE b.Condition = 'NEW' GROUP BY b.Color`
64,036,650
This C# code is tested as working, but looks inefficient to me. How can I avoid all of the overhead in each `foreach` interation for say a 1,000 rows? ``` SqlConnection con = new SqlConnection(strConn); // strConn is set elsewhere in the code string strSQL = "select pkCustomer from Customer where YearEndDeactivateInd...
2020/09/23
[ "https://Stackoverflow.com/questions/64036650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4056146/" ]
`size_t` is an unsigned integral. This means that `i` can never be negative. When `i` is equal to `0`, and you subtract `1`, it will become a very large number, not `-1`. The condition `i >=0` basically says keep running this loop until `i` is less than zero. Because of the type of `i`, this condition is never met. T...
Many compilers will warn you if a comparison is always trivially true (or false). In this case, an unsigned type like `size_t` can never hold a sub-zero value. Of course, you must profess interest in getting warned, paying heed is optional. For demonstration purposes, see [the following program compiled on coliru ...
2,166,690
PostgreSQL has a useful function called `GREATEST`. It returns the largest value of those passed to it as documented [here](http://www.postgresql.org/docs/8.4/interactive/functions-conditional.html). Is there any equivalent in SQLite? *As a note, I only need it to work with 2 arguments.*
2010/01/30
[ "https://Stackoverflow.com/questions/2166690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37181/" ]
`SELECT MAX(1,2,..)` ref: <https://sqlite.org/lang_corefunc.html#maxoreunc> > > **`max(X,Y,...)`** > > > The multi-argument max() function returns the argument with the maximum value, or return NULL if any argument is NULL. The multi-argument max() function searches its arguments from left to right for an argument...
using a second value in `MAX(value1, value2)` would be the equivalent Example: ``` UPDATE products SET Quantity = MAX(Quantity - @value, 0)... ``` if (`Quantity - value`) return a **"Negative Number `-0`"** then **`Max( , 0)`** will return **0** because 0 is bigger than -0 / -1 / -2 ... and so on **`Max(...
52,113,568
I've the following Dataframe: ``` a b c d e 0 NaN 2.0 NaN 4.0 5.0 1 NaN 2.0 3.0 NaN 5.0 2 1.0 NaN 3.0 4.0 NaN 3 1.0 2.0 NaN 4.0 NaN 4 NaN 2.0 NaN 4.0 5.0 ``` What I try to to is to generate a new Dataframe without the NaN values. There are always the same number of NaN Value...
2018/08/31
[ "https://Stackoverflow.com/questions/52113568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10205233/" ]
Using array indexing: ``` pd.DataFrame(df.values[df.notnull().values].reshape(df.shape[0],3), columns=list('xyz'),dtype=int) x y z 0 2 4 5 1 2 3 5 2 1 3 4 3 1 2 4 4 2 4 5 ``` --- If the `dataframe` has more inconsistance values across rows like 1st row with 4 valu...
You can use panda's method for dataframe [`df.fillna()`](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.fillna.html?highlight=fillna#pandas.DataFrame.fillna) This method is used for converting the NaN or NA to your given parameter. > > df.fillna(param to replace Nan) > > > ``` import numpy as np i...
6,983,170
I'm aware users may turn support for Javascript on/off in their browsers. But, does anyone know if some corporations have the practice of locking down systems such that the user no longer has the ability to turn Javascript on/off? I'm considering building an enterprise web application that depends on Javascript script...
2011/08/08
[ "https://Stackoverflow.com/questions/6983170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/431080/" ]
My understanding is that some companies use a proxy which actually removes javascript from the HTML for the page. That means that even if javascript is on, it won't be executed, because the browser never sees it. The safe bet is to presume that JS may not be available, and code expecting that.
I think the vast majority desktop users in a company will have access to Javascript (or at least the option to enable/disable it). I can't think of a reason why this would not be the case. However it might be disabled on remote servers which are used by a large number of users for the sake of security. Some of these m...
57,316,618
I want to enable Authentication/Authorization on a web app for all pages but one. I have a metadata page that I want to remain public while the rest of the app requires authentication. Based on many other [stackoverflow](https://stackoverflow.com/questions/55920079/allowing-public-access-to-only-1-endpoint-of-azure-ap...
2019/08/01
[ "https://Stackoverflow.com/questions/57316618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11870335/" ]
As the [posts](https://stackoverflow.com/questions/55920079/allowing-public-access-to-only-1-endpoint-of-azure-application/57313377#57313377) you provided, set `authorization.json` under `wwwroot` and set webapp `Action to take when request is not authenticated` as `Allow Anonymous requests (no action)` then **restart ...
I'm not sure why, but EasyAuth just would not work with my app. I tried rearranging file and URL structures, placing authorization.json at different places in the file tree... nothing worked. I eventually started looking for other solutions. What I landed on was OpenID Connect v2 using the Microsoft Identity platfor...
67,462
If I'm using an image of [Pocahontas](https://en.wikipedia.org/wiki/Pocahontas) for commercial purposes, how do I go about figuring out what license I need to purchase? She is a historic figure, but with much fictional rendering. I could use her historic image or a fictional render. How does that work?
2016/02/23
[ "https://graphicdesign.stackexchange.com/questions/67462", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/61126/" ]
1. Pick your Pantone colours. *It's important to pick these in a light that you will view them in typically. If your designs will be viewed outside, see what they look like in daylight (if you can, at different times of the day as the light will change and time permitting on a cloudy / sunny / rainy day).* 2. Once you ...
I don't think it matters which order you pick your colors in since they're all used differently. The point of Pantone is that you get the exact color you pick every time it's printed anywhere. CMYK can vary from printer to printer and RGB can vary from display to display. Also, you can't just pick a Pantone color in ...
55,721,841
i am using this function to generate random number between 1000 and 100. but here according to me, in (max - min) + min, max- min =900 and min= 100, so it should not generate numbers between 900 and 100? but it is returning numbers greater than 900 also how? I am confused. and do tell how to check the range for the num...
2019/04/17
[ "https://Stackoverflow.com/questions/55721841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9711911/" ]
The function Math.random() returns a number between 0 and 1. When use "Math.random() \* (1000 - 100)", this part of the code generates a number between 0 and 1 then multiplies it by 900, which will give you a number between 0 and 900. Now in the last block you do add 100 to the previously generated number which resul...
**Multiply by (1000 -200) instead as you already have +100** Because in case random number generated is anything greater than `800` you end exceeding range as you're adding `100` in it everytime ```js x = Math.floor(Math.random() * (1000 - 200) + 100); console.log(x); ``` **Thumb rule :-** ``` Math.floor(Math.ra...
13,359,710
I've been working with `libgdx` for 2 days, and I'm starting to get the hang of it. I'm comfortable with deployment on Android and desktop, but I've got no clue about how to run/debug or deploy the `HTML5` version. When I run as web application, the link gives me an `http error 404`. I did what they say on the...
2012/11/13
[ "https://Stackoverflow.com/questions/13359710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1781393/" ]
I ran into this problem for over an hour before realizing that when I selected "run as web application" and eclipse asked me to point to the war directory, I was silly enough to have been selecting the root directory of the project. Once I went back and pointed to the actual war folder, it ran without issue. Silly I ...
It's a bit difficult to deploy the app correctly. In the wiki of Libgdx (in google code) you can find in one of the first entries how to deploy and debug the app. The easiest way is to install and configure a Tomcat server, do the steps of the wiki and that's all. If you don't want deploy the app, only test it, you can...
36,502,439
I have a bit of a unique problem to solve and I'm stuck. I need to design a program that does the following: 1. Inputs two series of numbers (integers) from the user. 2. Creates two lists based on each series. 3. The length of each list must be determined by the value of the first digit of each series. 4. The rest of...
2016/04/08
[ "https://Stackoverflow.com/questions/36502439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5597574/" ]
For those have issues with error message: Learn to configure HTTP settings, below is the solution that worked for me. Am using Android studio 2.3.3: Go to <http://developer.android.com/studio/intro/studio-config.html> Step 1: Follow the instructions on: Set up Android studio proxy. Step 2: Follow the instructions on ...
I faced the same issue. Make sure that you have made an entry in path in environment variable for gradle ``` C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin ``` After disable offline mode and setting the path in environment variables, the issue was fixed and Gradle was build cleanly.
465,586
> > **Possible Duplicate:** > > [Hundreds of failed ssh logins](https://serverfault.com/questions/17870/hundreds-of-failed-ssh-logins) > > > Recently I have been spending more time on my production servers in efforts to puppetize several configs and I happened to issue a `find /var/log -mmin1` and it returned ...
2013/01/09
[ "https://serverfault.com/questions/465586", "https://serverfault.com", "https://serverfault.com/users/87836/" ]
The strongest reason to not go with a single domain (and forest) is if you absolutely have to have separate admins in each forest. That's the security boundary. If the same folks are going to have the full set of keys, then make it easy on them. To be clear, I'm not talking about delegation for certain tasks - this is ...
Personally, if this is a centralisation project, I would use one domain and use OUs to separate things. This saves having to have full redundancy for each child domain, makes roaming and movement easier and cuts down massively on configuration and complexity. There are almost no downsides if you configure sites and se...
27,777,759
Unable to convert a JPEG image into a 300 DPI PNG image using ImageMagick. After conversion the PNG image is 72 DPI only. I'm using ImageMagick 6.9.0-0 Q16 x86 and Ghostscript v9.15. Below is the line I use in my Perl script: ``` system("\"$imagemagick\" -set units PixelsPerInch -density 300 \"$jpg\" \"$png\""); ...
2015/01/05
[ "https://Stackoverflow.com/questions/27777759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3099825/" ]
Adjusting the units & density will not alter the underlining image data, but updates meta info for rendering libraries. Important for vector to raster, but not very useful for raster to raster. To adjust the DPI of an image, use the [-resample](http://www.imagemagick.org/script/command-line-options.php#resample) operat...
I'm wondering where the 72dpi is coming from. Assuming you are using X and some kind of Unix, ImageMagick defaults to using the screen resolution (72 dpi). I'm not sure what it does under OSX/XQuartz but it's likely similar. Is your screen resolution set to 72dpi (!?). I'm with @emcconville @ikegami - just do this str...
12,026
<http://blog.ine.com/2008/07/14/private-vlans-revisited/> Has anyone tried private vlan's under Linux? Any experiences with them? My real question is does anybody have howtos regarding this?
2011/04/26
[ "https://unix.stackexchange.com/questions/12026", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/6960/" ]
I don't know if Linux supports Cisco's concept of "private VLANs" per se, but what private VLANs essentially are is a link-layer firewall controlling which switch ports can talk to which other switch ports. So if you've got a Linux box with several Ethernet devices and are bridging between them (e.g. with the `brctl` t...
I don't know what you mean by "private" VLAN's, but Linux does VLANs. The `ip` command from iproute2 can configure them. You do have to have a NIC and driver that supports it, but most do these days.
6,907,074
must create a rule that captures the first preg\_replace bar url: `http://localhost/item/other` must take the rule just 'item' regardless of what comes after
2011/08/02
[ "https://Stackoverflow.com/questions/6907074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/769082/" ]
You should use the php [parse\_url()](http://php.net/manual/en/function.parse-url.php) function An example would be: ``` $parts = parse_url("http://localhost/item/other"); $path_parts= explode('/', $parts[path]); $item = $path_parts[1]; echo $item; ```
It does not look like you have a specific question. I am assuming you are about write some routes script. ``` $request_uri = explode('/', $_SERVER['REQUEST_URI']); $delimiter = array_shift($request_uri); $controller = array_shift($request_uri); $action = array_shift($request_uri); if(preg_match('/i...
22,718,922
I was watching the [presentation](http://www.youtube.com/watch?v=3q8xYFDYLeI) : " Why Do Monads Matter? " I simplified one code [example](https://github.com/londonhaskell/londonhaskell-2012-10-24-why-do-monads-matter/blob/master/Pref.hs) which compiles and runs (please see below) but I still don't understand how it wo...
2014/03/28
[ "https://Stackoverflow.com/questions/22718922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1198559/" ]
If you expand the type of the last `Ize` in your function you get: ``` composePref :: Ize -> Ize -> (String -> Integer -> String) composePref f g x = \c -> let y = (g x) c in (f y) c ``` which is the same as ``` composePref :: Ize -> Ize -> String -> Integer -> String ``` which i...
You could use the following alternative definition, if this makes things clearer ``` composePref :: Ize -> Ize -> Ize composePref f g = \x -> \c -> let y = (g x) c in (f y) c ```
37,068,834
I am posting JSON Array to a webservice but i am unable to solve it. In the below code "str" is the JSONArray converted to string. JSONArray consists of JSONObjects and each JSONObject consists of 3 paramaters (ID,Question,Answer). ``` ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); ...
2016/05/06
[ "https://Stackoverflow.com/questions/37068834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5416975/" ]
You can simply add the numbers via the constructor of the `new List<int>` ``` var itemsToAddInMetadata = new List<int> { 22, 33, 65 }; userUpdateRequest.AppMetadata = new Dictionary<string, dynamic> { { "toysNumber", new List<int>(itemsToAddInMetadata) { 2, 3, 9, 7 } } }; ```
Try something like that: ``` userUpdateRequest.AppMetadata["toysNumber"].AddRange(new[] {22, 33, 65, ...}) ```
40,797,533
I'm going straight to the point here. I want to create a simple window within an image. outside the window will have a opacity like on the sample picture. I'm not really good when it comes to css so please bear with me. ```css .section2{ } .section2 .row{ margin: 0; } .the-container{ position: relative; w...
2016/11/25
[ "https://Stackoverflow.com/questions/40797533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3113490/" ]
Try to print the array in the console when you get undefined and check your array size in the log. ``` for (var g = 0; g < pastWinners.length; g++) { for (var i = 0, j = pastWinners.length; i < j; i++) { if (obj[pastWinners[g][i]] == undefined){ console.log(`row ${g}, col ${i}`); console....
Also you should check for the existence of `pastWinners[g]` before you loop through it or try to access a child array using `if (pastWinners[g] != null) {` The reason for this is that if `pastWinners[g]` for some reason is not defined, then your script will attempt to do this: `undefined[i]` or get the value of [i] ...
158,637
Our communication department recently asked us (the security team) a question. They send out a lot of mail, especially mails like 'your password is set to expire' are hot topics here. The question was: Should we write out the links? We have 'domain.com/passwordreset'. Should we add 'www'? Should we add 'https'? Should ...
2017/05/03
[ "https://security.stackexchange.com/questions/158637", "https://security.stackexchange.com", "https://security.stackexchange.com/users/136167/" ]
A policy I've seen used by some banks and government agencies in the Netherlands is never to include any links in mails, but just to refer to "our website" or "our webportal". The main idea here is that they're explicitly telling customers never to click on any links in emails (supposedly) coming from them. This way ...
The most important thing is to make sure that people actually change their passwords, so making it as easy as possible to click on a link and remember it afterwards is important. First, you should definitely make it an https link, you should never point people down an insecure connection to change a password. As for ...
4,317
I'm deleting my academia stackexchange account so I don't really care if this my last question will be marked as duplicate or off-topic. The reason why I'm asking this question is that I feel the academia stackexhange community right now heavily focused on hierarchy of this forum such as preventing duplicate, off-topic...
2018/09/16
[ "https://academia.meta.stackexchange.com/questions/4317", "https://academia.meta.stackexchange.com", "https://academia.meta.stackexchange.com/users/-1/" ]
The goal of Academia.SE (similar to the other stack exchange sites) is to develop a useful Q&A that *applies to a broader audience than the individuals asking questions*. This is why we close questions that are too specific to a single individual, or mark as duplicates questions that have already been answered. These ...
I'm sorry you feel that way, and thank you for taking the time to post your experience. Looking over your posts, I'm not sure I understand why you feel that way... your [last question](https://academia.stackexchange.com/questions/116888/should-i-withdraw-my-paper-from-a-journal-which-even-didnt-give-me-the-manuscri) (>...
49,615,788
I don't know data structure of array in MATLAB. Does it use a FiFo? I try to delete the last element from a column and row vector. The time complexity depends on size **`N`**. How to delete last element in **`O(1)`**? Seminally **`pop()`**.
2018/04/02
[ "https://Stackoverflow.com/questions/49615788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9587261/" ]
**DISCLAIMER: This is not a real suggestion, it is merely a stupid way to actually obtain an O(1) run-time** Right, with the disclaimer given, it is actually possible to make an O(1) pop command in "Matlab". The solution is to not do it in Matlab, but in Python. Confused? Basically, you convert the vector to a Pytho...
Depends on array length, use `tic <_code_under_test_> toc`, to measure the time ``` A = ones(1,50); B = ones(1,10); tic A(1) = []; toc tic A(49) = []; toc tic B(1) = []; toc tic B(9) = []; toc Elapsed time is 0.000195 seconds. Elapsed time is 0.000085 seconds. Elapsed time is 0.000061 seconds. Elapsed time is 0.0000...
30,095
other Facts: Window(s) size 3.5 feet\* 5 feet (width) Fan (2 nos.) Specifications [Product page - specifications](http://www.ushainternational.com/Products/fans/#!/subcat27/prodid169) Sweep size: 400 MM RPM: 1280 Air Delivery: 75 CMM (What is the formula to convert CMM to CFM?) Volume of the premise : 7200 Cubi...
2013/07/28
[ "https://diy.stackexchange.com/questions/30095", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/13661/" ]
While this doesn't directly answer your question, maybe you should consider a true [window fan](http://www.homedepot.com/p/Lasko-8-in-Electrically-Reversible-Twin-Window-Fan-with-Thermostat-2138/203067772#.UfUmtY2KK8A) such as this one ![window fan](https://i.stack.imgur.com/nyCew.jpg) It delivers **740 CFM**, has a ...
I think CFM is overrated. I use six Lasku U15700 blower style fans I bought from Sam's club several years ago when they were $40 each. They are rated at 438 CFMs when on high and can really move air around my home when I have them set up to draw air in from outside and give that air a place to go outside from inside on...
94,737
In my native language, the stuff is called "aluminium foil". In English, I always heard people use the phrase "tin foil" for that. I adopted that phrase thinking that despite the foil being made of aluminium (and not tin as it used to be) this is what people call it. Recently a native American English speaking person...
2016/06/25
[ "https://ell.stackexchange.com/questions/94737", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/36942/" ]
Several commenters have wondered if the commonality of "tin foil" in the ngrams in other answers is affected by the phrase "tin foil hat" specifically. According to the ngram below, I would say not--as "tin foil hat" is quite a flat line compared to the others. ![](https://books.google.com/ngrams/chart?content=tin+foi...
I've studied dialects and accents in both the US and Ireland. I'm a linguistic Anthropologist. Without being complicated I can say the majority of people in the Northeastern part of the US say either tin foil or aluminum foil interchangebly. People in Ireland say "aluminium" except for younger people in and around affl...
9,524,640
Lets say I have the following: ``` class MyClass { // ... } void doSomething (MyClass instance) { // Is instance passed by reference or by value (copied)? } void main () { MyClass instance = MyClass(); doSomething(instance); } ``` In `doSomething()` is `instance` passed by reference? Or is the cla...
2012/03/01
[ "https://Stackoverflow.com/questions/9524640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/126280/" ]
This is passed by value ``` void doSomething (MyClass instance) ``` This is passed by reference ``` void doSomething (MyClass& instance) ``` This is passed by const reference ``` void doSomething (const MyClass& instance) ``` Also `MyClass` doesn't need to by constructed by assignment. So: ``` MyClass mc=MyCl...
Yes, it is copied. When you call `doSomething`, the `MyClass` copy constructor is called, to create a new instance. This instance will remain in scope for the duration of the `doSomething` function. When the function ends, the `MyClass` destructor will be invoked for this instance. (Note that if you haven't written ...
27,353,122
I have a link like this: <http://domain.com/page.php?product=brown+rice> And then in the page.php page I GET the product: ``` $product = $_GET['product']; <?php echo $product; ?> ``` But it only prints : brown rice without the `+` How to get the + in the get method?
2014/12/08
[ "https://Stackoverflow.com/questions/27353122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4238328/" ]
**Please refer the below url, it is already answerd in stackoverflow,** [PHP - Plus sign with GET query](https://stackoverflow.com/questions/2671840/php-plus-sign-with-get-query) If you'll read the entirety of that bug report you'll see a reference to [RFC 2396](http://www.ietf.org/rfc/rfc2396.txt). Which states that...
Just write <http://example.com/page.php?product=brown%2Brice> **%2B** changes to plus, because **B2** (hex) is a '+' in **ASCII** table
3,928,597
I've run into this issue before, but I can't remember how to solve it. I have created a bare bones (can't get any simpler) controller, and am just trying to echo something to the browser, and I am getting this message: ``` Fatal error: Uncaught exception 'Zend_Session_Exception' with message 'Session must be started b...
2010/10/13
[ "https://Stackoverflow.com/questions/3928597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48523/" ]
What the error sounds like it is saying is that you are not starting the Zend\_Session before data is being sent to the browser. Typically I have something like I pasted below in my bootstrap to start the Zend\_Session. ``` protected function _initSessions() { Zend_Session::start(); } ``` That should get you goi...
Possible the session is started through your application.ini or php.ini (session autostart) ? If you use an ide try to search for "spaces". Sometimes searching for " " (with spaces) helps.
3,595,884
Consider a website build using python and django. In many cases it uses 3rd party modules beside standard python library - such as pytz, South, timezones or debug toolbar. What is standard or just convenient way to deploy such application to production hosting with all the prerequisites (timezones, etc) installed auto...
2010/08/29
[ "https://Stackoverflow.com/questions/3595884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327827/" ]
Fabric is definitely a nice way to accomplish this. There is a fairly extensive blog write up on the process at <http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/>. The key to fabric is "fabfile.py" - there's an example of one that does a deployment at <http://bi...
There are at least two options available. Jacob Kaplan-Moss, one of the co founders of Django has [written](http://jacobian.org/writing/django-apps-with-buildout/) about packaging an application using [`buildout`](http://buildout.org/) and [`djangorecipe`](http://pypi.python.org/pypi/djangorecipe). There is also the ve...
2,592,700
How do I prevent SQL injection when it comes to ColdFusion? I'm quite new to the language/framework. Here is my example query. ``` <cfquery name="rsRecord" datasource="DataSource"> SELECT * FROM Table WHERE id = #url.id# </cfquery> ``` I see passing in `url.id` as a risk.
2010/04/07
[ "https://Stackoverflow.com/questions/2592700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23528/" ]
Use a `<cfqueryparam>` tag for your id: <http://www.adobe.com/livedocs/coldfusion/6.1/htmldocs/tags-b20.htm> ``` <cfquery name="rsRecord" datasource="DataSource"> SELECT * FROM Table WHERE id = <cfqueryparam value = "#url.id#" CFSQLType = "CF_SQL_INTEGER"> </cfquery> ```
* use a parameterized stored procedure * cfqueryparam * error handling around individual query * error handling for site via `<cferror>` * logic that limits the number of request that come from a specific IP in a given time * ensure the database user account only has access to the specific actions it should
49,319,383
$ Flutter doctor terminal command not working on ubuntu, giving error message "curl: (35) gnutls\_handshake() failed: Error in the pull function. "
2018/03/16
[ "https://Stackoverflow.com/questions/49319383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1039274/" ]
I'm using Ubuntu 18.04 LTS. Assuming you have successfully downloaded and extracted [flutter\_linux\_v0.5.1-beta.tar.xz](https://storage.googleapis.com/flutter_infra/releases/beta/linux/flutter_linux_v0.5.1-beta.tar.xz) (latest update until now) onto your preferred directory. ``` export PATH=`pwd`/flutter/bin:$PATH `...
This is not Flutter nor "flutter doctor" specific, it's to do with curl. Googling this error seems to bring up results that are either related to; * Virtualbox * Networking * Some combination of the above two
7,434
Its there any API for all Drugs existed if yes can you explain when can I find IT.
2016/03/31
[ "https://opendata.stackexchange.com/questions/7434", "https://opendata.stackexchange.com", "https://opendata.stackexchange.com/users/9516/" ]
One effective currency conversion API for me is [money.js](http://openexchangerates.github.io/money.js/) Features: 165+ Currencies, updated often, infinite free requests. You simply give it the currencies you wish to convert, and off you go! It's really simple & easy to use. For example: ``` fx.convert(1, {from: 'GB...
I created a Free Currency Exchange API, Some of it's features are * Free & Blazing Fast response * No Rate limits * 150+ Currencies, Including Common Cryptocurrencies * It's Daily Updated The API is user friendly, to get the currency list with EUR as base currency use this URL: <https://cdn.jsdelivr.net/gh/fawazahme...
30,050,675
I'm an angular beginner and it does not seem to respond to me. I'm trying to to a simple ng-click to add and subtract to a counter. I get his error: ``` Error: [ng:areq] http://errors.angularjs.org/1.3.15/ng/areq?p0=FirstController&p1=not%20a%20function%2C%20got%20undefined... ``` this is index.html: controller.js...
2015/05/05
[ "https://Stackoverflow.com/questions/30050675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048664/" ]
I think you forgot to specify what app you use , try the following code : ``` <html ng-app="app"> ```
``` 1. modify html file Here is solution for your problem.Add following line inside your html code <html ng-app='app'> inside <head> tag add script : <script src="app.js"></script> 2. modify controller.js app.controller('FirstController',function($scope){}); Error occured because you added extra space be...
5,046,691
Can structs have the same name as a class? Am I allowed to pass around structs into functions? Structs are a light-weight class? Basically without the functions. It's a container that holds vars. I'm just wondering if I made a function, can I pass in a struct like normally passing in any other object?
2011/02/18
[ "https://Stackoverflow.com/questions/5046691", "https://Stackoverflow.com", "https://Stackoverflow.com/users/438339/" ]
In C++, `struct` and `class` are effectively identical. The only difference is that members of a `struct` are `public` by default, and members of a `class` are `private` by default. You can use them exactly the same way as you use classes. They do need unique names (within the same namespace), so you can't have the st...
No. Names are unique identifiers. You can't name an int with the same name as a char, can you? (answer is No) Yes. Structs can have functions and you can pass them to functions, just like any other variable.
146,652
I'd like to make my screensaver look just like an unlocked desktop. The idea would be to take a screenshot just before activating the screensaver, and use that screenshot in the screensaver. Has anyone done this before?
2014/09/23
[ "https://apple.stackexchange.com/questions/146652", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/84528/" ]
You can use [**ScriptSaver**](http://swannman.github.io/scriptsaver/). 1. Set the AppleScript to a script containing the following: ``` do shell script "/usr/sbin/screencapture /path/to/folder/screensaver.png" ``` /path/to/folder must exist and be empty, or at least contain no other images 2. Set the screen saver t...
This seems to do exactly what you want. I use it to secure a machine that shows a dashboard. It works great. <http://www.monkeybreadsoftware.de/Software/Transparent.shtml>
109,434
I admit that I spend most of my time googling for a solution when faced with a problem. So, when it comes to interviewing, sometimes the question is really tough or there are questions you never tried before. I understand this is to assess how much do we understand about theory but sometimes I also wondering, perhaps ...
2018/03/21
[ "https://workplace.stackexchange.com/questions/109434", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/50103/" ]
Your potential employer is very likely interested in having you correctly completing the assigned tasks in a given time. That you already knew how to handle it or that you searched for help it has little impact on the outcome, as long as you can be on schedule. Someone said that knowledge is not about keeping all the...
If you are going to have *Google* in performing the job then it seems reasonable to use *Google* for the assessment. But it should still be your own work. Don't copy solutions as a whole. If the assessment does not match your real skills it will eventually come out. If it lands you a job you are not qualified for you w...
65,688,657
Context ======= I'm running Jenkins on Windows, writing declarative pipelines. I'm trying to put multiple commands in a single `bat` step, while still making the step fail if any of the included commands fail. Purpose of this is twofold. * The best practices document suggests that creating a step for every little th...
2021/01/12
[ "https://Stackoverflow.com/questions/65688657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114197/" ]
> > is not working as I expect > > > It definitely doesn't work the way it except you to. The overload of `erase` you use looks like ``` string& erase( size_type index = 0, size_type count = npos); ``` Description of the overload from cppreference: > > Removes min(count, size() - index) characters starting at...
In the end this was the solution I found ``` std::string trim(const std::string &str) { size_t first = str.find_first_not_of(' '); if (std::string::npos == first) { return str; } size_t last = str.find_last_not_of(' '); return str.substr(first, (last - first + 1)); } bool startsWith(const std::string &i...
19,320,747
Whenever I append a `:` character in Vim in Python mode, it either: * indents the line * dedents the line * does nothing What is it even trying to do, and how do I get rid of this behavior?
2013/10/11
[ "https://Stackoverflow.com/questions/19320747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/272865/" ]
[Nathan Grigg's answer](https://stackoverflow.com/a/21820207/456550) set me on the right track. I had to make a few changes for my setup. I had to use `:setlocal indentkeys-=<:>`, because in my case `:set indentkeys?` showed `indentkeys=0{,0},!^F,o,O,e,<:>,=elif,=except`. Also, putting `:setlocal indentkeys-=<:>` in...
*TL;DR* I disabled autoindentation by typing: > > **:set indentexpr=** > > > then hitting the ENTER key. It's a quick fix without needing to understand *indentkeys* .. Thanks to [Christian Long](https://stackoverflow.com/users/456550/christian-long) for the docs to [indentkeys](http://vimdoc.sourceforge.net/h...
2,033,115
I am trying to refine my knowledge of N\_Tier arch Inside the BLL, and In case I am using custom business objects in BLL, like CustomerInfo {FN, LS, ...}, Consider that I have Customer table and Currency table, Customer is having a default currency, thus there is a FK Currency\_ID in Customer table, at UI layer, we ne...
2010/01/09
[ "https://Stackoverflow.com/questions/2033115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/225537/" ]
Use proxy `static constexpr const char type_name_str[] = {"type name"};` for passing string as template parameter. Defining string using `[]` is important. ``` #include <iostream> template<typename T, const char* const t_name> struct TypeName { public: static constexpr const char* Name() { ...
Maybe not what the OP is asking, but if you use `boost`, you can create a macro like this for example: ``` #define C_STR(str_) boost::mpl::c_str< BOOST_METAPARSE_STRING(str_) >::value ``` Then use as follows: ``` template<const char* str> structe testit{ }; testit<C_STR("hello")> ti; ```
5,124
Ansible seems to have a clear advantage over competition like chef and puppet because it is agent-less and saves a certain degree of overhead. I have read several comparisons of the various configuration tools and while each tool has its own strengths and weaknesses, I realize that much of it is down to personal prefe...
2018/10/05
[ "https://devops.stackexchange.com/questions/5124", "https://devops.stackexchange.com", "https://devops.stackexchange.com/users/5288/" ]
I've found an interesting discussion on the topic [configuration management pull vs push topology](https://serverfault.com/questions/568187/configuration-management-push-versus-pull-based-topology) [One contributor](https://serverfault.com/a/568372/392485) writes that pull systems (master/agent) offer more flexibility...
IMHO the only advantage of a master/agent pull architecture is that it can be used in a firewalled network (when the actual configuration is located outside that network) without opening up holes in the firewall, while the push architecture cannot. In terms of flexibility, I think the most important issue is the minim...
52,542,638
I'm making a rock paper scissors game for school and I have a working game but its 213 lines long. I was trying to shorten it up some by adding switch case in place of my if statements. Are there some instances where a switch case just won't work and it has to be an if statement? ``` String weaponChoice = keyboard.ne...
2018/09/27
[ "https://Stackoverflow.com/questions/52542638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
A `switch` statement can test the value of only one expression. It is possible to nest `switch` statements, but that's overly verbose and is no better than a series of `if`/`else` statements. As an aside, you may want to validate the user's weapon of choice, so someone doesn't choose Lizard, Spock, Foo, or something e...
You don't necessarily need to make a switch of your code to shorten it. You can put the tree options in a list, and compare the user's choice with the value that that comes after the computer's choice to see if the user won. If you have the list `[Rock, Paper, Scissors]`, the computer chose Rock. Find the element afte...
23,139,202
In PHP using method chaining how would one go about supplying a functional call after the last method being called in the chain? Also while using the same instance (see below). This would kill the idea of implementing a destructor. > > The end result is a return value and functional call of private "insert()" from t...
2014/04/17
[ "https://Stackoverflow.com/questions/23139202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1804013/" ]
You could keep a list of things that needs to be initialised and whether they have been so in this instance or not. Then check the list each time you use one of the initialisation methods. Something like: ``` class O { private $init = array ( 'red' => false , 'green' => false , 'blue' => fa...
Ok let's see a code example ``` <?php // map dummy class class map { // __call magic method public function __call($name, $args) { return $this; } } // now we chain $map = new map; // let's find me $map->start('here') ->go('right') ->then() ->turn('left') ->and('get water') ->dontEat() ->keep('going') ->youShouldS...
28,952,944
I recently noticed a bug due to a mismatched parameter order in the class to its interface parameter order. I felt that this should have been a compile error. I found out that Interfaces do not constrain the parameter names. So if you see my example below I have `firstParameter` and `secondParameter` reversed, I also h...
2015/03/09
[ "https://Stackoverflow.com/questions/28952944", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1558269/" ]
> > Is there a way to guarantee at build time that a class matches the interface parameter names? I would prefer not to do this manually. > > > Not within the C# language. However: * You could write a unit test to check, reasonably easily. Not quite build time, but still early enough to catch errors before they'r...
As Jon says, C# doesn't really care what the parameters are called, but if you wanted to reflectively assert the parameter names for yourself; either at start up or in a unit test, you could use something like this: ``` public class Program { public static void Main(string[] args) { var assembly = Asse...
133,564
Wave theory does not account for the photon model, which was developed only to explain quantum effects like photoelectric effect. Then why do we talk about a photon's reflection and rarefaction, as that would require it to have wave properties? This has been mentioned here: (<http://en.m.wikipedia.org/wiki/Photon>) I...
2014/09/02
[ "https://physics.stackexchange.com/questions/133564", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/56742/" ]
It is certainly possible to clone mammals. Scientists have done that. One can replicate many things well enough for them to be functionally indistinguishable for all practical purposes. Industrial mass production processes do just that. Some of the chips in your computer are fabricated with such a precision, that some ...
Best answer I could find - Anyone care to chime in on this? I can say with 100% certainty, it would not be the same person. The amount of information contained in a human body is astronomical. This creates a higher mathematical probability (nearing infinity) that some of that information would be lost. Even if applyi...
1,457,568
Looking at the posts here for email address validation, I am looking to be much more liberal about the client side test I am performing. The closest I have seen so far is: ``` ^([\w-\.]+)@((\[[0–9]{1,3}\.[0–9]{1,3}\.[0–9]{1,3}\.)|(([\w-]+\.)+)) ([a-zA-Z]{2,4}|[0–9]{1,3})(\]?)$ ``` That will not match this#strnage@fo...
2009/09/22
[ "https://Stackoverflow.com/questions/1457568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/170579/" ]
The following has been useful for me for quite sometime now. ``` function validateEmail(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } ```
Perfect validation regex is probably hard to match, but I've used this one for quite some time: ``` /^([\w-\.\+])+\@([\w-]+\.)+([\w]{2,6})+$/ ``` Only changed it recently to match 6-char TLDs.
26,515,303
i have got following problem with Joomla! 3.3.4: after entering text to the Browser Page Title window in article options, the title doesn't change. In that place is only displayed the global sitename. In older Joomla everything works properly.
2014/10/22
[ "https://Stackoverflow.com/questions/26515303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3872323/" ]
To change the field title you need to edit the menu item options. When you go to the detail view of menu item in question, navigate to the **Page Display** tab. The first field is **Browser Page Title**, enter the title you want to appear and save. That should sort it out for you...
Please try to switch to the default template and if it works there is something wrong with your template. In order to set browser title you could use setTitle() method. ``` <?php $this->setTitle( $title ); ?> ``` You could check setTitle usage at: [Joomla Docs](http://docs.joomla.org/Customising_the_dynamic_page_...
74,016
The explosive growth of Stack Exchange sites is making things really kind of difficult at times. For example: I'm trying to get help with working with Shibboleth on Ubuntu. Does that mean I should be asking on SO (for the Shibboleth), askUbuntu (for the Ubuntu), Server Fault (since I'm trying to set up the Service Pro...
2011/01/05
[ "https://meta.stackexchange.com/questions/74016", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/142055/" ]
Good troubleshooting techniques require the ability to break the problem up into smaller chunks that involve as few dependencies as possible. For instance, your example indicates that the root problem is "get help working with shibboleth" - all else is irrelevant unless you've already determined that it's not working d...
You say too much overlap, then mention a problem that itself covers many areas. It's not the fact that the websites overlap that causes you an issue, and in fact this helps you because your problem might be suitable on several sites. The problem of a given question being relevant on many sites is not a new one at all,...
1,176,069
Example from Mac OS X: ``` [[aView animator] setFrame:NSMakeRect(100.0,100.0,300.0,300.0)]; ``` I have tried something similar in UIKit, but it seems the animator method is not there for UIView. So there's no "implicit" animation?
2009/07/24
[ "https://Stackoverflow.com/questions/1176069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/62553/" ]
I recommend not using "SELECT \*", that's typically CPU/time/whatever more consuming than explicitely listing the fields you want to have, and it is more readable for someone else because you don't have to remember which are the fields contained in the table. +1 for the BETWEEN it will impact on performance, making yo...
Do you have any constraints you are imposing on the parameters? You could also optimize the query by removing unnecessary parameters if you have constraints which make the specifications listed in double. Such as, your query is logically equivalent to: ``` "SELECT *,rowid FROM tblEvent_basic WHERE service_id = ? AND ...
3,239,207
How do I open a file that is an Excel file for reading in Python? I've opened text files, for example, `sometextfile.txt` with the reading command. How do I do that for an Excel file?
2010/07/13
[ "https://Stackoverflow.com/questions/3239207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/381259/" ]
This may help: This creates a node that takes a 2D List (list of list items) and pushes them into the excel spreadsheet. make sure the IN[]s are present or will throw and exception. this is a re-write of the Revit excel dynamo node for excel 2013 as the default prepackaged node kept breaking. I also have a similar re...
``` import pandas as pd import os files = os.listdir('path/to/files/directory/') desiredFile = files[i] filePath = 'path/to/files/directory/%s' Ofile = filePath % desiredFile xls_import = pd.read_csv(Ofile) ``` Now you can use the power of pandas DataFrames!
35,155,475
I redraw the graphics of the `Tab` for the `TabControl` but I can't set the `Width` of it. What I want is that the text of the `Tab` and the icon is contained in its size. Now is something like this: [![tabs are overlaid](https://i.stack.imgur.com/RQQjG.png)](https://i.stack.imgur.com/RQQjG.png) My Code ``` privat...
2016/02/02
[ "https://Stackoverflow.com/questions/35155475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1396650/" ]
Unfortunately, there isn't built-in property to control the width of the `TabPages'` tab header of the `TabControl` *individually* (Edit: apparently, there is `TabControl.ItemSize` to control it collectively. See TaW's answer to fix the width of all tab pages under a tab control). But a little trick you could do is t...
Use it... --------- ``` private void FrmSqlMain_Load(object sender, EventArgs e) { myTabControl.SizeMode = TabSizeMode.Normal; myTabControl.DrawMode = TabDrawMode.OwnerDrawFixed; } ```
3,143,607
I have to take a piece of data, and apply a large number of possible variables to it. I really don't like the idea of using a gigantic set of if statements, so i'm looking for help in an approach to simplify, and make it easier to maintain. As an example: ``` if (isSoccer) val = soccerBaseVal; else if (isFootball...
2010/06/29
[ "https://Stackoverflow.com/questions/3143607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61164/" ]
A common way to avoid large switching structures is to put the information into data structures. Create an enumeration `SportType` and a `Dictionary<SportType, Int32>` containing the associated values. The you can simply write `val += sportTypeScoreMap[sportType]` and you are done. Variations of this pattern will help...
Here are a few ideas: 1 Use lookup tables: ``` var val = 0; SportType sportType = GetSportType(); val += sportvalues[sportType]; ``` You can load the table from the database. 2 Use the factory pattern: ``` var val = 0; val += SportFactory.Create(sportType).CalculateValue(); ``` The [Dynamic Factory Pattern](...
28,171,474
I have one query that returns multiple rows, and another query in which I want to set criteria to be either one of values from those multiple rows , so basicly I want the subquery to look something like this: ``` select * from table where id= (multiple row query); ``` Where `multiple row query` returns multiple row...
2015/01/27
[ "https://Stackoverflow.com/questions/28171474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4043273/" ]
`=` can be used when the subquery returns only 1 value. When subquery returns more than 1 value, you will have to use `IN`: ``` select * from table where id IN (multiple row query); ``` For example: ``` SELECT * FROM Students WHERE Marks = (SELECT MAX(Marks) FROM Students) --Subquery returns only 1 value SELEC...
Use `MAX` in your `SELECT` query to return one value… EXAMPLE ``` INSERT INTO school_year_studentid (student_id,syr_id) VALUES ((SELECT MAX(student_id) FROM student), (SELECT MAX(syr_id) FROM school_year)) ``` instead of ``` INSERT INTO school_year_studentid (student_id,syr_id) VALUES ((SELECT (student_id) FROM stu...
64,802,322
I have an origin repo in GitHub and I have created a local fork that I am developing on. I have a GitHub Action that runs a Bandit security check, but when I push changes and create a Pull request from a branch in my fork, the Bandit test runs on the code that is currently in the origin repo, not on the new code in the...
2020/11/12
[ "https://Stackoverflow.com/questions/64802322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14625012/" ]
> > [...] we’ve added a new `pull_request_target` event, which behaves in an almost identical way to the `pull_request` event with the same set of filters and payload. However, instead of running against the workflow and code from the merge commit, the event runs against the workflow and code from the base of the pull...
Triggers the workflow on push or pull request events > > Using `pull_request` > > > ``` name: CI on: [push, pull_request] jobs: python-tests: runs-on: ubuntu-latest steps: ... ```
3,053,216
Hi all I have (just like the rest) inherited some struts 1 code. I have had need to add a few more pages to this project. **What I cannot figure out is how to map several distinct but similarly natured input elements to my ActionForm.** Let me elaborate. I create a new `<Input>` element dynamically as the user input...
2010/06/16
[ "https://Stackoverflow.com/questions/3053216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/101715/" ]
I don't see any answer considering Grid-Css. I think it is a very elegant approach: grid-css even supports row span and and column spans. Here you can find a very good article: <https://medium.com/@js_tut/css-grid-tutorial-filling-in-the-gaps-c596c9534611>
A bit OFF-TOPIC, but may help someone for a cleaner HTML... CSS ``` .common_table{ display:table; border-collapse:collapse; border:1px solid grey; } .common_table DIV{ display:table-row; border:1px solid grey; } .common_table DIV DIV{ display:table-cell; } ``` HTML ``` <DIV class...
42,979,447
I can access the same folder and file through FileZilla very easily. Definitely I am doing something wrong, but what ? My code is as below ``` try{ Bitmap bitmap = null; InputStream in; String userpass = "username:password"; String url = "http://veedeesoft.com/httpdocs/RoyalFoods/Produc...
2017/03/23
[ "https://Stackoverflow.com/questions/42979447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/983457/" ]
I think flexbox might help you, check this code: ```css #home{ background: #5F9EA0; border-radius: 25px; margin: auto; width: 200px; height: 100px; display: flex; justify-content: center; align-items: center; font-size: 25px; } ``` ```html <div id = "home"> <span>Home</span> </div> ``` ...
You can use the `display:flex` approach to center the text from top and left. ```css #home { background: #5F9EA0; border-radius: 25px; margin: auto; width: 200px; height: 100px; text-align: center; font-size: 25px; display:flex; justify-content:center; align-items:center; } ``` ```html ...
45,219,753
I'm trying to add a new activity in my android app and I've got this code for it: ``` public void BSettings() { View.OnClickListener listSet = new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(getApplicationContext(), "settings", Toast.LENGTH_LONG).s...
2017/07/20
[ "https://Stackoverflow.com/questions/45219753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8236050/" ]
My problem was that, for some reason, my envioroment.ts file was missing. So check important files.
Could be bad path to component templateUrl, perhaps missing the `./` Before: `templateUrl: 'my-control.component.html',` After: `templateUrl: './my-control.component.html',`
42,317,927
I have an Excel VBA formula:- ``` If [G56] = "Not Applicable" Then ... ``` It is case-sensitive. I want it to ignore the case of "Not applicable".
2017/02/18
[ "https://Stackoverflow.com/questions/42317927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6845519/" ]
You can just use the LCase function: ``` If LCase([G56]) = "not applicable" Then ```
Fastest option would be ``` StrComp(LCase$("Not Applicable"), "not applicable", vbBinaryCompare) ```
62,543,909
I'm trying to install Regex on macos catalina, but I'm getting this error, how do I proceed? I tried to update `pip`, `pip3`, `pipwin`, `xcode`, but both return the same error, the same happens when I install NLTK. I was able to install on a ubuntu VM and installed everything, REGEX and NLTK, only on MacOs that I cont...
2020/06/23
[ "https://Stackoverflow.com/questions/62543909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13035301/" ]
I am no mac super user but you could try this and check if it works. `xcode-select --install` If it says it's already installed try: `xcode-select --reset` The reason I believe it might be the issue is cause of the xcrun error that is occurring.
The underlying error seems to be: ``` invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun` ``` You can most likely solve this by installing the command line tools: ``` xcode-select --install ``` See <https://apple.stackexchange.c...
106,647
I need to refresh a link every 5 minutes, how to schedule cron for refreshing the url
2016/03/17
[ "https://magento.stackexchange.com/questions/106647", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/32935/" ]
Tow way to set cron : **1) cpanel cron set** ``` GoTo Cpanel->corn job setting -> set file path. ``` **2) Using magento . you have to create module .** app/etc/modules/Compnyname\_ModuleName.xml ``` <?xml version="1.0"?> <config> <modules> <Compnyname_ModuleName> <active>true</active> <codePool...
you just point it to your file or page: ``` */5 * * * * curl --silent "http://example.come/some/page" >/dev/null 2>&1 ```
15,610,003
I have a space ship in a canvas. It has velocities, `ship.vx` and `ship.vy`. When it's 30px away from the canvas borders I set `ship.vx` & `ship.vy` to `0` and move the background objects in ship's opposite direction. At this moment the ship is stuck at a point. That's all good. Now if I try to move it left-right(`stuc...
2013/03/25
[ "https://Stackoverflow.com/questions/15610003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1370508/" ]
I think `split` will do the job for you. ``` DF <- structure(list(ID = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 4L, 4L, 4L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 9L, 10L, 10L, 10L, 10L), Item = c(" Sixth Sense", " LOTR1", " Harry Potter1", " Green Mile", " LOTR2", " Gladiato...
Your `aggregate` command could work, but you didn't specify the arguments correctly. You would need something like: `with(DF, aggregate(Item, list(ID), FUN = function(x) c(as.character(x))))`. Alternatively, you can use the formula method for `aggregate`: ``` aggregate(Item ~ ID, DF, c) # ID ...
394
[serial](https://electronics.stackexchange.com/questions/tagged/serial "show questions tagged 'serial'") is fairly broad (what isn't serial nowadays...), and most of the current tags are really referring to UARTs ([uart](https://electronics.stackexchange.com/questions/tagged/uart "show questions tagged 'uart'")), but a...
2011/02/05
[ "https://electronics.meta.stackexchange.com/questions/394", "https://electronics.meta.stackexchange.com", "https://electronics.meta.stackexchange.com/users/1407/" ]
I think the problem is more complicated than that. For example, you can have: * Asynchronous Serial + logic level + RS232 + RS485 - CAN bus * Synchronous Serial + SPI + I2C * High-speed Serial + USB + Digital Video And this is not a complete list. I don't like the idea of using UART as a tag for all tradit...
For me as a beginner serial is very common but uart is not.
69,962,211
I want to get data in parallel. I found an example to call API in parallel but I want to store `async let variables` with loop. Async let example. However, this example doesn't use a loop. ```swift async let firstPhoto = downloadPhoto(named: photoNames[0]) async let secondPhoto = downloadPhoto(named: photoNames[1]) a...
2021/11/14
[ "https://Stackoverflow.com/questions/69962211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7359831/" ]
You can use a task group. See [Tasks and Task Groups](https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html#ID642) section of the *The Swift Programming Language: Concurrency* (which would appear to be where you got your example). One can use [`withTaskGroup(of:returning:body:)`](https://developer.apple.com...
If the order of result doesn't matter here, use a `TaskGroup` instead.
91,082
Two weeks ago I've started taking singing lessons to learn the proper technique and improve the extension. The teacher gave me 2-3 exercises to do at home that are involved with correct breathing (like standing in front of a mirror, inhale profoundly, feel the ribs/stomach widen and then exhale producing a constant ...
2019/10/22
[ "https://music.stackexchange.com/questions/91082", "https://music.stackexchange.com", "https://music.stackexchange.com/users/63963/" ]
I've determined the actual notes: [![Key of d minor](https://i.stack.imgur.com/FOIWf.png)](https://i.stack.imgur.com/FOIWf.png) The middle voice is the main melody. I'm not aware of any formal name for this kind of harmony, but it is certainly dissonant. I agree with PeterJ in that the harmonies are likely a result o...
I'm not at an instrument now to check, but it sounds like harmony in thirds going down chromatically. It also sounds like an electronic effect. It sounds artificial and that gives it a sort of weirdness. At least for me. Harmonizer effects put me off. They don't have the warmth of real harmonizing. A kind of [uncannin...
529,088
Notice the following code. The offending line has been commented out. ``` interface I<R> { } class C : I<int> { } class Program { private static void function<T, R>(T t) where T : class, I<R> { } static void Main(string[] args) { // function(new C()); // wont compile function<C, ...
2009/02/09
[ "https://Stackoverflow.com/questions/529088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9178/" ]
``` class D : I<int>, I<string> { } // function<D, int>(new D()); function<D, string>(new D()); //is R int or string? function(new D()); ```
C# does not support this kind of type inference. Consider this case which adds a bit of ambiguity to the problem. ``` class Other : I<int>, I<Student>{ ... } void Example(){ function(new D()); } ``` In this case there is an ambiguity as to which I should be chosen. If you look forward to C# 4.0 the problem only ...
50,327
I am creating an animated logo for my web site. It is a simple 2 frame gif. The only difference between the 2 frames is that the first one has a glowing object and the second one doesn't. Here's [the first frame](https://imgur.com/g5Xu2Gr). Now, after hitting save for web, I choose not to use matte because the backgr...
2015/03/28
[ "https://graphicdesign.stackexchange.com/questions/50327", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/41479/" ]
`.gif` does not support alpha transparency, that is the reason for the “line” around your logo. The easiest way would be to include the gradient in the background. The only problem would be a dynamicly changing background. To get alpha transparency on the web is using a `.png`, which does not support animations. But s...
As Afterlame suggests, the best solution to your problem is either: 1. Include the gradient in your image so that it can render the half opacity drop shadow that you're looking for. OR 2. Simulate your animation through CSS or JS. This is the vastly superior option, as it gives you complete control over your situati...
330
I am running a forum with a very young user group (primarily 9-17 years old) and there are some users that are simply overusing my community: Some of them are online all day, every day. While I appreciate their interest in my community and know that they found friends in there I am concerned about their real life. Sta...
2014/07/30
[ "https://moderators.stackexchange.com/questions/330", "https://moderators.stackexchange.com", "https://moderators.stackexchange.com/users/15/" ]
I don't think it's something you should have to, or even want to, worry about. You are only responsible for your forum, why would you want the added responsibility of trying to raise someone else's kids? Most likely any restrictions you place will have adverse effects. I see one of two things happening: 1. They'll st...
I would say that you won't have to concern your self with this, as these people may have a good reason to be online all day * Either they are doing what is known as homeschooling, and hence have more time being online (not that homeschooling gives a person such time) * They may have some break from school Other then ...
11,641,224
I'm working with MVC 3 and have an issue. Instead of giving mydomain/mydirectory/item like I expected I get this: mydomain/mydirectory/list?animal=quack. Here's the route in the global ``` //Default route mapping routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters ...
2012/07/25
[ "https://Stackoverflow.com/questions/11641224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88230/" ]
It's the close the definition of the anonymous implementation of `View.OnClickListener` and then to close the method call `setOnClickListener()`. To make it more clear, the code is equivalent to: ``` View.OnClickListener listener = new View.OnClickListener() { public void onClick(View v) { if (((CheckBox)...
It closes the setOnClickListener . TIP if you are using eclipse set your cursor to the right of the closed bracket.The open bracket will than be highlighted so you can see what's what.
659,650
I need to get a stack trace for a JVM process running on a client machine that uses windows. The client has the JRE installed but not the JDK. I want to use JStack but it is not installed and we can't install a JDK on the client's machine. I also tried using AdaptJ stack trace product from a Java Webstart Session bu...
2009/03/18
[ "https://Stackoverflow.com/questions/659650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47508/" ]
The JDK and associated tools work fine whether "installed" or not, if you just zip up and extract it to a temporary directory, you should be able to run jstack. (No PATH or JAVA\_HOME modifications necessary). Just make sure you use the same version that corresponds to the JRE your client has the application running wi...
To get a thread dump with only a JRE you need tools.jar and attach.dll from the JDK of the same Java version. Install this somewhere and copy these into the jre. Must be identical version! If you need a dump of a process running under the system account you can use the Windows sysinternals psexec.exe to gain access to...
2,265,912
I need help figuring out my mistake. Proof. Proving by contradiction that $\sqrt{\frac{1}{2}}$ is irrational. Suppose $\sqrt{\frac{1}{2}}$ is rational so: $\sqrt{\frac{1}{2}}=\frac{m}{n}$. Where $m/n$ are in lowest terms. Squaring both sides and solving for $n$ we have $n^{2}=2m^{2}$. So $n^2$ is even therefore $n...
2017/05/04
[ "https://math.stackexchange.com/questions/2265912", "https://math.stackexchange.com", "https://math.stackexchange.com/users/368481/" ]
$$\sqrt { \frac 12 }=\frac{1}{\sqrt2}=\frac{1}{\sqrt2} \times \frac{\sqrt2}{\sqrt2}=\frac{\color{red}{ \sqrt{2}} ~(\text{Irrational)}}{2~(\text{Rational)}} :=~~~\text{Is Irrational}$$
Your proof is actually correct. We know$\sqrt{\frac12} = \frac{1}{\sqrt{2}}$. So, if we prove $\frac{1}{\sqrt{2}}$ is irrational, then so is $\sqrt{\frac12}$ since they are equal. Let $\sqrt{2} = \frac{m}{n}$. So that means $\frac{1}{\sqrt{2}} = \frac{n}{m}$. However, we know that $\sqrt{2}$ is irrational thus there is...
1,842,681
I'm looking for a regular expression to remove a single parameter from a query string, and I want to do it in a single regular expression if possible. Say I want to remove the `foo` parameter. Right now I use this: ``` /&?foo\=[^&]+/ ``` That works as long as `foo` is not the first parameter in the query string. If...
2009/12/03
[ "https://Stackoverflow.com/questions/1842681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18511/" ]
Having a query string that starts with `&` is harmless--why not leave it that way? In any case, I suggest that you search for the trailing ampersand and use `\b` to match the beginning of foo w/o taking in a previous character: ``` /\bfoo\=[^&]+&?/ ```
It's a bit silly but I started trying to solve this with a regexp and wanted to finally get it working :) ``` $str[] = 'foo=123'; $str[] = 'foo=123&bar=456'; $str[] = 'bar=456&foo=123'; $str[] = 'abc=789&foo=123&bar=456'; foreach ($str as $string) { echo preg_replace('#(?:^|\b)(&?)foo=[^&]+(&?)#e', "'$1'=='&' && ...
27,195
I just seeded a pomegranate, and instead of red / deep pink seeds, the seeds are pale pink / white. What does this mean? Are they ok to eat?
2012/09/16
[ "https://cooking.stackexchange.com/questions/27195", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/4853/" ]
Got pomegranate with pale pink/white seed. I was surprised when i first opened it because i have been always getting the dark red seed varity. I thought i got a bad fruit. After I taste it, those pale pink/white seed taste sweeter and it is less tart than the drak red varity. It is also more juicy. I LOVED it!!
it depends on how much the field is riched by minerals such as Iron. you know as the Iron amount increase in field you have a more red element object you have and the pomegrenate's fruit is not an exception
13,640,594
I have a certain scenario where I am trying to accomplish more generic approach of using delegate and calling a selector based on what selector is being set. For example below is the code: ``` @protocol HttpRequestDelegate @optional - (void)testDrive:(NSData*)dataembedd; @end - (id)init { self = [super init];...
2012/11/30
[ "https://Stackoverflow.com/questions/13640594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/618658/" ]
I don't know of any libraries, but here is my XE2 helper class unit with the SelectNode(s) function that I use to 'do' XPath. The RemoveNameSpaces and XMLToTree functions do not apply, but who knows when they might come in handy ;-) ``` unit uXMLHelper; interface Uses System.SysUtils, System.Classes, System.TypIn...
May be [OmniXML](http://code.google.com/p/omnixml/) will be useful (see XPath demo). And [another](http://www.benibela.de/sources_en.html#internettools) library for HTML parsing include XPath 2 support;
36,896,539
I've a Nodejs app and I use Passeport to let my users connect throught Facebook or Google via Oauth. I'm storing basic data after connection such as : uid, firstname etc. How can I be assured that the uid I'm receiving will be always unique for a given user ? I mean, data is coming either from Facebook or Google, so w...
2016/04/27
[ "https://Stackoverflow.com/questions/36896539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3903595/" ]
The UID is unique only within the scope of that single provider’s list of users. [This article](http://www.sitepoint.com/rails-authentication-oauth-2-0-omniauth/) suggests you combine the provider’s name plus the UID to get a unique value. > > Combination of provider’s name and uID will uniquely identify user insi...
The id you are getting via OAuth is unique when you are using either Facebook or Google. But if you want to use both then I would suggest make your **dbSchema** (if you are using mongoose) like this - ``` var userSchema = new mongoose.Schema({ local: { username: String, password: String }, facebook: { ...
12,880,539
I know that coding in native JavaScript means that your code will execute faster than if you were to code it in jQuery, but how much faster? In particular, I want to know if the speed increase would make it worth while spending the longer time coding in native JavaScript than jQuery if it was for a very large webapp? ...
2012/10/14
[ "https://Stackoverflow.com/questions/12880539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1320129/" ]
Test it. Pick a part of your web app and write it in JavaScript and then do the equivalent using jQuery. Test the performance. Developing JavaScript that outperforms jQuery is dependent on your, or the team's skill. jQuery is battle hardened code that abstracts lots of browser quirks for you. It does add some overhe...
On the app I'm building we are using a combination of JQuery with our own prototypes. The time difference from a user's perspective is negligible from using just straight JS. Plus the CBS(cross browser support) is super important.
461,165
For the undermentioned tikz picture, I am not able to place it in centre. May kindly help. ``` \tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=black!10] \tikzstyle{arrow} = [thick,->,>=stealth] \begin{tikzpicture}[node distance=2cm, auto] \no...
2018/11/21
[ "https://tex.stackexchange.com/questions/461165", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/132410/" ]
The `tkz-euclide` package has a macro to do this. The manual is written in French. 1. First, we define the circle with the macro `\tkzDefCircle`. 2. This macro returns two values that are the center recovered with the macro `\tkzGetPoint{O}` 3. and the radius that is recovered with the macro `\tkzGetLength{rayon}`. O...
A new node style, based on the derivation below plus the information that one can use `intersection of \p1--\p3 and \p2--\p4`, which I learned from [AndréC's nice answer](https://tex.stackexchange.com/a/461194/121799) ``` \documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{calc,through} \tikzset{circle through...
67,373,803
If a user inputs a string like "y=3x+2", how do I change the "x" in the user's input to a SymPy Symbol named `x`? I have tried: ``` e1 = 'y = 3x+2' y = parse_expr(e1, evaluate=True) ``` but an error is raised when I try to parse `e1`. I don't want to use a regex or split the values into separate variables because t...
2021/05/03
[ "https://Stackoverflow.com/questions/67373803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14862417/" ]
After parsing the user string (after taking care of the `=`) you no longer have a string, you have a python expression in which are SymPy objects. The `x` will now be a generic Symbol, just like the one you assigned to the variable `x`. Here I just split on the `=` and feed the left and right hand sides into an `Equali...
not sure if you want this is what you are asking for modify the equation: ``` 3x-y=-2 4x-y=2 import numpy as np a = np.array([[3, -1], [4,-1]]) b= np.array([-2,2]) z=np.linalg.solve(a,b) ``` Answer z = ``` array([ 4., 14.]) ```
23,444,320
SO i have active relation like: ``` [[id:1, post_id: 10, user_id:2][id:2, post_id:11, user_id:2]] ``` When i say `relation.uniq`, it doesn't return one value, because id's of objects are different(which is obvious behavior). How do i get only unique object, but not by full fields, but only by some specific field, f...
2014/05/03
[ "https://Stackoverflow.com/questions/23444320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1411047/" ]
Right so it took me a while to figure it out myself but I finally managed to do this by writing the following function: ``` // @param int $post_id - The id of the post that you are setting the attributes for // @param array[] $attributes - This needs to be an array containing ALL your attributes so it can insert them ...
I tried Daniel's answer, and it didn't work for me. It might be that the Wordpress/Woocommerce code has changed since, or perhaps I didn't quite understand how to do it, but either way that code did nothing for me. After a lot of work using it as a base, however, I came up with this snippet of code and put it on my the...
480,755
I am using a Dell n5050 laptop, recently I noticed that I have a problem with my laptop. Namely, the power LED always stays on after shutting down the laptop. I've found two options: 1. long press of the power switch will turn the LED off 2. remove the battery will also turn it off How can I resolve this issue?
2012/09/28
[ "https://superuser.com/questions/480755", "https://superuser.com", "https://superuser.com/users/161936/" ]
This LED reflects the fact that your laptop is plugged into the power network. Unplug it and the LED will be switched off. The battery charge continues after you shut down your laptop. The long press on the power button stops this charging
You can do few troubleshooting steps: 1. Click on Start → right-click Computer → Device Manager 2. In Device Manager click the `+` sign before "Network adapters" 3. Under "Network adapters" right-click "Wireless adapter n1030", select Properties and go to the Power Management tab. Uncheck "Allow the computer to turn o...
65,519,159
After upgrading my application from rails 5.2 to rails 6 and I am getting this issue **This model adapter does not support fetching records from the database.** ``` class PlayerArtController < ApplicationController load_and_authorize_resource only: [:index, :create] def index end def create end end ```...
2020/12/31
[ "https://Stackoverflow.com/questions/65519159", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5787849/" ]
As suggested by @Eyeslandic I ended up updating cancancan from 2.3 to 3.0
``` CanCan::NotImplemented (This model adapter does not support fetching records from the database.): ``` Records were not fecthed from database, after updating the gem resolved the issue: ``` # gem 'cancancan', '2.3.0' ## update version to new version gem 'cancancan', '~> 3.3.0' ```
200,082
I'm new in Blender and I'm making a jar bottle to start and want to close the top wraping with paper like these ones: [![enter image description here](https://i.stack.imgur.com/Ws3Da.png)](https://i.stack.imgur.com/Ws3Da.png) I tried using cloth modifier with a colision object + pressure but I can't find a way to mak...
2020/10/27
[ "https://blender.stackexchange.com/questions/200082", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/109883/" ]
Cloth Sim --------- * Add Circle 16 sides, Extrude, Scale, Grid Fill * Extrude, Scale outer loop, select vertices for each side and Scale on (X/Y) to zero to get square shape, add extra loops `Ctrl`+`R`+`3` [![enter image description here](https://i.stack.imgur.com/jkTS7.png)](https://i.stack.imgur.com/jkTS7.png) * ...
This example you posted I believe is likely done by sculpting but simulation may be faster here (for multiple good looking results with low experience. *There were many major advances in the last year(s) of Blender development that are worth checking out if you aim for speed.* Sculpting method ---------------- The st...
123,612
I am a second year PhD student in math. I recently feel miserable working with my current advisor so I am considering switching advisor or adding a second advisor. A few problems I can think of at this moment which make me want another advisor include: * He constantly forgets meeting. For example, I schedule it with...
2019/01/23
[ "https://academia.stackexchange.com/questions/123612", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/101905/" ]
As suggested in other answers here, none of the things you describe are necessarily deal breakers. But you don't give any positive aspects of the relationship. A lot of relatively small negatives can add up. I'm going to guess that you've made up your mind already, even if you haven't noticed it, and simply want co...
1. The meeting forgetting is minor. There can be way worse aspects of an advisor (competition, power struggles, etc.) 2. Giving good references: in an ideal world, "apprenticeship" would be more normal. However the reality is that many grad students forge their own path and are even expected to do so. Definitely this i...
18,620
I want to insert a record in the database. If it meets certain criteria, it should be inserted in lead, if not, it should be added in contacts. I'm not able to achieve this. Its a before insert trigger on lead object. If the trigger completes properly, it gets updated in leads irrespective of its insertion in contacts....
2013/10/23
[ "https://salesforce.stackexchange.com/questions/18620", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/4135/" ]
You could do something like this in an after trigger. It has the downside of burning up an Id on Lead as each Lead needs to be inserted into the Database first ``` if (trigger.isInsert) { List<Lead> leadsToConvertToContacts = new List<Lead>(); for(Lead l : Trigger.new) { if (l.SomeCriteria__c == 'Blah...
What you can do is..create after insert trigger.. check for condition if its true --> insert contact record and delete this instance from Lead.
21,883,458
I have the following ENUM: ``` [Flags] public enum DataFiat { [Description("Público")] Public = 1, [Description("Filiado")] Listed = 2, [Description("Cliente")] Client = 4 } // DataFiat ``` And I created an extension to get an Enum attribute: ``` public static T GetAttribute<T>(this Enum value) wher...
2014/02/19
[ "https://Stackoverflow.com/questions/21883458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/577805/" ]
You can use [this](https://stackoverflow.com/questions/4171140/iterate-over-values-in-flags-enum): ``` var values = x.ToString() .Split(new[] { ", " }, StringSplitOptions.None) .Select(v => (DataFiat)Enum.Parse(typeof(DataFiat), v)); ``` To get the individual values. Then get the attribute ...
in .NET CORE without any additional libraries you can do: ``` public enum Divisions { [Display(Name = "My Title 1")] None, [Display(Name = "My Title 2")] First, } ``` and to get the title: ``` using System.ComponentModel.DataAnnotations using System.Reflection string title = enumValue.GetType()?...
17,446,109
This is my 1st post in StackOver flow and my English is not good. I am a beginner in iOS, so i am slow little bit. Actually i want to parse 5 of my data (including Image) from URL. I use custom tableView cell for it. My plain text are showing in custom cell (in lable) clearly but images are not. That's why i use "dispa...
2013/07/03
[ "https://Stackoverflow.com/questions/17446109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2435154/" ]
I found the solution of this particular problem. Here it is: ``` imageQueueFairLogo = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); dispatch_async(imageQueueFairLogo, ^ { UIImage *imageFairLogo = [UIImage imageWithData:[NSData dataWithContentsOfURL: [NSURL URLWithString:[currentFair...
try like this ``` if (postAndCheckInDetails.postImageURL.length != 0) { if (!uploadImage) uploadImage = (UIImageView*)[cell viewWithTag:4]; dispatch_queue_t checkInQueueForPostImage = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIG...
119,050
Challenge ========= Given a the ID for a PPCG user who has existed for at least a month, output the average amount of reputation they gain per month. You can do this by dividing their reputation by the time since their account was created (which you can find on the profile). This should be returned floored; that is, t...
2017/05/05
[ "https://codegolf.stackexchange.com/questions/119050", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/68942/" ]
JS, ES6 ~~243~~ ~~235~~ ~~168~~ ~~166~~ ~~165~~ 164 bytes ========================================================= ``` i=>fetch(`//api.stackexchange.com/users/${i}?site=codegolf`).then(x=>x.json()).then(x=>alert(~~((y=x.items[0]).reputation/((new Date/1e3-y.creation_date)/2592e3)))) ``` Based on [the Python answer]...
Python ~~3~~ 2, ~~206~~ ~~219~~ ~~201~~ 193 bytes ------------------------------------------------- ``` import requests,time a=requests.get('http://api.stackexchange.com/users/'+str(input())+'?site=codegolf').json()['items'][0] print a['reputation']/((int(time.time())-a['creation_date'])/2592000) ``` I am estimating...
3,421
I've read a few other questions/answers on smart contract consensus by nodes in the network, but I still don't understand the steps. Here's how I picture it: 1. Two parties might agree upon a smart contract, sign with their private keys 2. Nodes validate that those parties are who they say they are 3. Smart contract i...
2016/04/27
[ "https://ethereum.stackexchange.com/questions/3421", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/1768/" ]
> > what is actually being agreed upon by the nodes > > > Many details, but at a high level 2 main ones are: * the **state** of the blockchain, including the exact contract code * the behavior and results of that code when it is executed (technical term is the **state transition function**) More granular details...
**TL;DR** Date is always based on the time and date when the block was mined. --- **Longer answer.** Ethereum smart contracts use a deterministic code. Solidity is one of the deterministic languages that makes you able to generate Ethereum EVM deterministic code. Deterministic code means that if you call a functi...
58,485,673
I have an ASP.NET Core Project with Angular App inside it. After updating the project to .NET Core 3.0 release, I've got a problem. During ASP.NET Core Project build, I see 2 errors in the output: ``` 1>------ Build started: Project: Portal, Configuration: Debug Any CPU ------ 1>C:\Program Files (x86)\Microsoft SDKs\T...
2019/10/21
[ "https://Stackoverflow.com/questions/58485673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/776539/" ]
I also got similar issue, but after installing Typescript on local machine from below link, <http://www.typescriptlang.org/#download-links> I rebuild solution, it worked. Note : Choose your appropriate VisualStudio version or any IDE you are using from download link!
I guess it is showing the error because somewhere you try to reinitialize the same property twice or more times. For Example: ``` let name = "John"; let person = { name, name: "Jane" } ``` As in the above code, * we first assigned the person's property(name) to John. * but then we reassigned the person's p...
16,713,914
I am not sure if this is a **bug** with the **new Android GeoFence sample code** or my understanding of what it is supposed to do is wrong. The sample app creates geofences but does not alert when geofence is breached. If anyone would like to give this a try and confirm, you can download the sample code from here : <h...
2013/05/23
[ "https://Stackoverflow.com/questions/16713914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/720954/" ]
First of all, your understanding of the app's functionality is correct. Whenever you enter/leave one of your geofences it shows you that in a notification (it's always updating the same notification btw, so keep an eye out for it or you might miss one of the events). Second, be careful because Geofence 1, by default, ...
I tried the GeofenceDetection sample code and it is working. I am using only Wifi and GPS, and set my radius to be 15 meters. When i walked to the region, it is not immediately show the notification. After a few seconds, i got "enter" notification. Also, even if i am standing still in the region, sometimes i got notifi...
68,622,755
I want to scrape web and the structure looks like: ``` <iframe> #document <html> ...... </html> </iframe> ``` I need to step into "html" and click the button but I can't find a way to go inside. Is there any method to click button inside the "#tag\_name"?
2021/08/02
[ "https://Stackoverflow.com/questions/68622755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9540366/" ]
[adam-smooch](https://stackoverflow.com/users/10761353/adam-smooch) he was right I think ``` sub_lists=[(1,None,None,12,None,None,None),(2,67,None,None,None,None,None),(2,None,None,83,None,None,None)] def my_combine(l1, l2): l1 = list(l1) l2 = list(l2) for i in range(len(l1)): if l1[i] is None: l1[i]...
since sub-lists' first numbers will be unique at the end, you could use a dictionary. so do something like: ``` def my_combine(l1, l2): l1 = list(l1) for i in range(len(l1)): if l1[i] is None: l1[i] = l2[i] return tuple(l1) results = dict() for sl in sub_lists: if sl[0] not in results: results...
40,164,782
The question posed was: Given an integer 0 < N < 1000000000000 return the highest number of consecutive digits in the number. For example in the number 9934445666644 the answer would be 4 because there are: ``` 2x 9 1x 3 3x 4 1x 5 4x 6 2x 4 ``` In the number provided. I know I can solve the problem with some counter...
2016/10/20
[ "https://Stackoverflow.com/questions/40164782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3983926/" ]
You may extract all chunks of consecutive identical characters (here, we may just match digits) and then find the longest match. The regex looks rather basic: ``` /(\d)\1*/g ``` It will match and capture into Group 1 a digit (see `(\d)`) and then zero or more (due to `*` quantifier) values captured in Group 1. Tha...
You can use a `for` loop, set property name of an array to number, increment property value if object property name is matched at nested `for` loop which iterates from current index + 1 until end of input. Return array having first element set to index of beginning of the greatest sequence of matching characters at o...