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
39,368,009
I have 3 network nodes running neutron-server .. Only one of these nodes is attached to the external network I use ml2 with openvswitch in the bridge mapping of the node connected to the external network - VIA FLOATING IPS - , i have external\_net mapped to the correct bridge .. On the other nodes i do not have th...
2016/09/07
[ "https://Stackoverflow.com/questions/39368009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2924795/" ]
**Update**: Tim Biegeleisen's answer is more correct. You need to do a join on the two tables like that: ``` SELECT T1.id, T1.open, T1.receive+T2.receive, T1.close FROM T1 JOIN T2 USING (id); ``` **Edit**: If you want to update `T1`, you can do it like that: ``` UPDATE T1 SET receive=receive+coalesce((SELECT recei...
``` SELECT T1.name, T1.open, T1.receive + COALESCE(T2.receive, 0) AS receive, T1.close - COALESCE(T2.receive, 0) AS close FROM T1 LEFT JOIN T2 ON T1.Id = T2.Id ``` If you want to `UPDATE` the first table, you can try this: ``` UPDATE T1 SET T1.recieve = T1.recieve + (SELECT COALESCE(T2...
12,807,539
I'm writing an application that takes arbitrary command line arguments, and then passes them onto a python function: ``` $ myscript.py --arg1=1 --arg2=foobar --arg1=4 ``` and then inside myscript.py: ``` import sys argsdict = some_function(sys.argv) ``` where `argsdict` looks like this: ``` {'arg1': ['1', '4'], ...
2012/10/09
[ "https://Stackoverflow.com/questions/12807539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/118495/" ]
Here's an example using `argparse`, although it's a stretch. I wouldn't call this complete solution, but rather a good start. ``` class StoreInDict(argparse.Action): def __call__(self, parser, namespace, values, option_string=None): d = getattr(namespace, self.dest) for opt in values: k...
If you really want to write something of your own instead of a proper command-line parsing library, for your input this should work: ``` dict(map(lambda x: x.lstrip('-').split('='),sys.argv[1:])) ``` You'll want to add something to catch arguments without an '=' in them.
3,815
I'm currently using the old Apple Mighty Mouse and I configured clicking on the trackball as a "middle click" that's been very handy for opening links in new tabs, closing tabs, etc. However, the mouse is starting to show its age and I've been looking at Apple's Magic Mouse and Magic Trackpad, and I'm wondering - do ei...
2010/11/09
[ "https://apple.stackexchange.com/questions/3815", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/1570/" ]
Our friends over at [SuperUser have an answer for us](https://superuser.com/questions/62762/how-to-enable-middle-button-with-apples-new-magic-mouse): > > Here are two utilities that will allow you to customize gestures on the Magic Mouse, including adding middle click: > > > * [MagicPrefs](http://magicprefs.com/) >...
[Multitouch](http://multitouch.app) is another option for adding "middle click" functionality to the Magic Mouse. (Disclaimer, I'm the developer.)
20,971,340
I am trying to make the black `div` (relative) above the second yellow one (absolute). The black `div`'s parent has a position absolute, too. ```css #relative { position: relative; width: 40px; height: 100px; background: #000; z-index: 1; margin-top: 30px; } .absolute { position: absolute; top: 0; le...
2014/01/07
[ "https://Stackoverflow.com/questions/20971340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1447267/" ]
This is because of the [Stacking Context](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Understanding_z_index/The_stacking_context), setting a z-index will make it apply to all children as well. You could make the two `<div>`s siblings instead of descendants. ``` <div class="absolute"></div> <div id="relativ...
I was struggling to figure it out how to put a div over an image like this: [![z-index working](https://i.stack.imgur.com/fHSWj.png)](https://i.stack.imgur.com/fHSWj.png) No matter how I configured z-index in both divs (the image wrapper) and the section I was getting this: [![z-index Not working](https://i.stack.img...
15,095,756
I've thoroughly looked for an answer but everything seems to only give me half of what I need, which is how I managed to get this started. What I'm trying to do is enable a dropdown menu when a checkbox is checked, but keep it disabled otherwise. I'm not really sure how to call the function in the tag, but then again i...
2013/02/26
[ "https://Stackoverflow.com/questions/15095756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2112319/" ]
I'm not 100% clear on your question, but it sounds like you want your substitute date evaluated in the `WHERE` clause, even though you have not included the `NVL()`. Have you tried this: ``` select a.id, title, body, NVL(a.to_date, to_date('9999-12-31 23:59:59', 'YYYY-MM-DD HH24:MI:SS')) as todate, cr_date...
The basic problem is that the 'display labels' or 'column aliases' are not available for use in the body of the query (the WHERE clause). You could get around this using a sub-query: ``` SELECT id, title, body, to_date, cr_date FROM (SELECT a.id, a.title, b.body, NVL(a.to...
2,138,600
i have the following code: ``` function tryToDownload(url) { oIFrm = document.getElementById('download'); oIFrm.src = url; //alert(url); } function downloadIt(file) { var text = $("#downloaded").text(); setTimeout(function(){ $("#downloadBar").slideDown("fast") }, 700); setTimeout('tryToDownlo...
2010/01/26
[ "https://Stackoverflow.com/questions/2138600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259123/" ]
put this inside the **downloadIt()** function right after all the setTimeOuts are called ``` var curr_val = $('#downloaded').text(); var new_val = parseInt(curr_val)+1; $('#downloaded').text(new_val); ```
Something like this will do: ``` i = parseInt($("#downloaded").text()); $("#downloaded").text((i+1)); ```
67,651,665
I have a functions.py file with all my functions. I want to print a variable from the main.py file which was created in a funtions in the function.py file. How can i do that? functions.py: ``` from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_co...
2021/05/22
[ "https://Stackoverflow.com/questions/67651665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15994222/" ]
Have your tried with something like this? ```py print(functions.atr) ``` Here is an example that works for me: main.py: ```py import functions print("hello from main!") print(functions.hello) functions.funky() # this changes the value print(functions.hello) ``` functions.py: ```py hello = 4 # here the global v...
In your main function, you can take the result of any function in a variable then print ``` trade = open_tradeview() atr = get_atr_price() print(trade) print(atr) ```
1,237,590
In *Additional Drivers* under Software & Updates, the NVIDIA driver is stuck on *Continue using a manually installed driver*, and all other options are greyed out. I want to set the driver to proprietary driver(`nvidia-driver-390`), which was originally selected before I changed it to the open source driver, but now i...
2020/05/09
[ "https://askubuntu.com/questions/1237590", "https://askubuntu.com", "https://askubuntu.com/users/311423/" ]
This problem should be fixed by running ``` sudo ubuntu-drivers install ``` after a reboot.
I also couldn't update to a newer Nvidia driver because a manual driver was installed, in my case from 470 to 510 driver on an Focal Desktop system of Canonical. My solution was: 1. Open a terminal and run the command: ``` sudo ubuntu-drivers autoinstall ``` The above will install the newest recommended driver. 2....
39,629,786
I've whiteboarded this out, and cannot seem to understand why I am getting an out of memory error. The project is to create a linked list and some of its methods from scratch. My other functions are good to go, but this swap function is giving me a lot of trouble. When I run the debugger, the program crashes on the p...
2016/09/22
[ "https://Stackoverflow.com/questions/39629786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3545786/" ]
You just need to remove the dashes, do a loop over all the characters, parse them as integers, and add them up. ``` var s = "5246-9346-7341-8534"; var sum = 0; var i; s = s.replace(/-/g, ""); for (i = 0; i < s.length; i++) { sum += parseInt(s.substr(i, 1)); } console.log(s, "=", sum); // 74 ``` (I didn't just do...
Replace the hyphens - iterate through the string and add the parsed Number to a total - display the total (74). Note that I added this to an input so that you could add a button and create a named function that allows you to add other numbers. ```js function addMe(){ var inputVal = document.getElementById('inputNum...
261,539
Getting **Invalid Form Key. Please refresh the page** error not able to do any action after upgrade of **Magento 2.2.5 to Magento 2.3**.
2019/02/13
[ "https://magento.stackexchange.com/questions/261539", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/76119/" ]
Finally I got the solution I have a custom payment method that uses the cc-form to take credit card payments with and without 3dsecure. After placing order with 3dsecure, I am re-directing to 3dsecure page as normal, but on returning from 3dsecure, I am re-directed to the home page with "Invalid Form Key. Please refre...
``` use Magento\Framework\App\CsrfAwareActionInterface; use Magento\Framework\App\Request\InvalidRequestException; use Magento\Framework\App\RequestInterface; class CustomPaymentResponse extends \Magento\Framework\App\Action\Action implements CsrfAwareActionInterface /** * @inheritDoc *...
861,296
I understand that only one instance of any object according to .equals() is allowed in a Set and that you shouldn't "need to" get an object from the Set if you already have an equivalent object, but I would still like to have a .get() method that returns the actual instance of the object in the Set (or null) given an e...
2009/05/14
[ "https://Stackoverflow.com/questions/861296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/106781/" ]
Well, if you've already "got" the thing from the set, you don't need to get() it, do you? ;-) Your approach of using a Map is The Right Thing, I think. It sounds like you're trying to "canonicalize" objects via their equals() method, which I've always accomplished using a Map as you suggest.
It's just an opinion. I believe we need to understand that we have several java class without fields/properties, i.e. only methods. In that case equals cannot be measured by comparing function, one such example is requestHandlers. See the below example of a JAX-RS application. In this context SET makes more sense then ...
28,615,922
I am a web developer and do not have any experience with developing mobile friendly websites. When we are developing a mobile friendly website, do we need to create separate files for mobile version? Or can we use same files that we created for desktop version?
2015/02/19
[ "https://Stackoverflow.com/questions/28615922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2384770/" ]
If you are going to develop a big site like flipkart, ebay or facebook, then its better you do separate mobile version, because such type of websites will take more time to load in mobiles. You need to display only relevant content in mobiles. If its a simple website, better use Bootstrap.
Both you can make one file launch another, or have one big monster file. [How to detect Safari, Chrome, IE, Firefox and Opera browser?](https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser) But I think this might be more of what your looking for.
5,381,526
What are the generic cookie limits for modern browsers, as of 2011? I'm particularly interested in: * Max size of a single cookie * Max number of cookies per host/domain name + path * Max number of cookies per host/domain name * Max number / max total size of all cookies in a given browser I'm aware of [RFC 2109](htt...
2011/03/21
[ "https://Stackoverflow.com/questions/5381526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/487064/" ]
Here's a handy tool to test it: <http://browsercookielimits.iain.guru/> It reveals quite a lot about the internal details regarding cookies. Click "Run Tests for Current Browser" for the results (it only takes a moment). For example, I ran all tests for Google Chrome 10.0.648.134 beta: ``` 22:23:46.639: Starting 22:...
In Firefox >= 63, the max number of cookies per domain is [180](https://bugzilla.mozilla.org/show_bug.cgi?id=1460251), cf pref "network.cookie.maxPerHost". When it reaches the limit, it will drop stale cookies, then drop [non secure cookies](https://bugzilla.mozilla.org/show_bug.cgi?id=1357676). If nothing works, it wi...
9,661,045
I have an HTML file and I want to take grab the text from this block, shown here: ``` <strong class="fullname js-action-profile-name">User Name</strong> <span>&rlm;</span> <span class="username js-action-profile-name"><s>@</s><b>UserName</b></span> ``` I want it to display as: ``` User Name @UserName ```...
2012/03/12
[ "https://Stackoverflow.com/questions/9661045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1224640/" ]
``` from bs4 import BeautifulSoup html = '''<strong class="fullname js-action-profile-name">User Name</strong> <span>&rlm;</span> <span class="username js-action-profile-name"><s>@</s><b>UserName</b></span>''' soup = BeautifulSoup(html) username = soup.find(attrs={'class':'username js-action-profile-name'})....
This assumes *index.html* contains the markup from the question: ``` import BeautifulSoup def displayUserInfo(): soup = BeautifulSoup.BeautifulSoup(open("index.html")) fullname_ele = soup.find(attrs={"class": "fullname js-action-profile-name"}) fullname = fullname_ele.contents[0] print fullname ...
399,464
I spun up a Remote Desktop Server instance on Amazon's Virtual Private Cloud service... What's the best/easiest way to print from the VPC to local printers? The local printers are IP based, but not "cloud printers". I'm familiar with how Cloud Printing works for Chrome, but is there a way to install a cloud printer a...
2012/06/16
[ "https://serverfault.com/questions/399464", "https://serverfault.com", "https://serverfault.com/users/61373/" ]
There is a new [blog post from VMware](http://blogs.vmware.com/vsphere/2013/10/are-esxi-patches-cumulative.html?utm_source=dlvr.it&utm_medium=twitter) The relevant summary is: > > In short, the answer is yes, the ESXi patch bundles are cumulative. However, when applying patches from the command line using the ESXCLI...
ewwhite, You may have already come across this article but I had it bookmarked awhile back: <http://blogs.vmware.com/vsphere/2012/02/understanding-esxi-patches-finding-patches.html> Hopefully this helps
28,702,372
By default if I am not logged and I try visit this in browser: ``` http://localhost:8000/home ``` It redirect me to `http://localhost:8000/auth/login` How can I change to redirect me to `http://localhost:8000/login`
2015/02/24
[ "https://Stackoverflow.com/questions/28702372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4207462/" ]
Just to extend @ultimate's answer: 1. You need to modify `App\Http\Middleware\Authenticate::handle()` method and change `auth/login` to `/login`. 2. Than you need to add `$loginPath` property to your `\App\Http\Controllers\Auth\AuthController` class. Why? See [Laravel source](https://github.com/laravel/framework/blob/...
Authentication checks are made using middleware in Laravel 5. And the middleware for auth is `App\Http\Middleware\Authenticate`. So, you can change it in `handle` method of the middleware.
7,424,210
I'm building my first game in Java, from scratch. I've decided that the GameWorld class, that centralizes the main operations of the game (handling input, etc), would be best implemented as a singleton (using an enum). The relevant code for the enum is below. ``` public enum GameWorld { INSTANCE; private stati...
2011/09/14
[ "https://Stackoverflow.com/questions/7424210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/599050/" ]
You are turning yourself in circles. You want to initialize the `GameWorld.INSTANCE` variable. Before you can do that, you have to initialize all the fields of the `GameWorld` class. After initializing all the field, the variable `INSTANCE` will be assigned. Before that happens, it still has the default value of `null...
I didn't see any guarantee that the expression ``` InputController.getInput() ``` returns non-null. And since your code is very debugging-friendly (at least one NullPointerException per line) it should be trivial to see which variable is null. As I said, I suspect `input`.
21,302,623
I am rewriting my website URL with .htaccess but facing issues, I didnt know about rewrite URL, I just copy and paste the code from internet, ``` RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/\.]+)/?$ page.php? [L,QSA] ``` This works for me and redirects, *...
2014/01/23
[ "https://Stackoverflow.com/questions/21302623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2379039/" ]
again :), this domain class is generated by spring-security-plugin and its use isn't to be exposed directly to web. Normally grails scaffolding isn't applied to this domain class, but only to user and role domain class with some correction. If your need is to administrate roles,users and relations between users and rol...
I think that in this case it should be something like (for show() method): ``` def show(Long secUserId, Long secRoleId) { def secUserSecRoleInstance = SecUserSecRole.get(secUserId, secRoleId) if (!secUserSecRoleInstance) { flash.message = message(code: 'default.not.found.message', args: [message(code: ...
263,092
I'm trying to build a simple low-power water level alarm such that it could run continuously for at least 4 months on just 3x AA batteries. I've found this schematic which uses the 555 timer: [![enter image description here](https://i.stack.imgur.com/hmYaY.jpg)](https://i.stack.imgur.com/hmYaY.jpg) However, the 555 t...
2016/10/12
[ "https://electronics.stackexchange.com/questions/263092", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/80217/" ]
I assume that you are using BLE or similar. Be aware that RSSI is a very blunt instrument indeed and needs both understanding and a degree of magic to work well. There is only so much magic available in an office building and if you expect consistent fine precision you will be disappointed. If working in air (e...
If you want to calculate the path loss exponent 'n' you would first need to train the linear or straight line model. You can do this by determining the path loss for a range of distances within the region of interest. The path loss exponent can then be determined by fitting a straight line to the distance vs path loss ...
6,441
If I try to open an MP4 file made by a Sony Webbie in Sony Vegas Platinum 6, it won't open. (Something made me think they would work together.) The Webbie files are H264. It will happily play MP4/H263. Is there a codec or something I can download?
2009/07/16
[ "https://superuser.com/questions/6441", "https://superuser.com", "https://superuser.com/users/1782/" ]
Youtube have a guide on ideal video settings for uploading: ["Getting Started: Optimizing your video uploads"](http://www.google.com/support/youtube/bin/answer.py?answer=132460&topic=16612&hl=en-US) > > Video > ----- > > > * **Resolution:** Recommended: 1280 x 720 (16x9 HD) and 640 x 480 (4:3 SD) > > > There is n...
YouTube recommends MPEG4 compression. I'd try the mpeg4/improved profile (if you're using the export using quicktime option). iMovie also has a built in export to YouTube setting (at least it did in iMovie '08) which is probably more than adequate. YouTube is going to re-compress the video in any case, so you don't re...
63,994,870
I made a simple calculator with javascript , but when i want to validate input , it display Nan, and if statement not worked to validate empty input ? How to fix this and how to validate empty input by this form and how to remove the Nan Text displayed after empty input submit ? ```js let b = document.querySelector("#...
2020/09/21
[ "https://Stackoverflow.com/questions/63994870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10687872/" ]
```js let b = document.querySelector("#submit"); b.addEventListener("click", function() { let c = document.querySelector("#plus").value; let d = document.querySelector("#minus").value; if(c !== "" && d !== ""){ let result = document.querySelector(".result"); let output = parseInt(c) + parseInt(d); r...
I made a else if statement for this code when the first input has value and the second input has no value Any suggestions? ```js if (c == "" && d == "") { console.log("Wrong"); error.innerHTML = "<h1>Write Number Please>/h1> "; } else if(c == "" && d >=0 || c>= 0 && d=="") { console.log("write value ...
31,513
It is true that $\phi(p) = (p-1)$ only if p is a prime. I had also proven (I am not sure if this is a trivial fact or not) that $\phi(pq) = (p-1)(q-1)$ only if p and q are distinct primes. However, I am having difficulty generalizing the result. It certainly seems true that if $\phi(p\_1\cdot p\_2\cdots p\_n) = (p\_1 ...
2011/04/07
[ "https://math.stackexchange.com/questions/31513", "https://math.stackexchange.com", "https://math.stackexchange.com/users/9246/" ]
The general result sought is wrong. For example $$\phi(4 \times 4 \times 4 \times 9 \times 9)=\phi(64)\phi(81)=(32)(54)$$. Note that $$(4-1)(4-1)(4-1)(9-1)(9-1)=(27)(64)=(32)(54)$$ So in general $\phi(a\_1a\_2\cdots a\_n)=(a\_1-1)(a\_2-1)\cdots(a\_n-1)$ does not imply that the $a\_i$ are distinct primes. I expect t...
The above-stated conjecture has infinitely many counterexamples. Namely $$\rm\phi(p\_1\cdot p\_2\cdots p\_n)\ =\ (p\_1 - 1)\ (p\_2 - 1)\cdots (p\_n-1)\ \ \Rightarrow\ \ p\_i\ distinct\ primes$$ is false for all primes $\rm\:p > 3\:$ in the following examples $$\rm\ \phi(3\cdot 3\cdot 4\cdot p)\ =\ 2\cdot 2\cdot 3\cd...
34,450
This has been bugging me for a while, and despite googling around, I cannot seem to even find an explanation as to why the "Create Application Shortcut" is disabled.
2011/12/22
[ "https://apple.stackexchange.com/questions/34450", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/15411/" ]
Unfortunately, the answer to your question is "you can't," and the reason is "because Google says so. <http://support.google.com/chrome/bin/answer.py?hl=en&answer=95710> says > > This feature is only available for Google Chrome on Windows and Linux. > > > but there is no real explanation as to why. Nor have I f...
Or you can create an [electron](http://electron.atom.io) "app" from the website. Not nearly as simple as it should be with Chrome, but <https://github.com/jiahaog/nativefier> makes it a bit easier.
285,200
Was given a 2009 Macbook Pro after original owner attempted to hard reset. Reinstall of OS X unsuccessful from OS X Utilities. I get as far as agreeing to terms, and signing in to App Store with my Apple ID, and then get this message: "This item is temporarily unavailable. Try again later." I start school tomorrow and ...
2017/05/29
[ "https://apple.stackexchange.com/questions/285200", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/239639/" ]
Let me add this as a viable alternative for "if ya just gotta have it right now" Take it to an Apple Store - they'll do it for you.
Login with the original owners Apple ID - old copies of OS X are not available unless your Apple ID has a license for it.
6,030,071
``` UPDATE AggregatedData SET datenum="734152.979166667", Timestamp="2010-01-14 23:30:00.000" WHERE datenum="734152.979166667"; ``` It works if the `datenum` exists, but I want to insert this data as a new row if the `datenum` does not exist. UPDATE the datenum is unique but that's not the primary key
2011/05/17
[ "https://Stackoverflow.com/questions/6030071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/611116/" ]
Try using [this](http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html): > > If you specify `ON DUPLICATE KEY UPDATE`, and a row is inserted that would cause a duplicate value in a `UNIQUE index or`PRIMARY KEY`, MySQL performs an [`UPDATE`](<http://dev.mysql.com/doc/refman/5.7/en/update.html>) of the old ro...
This is not too bad, but we could actually combine everything into one query. I found different solutions on the internet. The simplest, but `MySQL only solution` is this: ``` INSERT INTO wp_postmeta (post_id, meta_key) SELECT ?id, ‘page_title’ FROM DUAL WHERE NOT EXISTS ( SELECT meta_id ...
79,600
I've read all the bad things that can happen from garlic infused oil like homemade. How is this different than let's say Pizza Hut's garlic butter, or their (dry) breadstick seasoning with cheeses and dehydraded garlic? Do they in fact have a safer method that literally reduces the risk or what? I see the garlic butte...
2017/04/02
[ "https://cooking.stackexchange.com/questions/79600", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/55741/" ]
What you are seeking are [natural food dyes](https://duckduckgo.com/?q=natural%20food%20dyes&t=ffnt&ia=web) (or [natural food colorings](https://duckduckgo.com/?q=natural%20food%20colorings&t=ffnt&ia=web)). These are commercially available and you may find them at a local health or natural foods store or even a qualit...
Suggestions: * Using a stencil, a seive and some icing sugar, you can create simple decorations known as [cake dusting](https://www.recipetips.com/kitchen-tips/t--1644/cake-dusting.asp) ![cake dusting](https://i.pinimg.com/originals/cd/c6/fc/cdc6fc33c85f956318dd1de4c11d007b.jpg) * Consider using chocolate icing * ...
4,351,165
I have a `startDate` and an `endDate` as an input parameters. This parameters are used in the query say: ```sql SELECT * FROM patientRecords WHERE patientRecords.dateOfdischarge BETWEEN $P{startDate} AND $P{endDate} ``` Now, since the `startDate` and `endDate` are the parameters which are passed to the `JasperRepo...
2010/12/04
[ "https://Stackoverflow.com/questions/4351165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
U can try change the patern from propertise>textfield propertise or u can try this to\_char(tablename.fieldname, 'mm/dd/yyyy') as fieldname
Try this format it will work if you are using Mysql database date\_column\_name between date\_format($P{start\_date},'%Y-%m-%d') and date\_format($P{end\_date},'%Y-%m-%d') date\_column\_name between date\_format($P{start\_date},'%Y-%m-%d') and date\_format($P{end\_date},'%Y-%m-%d')
363,076
Does the sequence defined by $$x\_{n} =\left(\sqrt[n]{e}-1\right)\cdot n$$ converge. For finding the limit one has to solve for $\displaystyle\lim\_{x \to \infty} x\_{n}$ which I think I can solve, but how do I prove that it converges/diverges.
2013/04/16
[ "https://math.stackexchange.com/questions/363076", "https://math.stackexchange.com", "https://math.stackexchange.com/users/72792/" ]
Set $x=\frac{1}{n}$. Then the limit becomes $$\lim\_{n\to\infty}\dfrac{\sqrt[n]{e}-1}{\frac{1}{n}}=\lim\_{x\to0}\dfrac{e^x-1}{x}.$$ Can you proceed? Hint: Derivatives.
Here is an approach purely based on the ideas of sequences . Let $ x\_n=\bigg(1- \dfrac1n\bigg)^n$ , then $x\_{n+1}=\bigg(1- \dfrac1{n+1}\bigg)^{n+1}=\dfrac 1{\bigg(1+ \dfrac1n\bigg)^n\bigg(1+ \dfrac1n\bigg)}$ , so $(x\_{n+1})$ is convergent hence $(x\_n)$ is convergent and $\lim (x\_n)=\lim (x\_{n+1})=\dfrac1e$. Now...
56,662,199
I have two lists that I will later use do determine on how many pages of a document I'm looking at. The first list (l\_name) contains the name of the document. The second list (l\_depth) contains the number of pages I will look at, always starting from the first one. The original lists look like this: ``` l_name = ['...
2019/06/19
[ "https://Stackoverflow.com/questions/56662199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9092346/" ]
Try this : ``` l_name = ['Doc_1', 'Doc_2', 'Doc_3'] l_depth = [1, 3, 2] l_doc = [] for i,j in zip(l_name, l_depth): l_doc += [i]*j # ['Doc_1', 'Doc_2', 'Doc_2', 'Doc_2', 'Doc_3', 'Doc_3'] l_page = [k for _,j in zip(l_name, l_depth) for k in range(1,j+1)] # [1, 1, 2, 3, 1, 2] ```
``` l_name = ['Doc_1', 'Doc_2', 'Doc_3'] l_depth = [1, 3, 2] l_doc = [] l_page = [] for i, j in zip(l_name, l_depth): l_doc += [i] * j l_page += range(1, j + 1) print(l_doc) print(l_page) ```
68,737,526
I'm using [email-template](https://www.npmjs.com/package/email-templates) package for sending styled emails. Everything seems to work fine in preview of email (preview option is given in package itself. it renders sent email preview in tab if placed true). but when I get email in my gmail account images are not visible...
2021/08/11
[ "https://Stackoverflow.com/questions/68737526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3728916/" ]
When you load an HTML page and use the image like below ``` <img src="icon-linkedin.png" width="40" height="auto" /> ``` It actually tells the browser that, load the image from the same directory from where you loaded the HTML page. Here comes the problem. When your email is loaded in the `Gmail` it will also...
[According to the docs for `nodemailer-base64-to-s3`](https://github.com/forwardemail/nodemailer-base64-to-s3#options), you need to pass in some configuration options to the `base64ToS3` method. It says the `aws/params/Bucket` is required. I believe the following should give you a good start: ``` smtpTransport.use('...
30,128,178
I'm trying to simulate a scroll event with ReactJS and JSDOM. Initially I tried the following: ``` var footer = TestUtils.findRenderedDOMComponentWithClass(Component, 'footer'); footer.scrollTop = 500; TestUtils.Simulate.scroll(footer.getDOMNode()); //I tried this as well, but no luck //TestUtils.Simulate.scroll(foot...
2015/05/08
[ "https://Stackoverflow.com/questions/30128178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/510573/" ]
My situation may be different than the OP's, but I was struggling with the a similar problem and found my way here after lots and lots of searching. I realized the crux of my problem was that `TestUtils.Simulate.scroll()` only simulates a scroll event dispatched by a specific React component (e.g. when you have `overfl...
Judging from [this](https://stackoverflow.com/questions/26717499/testing-for-mouse-wheel-events) and [this](https://developer.mozilla.org/en-US/docs/Web/Events/wheel), I believe TestUtils simulates the scrolling via a `WheelEvent`, which means it needs a `deltaY` parameter to know how far to scroll. That would look lik...
51,842,493
I am already using [JsonSerializer](https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonSerializer.htm) of [Newtonesoft Package](https://www.newtonsoft.com/) to convert strings to JSON format ,but it can't convert this string to JSON. ``` { "isSuccess": true, "elapsed": 54, "results": { ...
2018/08/14
[ "https://Stackoverflow.com/questions/51842493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5516527/" ]
As you can't change the Json's format, I'd say the following class should work as expected: ``` public class UpdateResultSt { public bool isSuccess { get; set; } public int elapsed { get; set; } public Dictionary<string,string> results { get; set; } public Dictionary<string,string> errors { get; set; ...
The format of SuccessfulUpdateResult and FailedUpdateResult are not correct. It should be like this: ``` { "isSuccess": true, "elapsed": 54, "results": [ 0: { "id" : "131351990802396920", "text" : "updated"}, 1: { "id" :"21034623651844830", "text" : "updated"}, 2: { "id" :"11220101...
424,775
sudo (Which I have configured to ask for a password) is rejecting my password (as if I mis-typed it) I am absolutely not typing it incorrectly. I have changed the password temporarily to alphabetic characters only, and it looks fine in plaintext, in the same terminal. I have my username configured thus: ``` myusername...
2012/09/06
[ "https://serverfault.com/questions/424775", "https://serverfault.com", "https://serverfault.com/users/134857/" ]
Another possible cause is that systemd-homed is not running. Check it's status with ``` systemctl status systemd-homed ``` If it says something other than active, use ``` systemctl start systemd-homed ``` to start it again. Note that you need superuser privileges in order to run that command. As sudo is not worki...
Oh what the heck, here was the issue, I guess? <https://bbs.archlinux.org/viewtopic.php?id=142720> ``` pacman -S pambase ``` fixes it.
10,132,556
I'm trying to start a Skype intent from my Android App, passing a phone number. So far, thanks to other people who ad similiar needs here on stackoverflow, I've managed to start skype, but still I can't pass the phone number. This is the code I'm using: ``` Intent sky = new Intent("android.intent.action.CALL_PRIVILEG...
2012/04/12
[ "https://Stackoverflow.com/questions/10132556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/552260/" ]
See this answer: <https://stackoverflow.com/a/8844526/819355> Jeff suggests using a `skype:<user name>` instead of `tel:<phone number>` After some studing of the skype apk with apktool, as suggested in that answer, I came up with this code, for me it's working: ``` public static void skype(String number, Context ct...
Refer this skype doc link [Skype URI tutorial: Android apps](https://learn.microsoft.com/en-us/skype-sdk/skypeuris/skypeuritutorial_androidapps) > > First need to check skype is installed or not using > > > ``` /** * Determine whether the Skype for Android client is installed on this device. */ public boolean i...
32,423,636
There are countless questions here, how to solve the "could not initialize proxy" problem via eager fetching, keeping the transaction open, opening another one, `OpenEntityManagerInViewFilter`, and whatever. But is it possible to simply tell Hibernate to ignore the problem and pretend the collection is empty? In my ca...
2015/09/06
[ "https://Stackoverflow.com/questions/32423636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/581205/" ]
You could utilize [Hibernate.isInitialized](https://docs.jboss.org/hibernate/orm/4.3/javadocs/org/hibernate/Hibernate.html#isInitialized%28java.lang.Object%29), which is part of the Hibernate public API. So, in the `TypeAdapter` you can add something like this: ``` if ((value instanceof Collection) && !Hibernate.isIn...
What you can try is a solution like the following. Creating an interface named `LazyLoader` ``` @FunctionalInterface // Java 8 public interface LazyLoader<T> { void load(T t); } ``` And in your Service ``` public class Service { List<Master> getWithDetails(LazyLoader<Master> loader) { // Code to ...
31,369,916
I am using Kali linux 64 bit and I am trying to execute the following programs from Dr. Paul carter's website. The gcc command is giving errors. What should I use in the gcc command? ``` nasm -f elf32 array1.asm root@kali:assembly# gcc -o array1 array1.o array1c.c array1c.c:9:1: warning: ‘cdecl’ attribute ignored [-Wa...
2015/07/12
[ "https://Stackoverflow.com/questions/31369916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4277517/" ]
First install this: ``` sudo apt-get install gcc-multilib g++-multilib ``` then Assemeble and link in this way: ``` nasm -f elf array1.asm -o array1.o ``` And finaly, ``` gcc -m32 array1.o -o array1.out ``` and run, ``` ./array1.out ``` This should work......
(oops, I only skimmed the question, and thought you were making a standalone executable with just `ld`. See cad's answer for `gcc -m32`, for when you do want to link with libc and all that, rather than just try some little experiment as a standalone.) You have to tell `ld` what machine you want the output to be for. I...
1,018,078
Are there any good tools to easily test how HTML email will look across different email clients? I prefer something with instant feed back rather than a submit and wait service like <http://litmusapp.com> Or at the very least a way to test the Outlook 2007/MS Word rendering? I found this related question but it doesn'...
2009/06/19
[ "https://Stackoverflow.com/questions/1018078", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796/" ]
Another thing you could try is to upload the html to a webpage and then open the webpage in word to test Outlook.
Direct Mail is an OS X desktop app that can show you previews of what your email will look like in a variety of email clients: <http://directmailmac.com/mac-email-design/> Full Disclosure: I work for the developers of Direct Mail
58,338,247
hello i get data in sqlite code : ``` getuserIDPW(String email) async{ final db = await database; var res = await db.query("person",columns: ['email', 'password'] ,where: "email = ?", whereArgs: [email]); return res.isNotEmpty? res : Null; } ``` code : ``` var useridpw = await DBHelper().getuserIDPW(_...
2019/10/11
[ "https://Stackoverflow.com/questions/58338247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12061705/" ]
I had same issue but I resolved following below steps : I am on Windows server . Mongo DB shell version 3.0.4 . Error in below screen shot same as you mentioned [![enter image description here](https://i.stack.imgur.com/gqF1A.png)](https://i.stack.imgur.com/gqF1A.png) So I connect to Mongo shell switch to local . U...
I'm using [bitnami/mongodb](https://github.com/bitnami/charts/tree/master/bitnami/mongodb) helm chart to deploy mongodb to our custom k8s cluster and got this error when forgot to override `clusterDomain` variable in my `values.yaml` file because by default it was **`cluster.local`** and lead to run `rs.initiate` eval ...
47,508,790
I have the following JSON saved in a text file called test.xlsx.txt. The JSON is as follows: ``` {"RECONCILIATION": {0: "Successful"}, "ACCOUNT": {0: u"21599000"}, "DESCRIPTION": {0: u"USD to be accrued. "}, "PRODUCT": {0: "7500.0"}, "VALUE": {0: "7500.0"}, "AMOUNT": {0: "7500.0"}, "FORMULA": {0: "3 * 2500 "}} ``` T...
2017/11/27
[ "https://Stackoverflow.com/questions/47508790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3163920/" ]
Your txt file does not contain valid JSON. For starters, keys must be strings, not numbers. The `u"..."` notation is not valid either. You should fix your JSON first (maybe run it through a linter such as <https://jsonlint.com/> to make sure it's valid).
As Mike mentioned, your text file is not a valid JSON. It should be like: ``` {"RECONCILIATION": {"0": "Successful"}, "ACCOUNT": {"0": "21599000"}, "DESCRIPTION": {"0": "USD to be accrued. "}, "PRODUCT": {"0": "7500.0"}, "VALUE": {"0": "7500.0"}, "AMOUNT": {"0": "7500.0"}, "FORMULA": {"0": "3 * 2500 "}} ``` Note: k...
45,428,701
S3 bucket i want to save object such as image or video and want it to be protected and can access by authorised users only what should i do. One way is making url with token for particular time expired it after some time. Is any other way also to doing this.
2017/08/01
[ "https://Stackoverflow.com/questions/45428701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2813659/" ]
Objects in Amazon S3 are private by default. If you wish to only grant access to specific files to authorized users, you have a couple of options: * Use AWS credentials, or * Use pre-signed URLs If you wish your application to be able to access the objects, you can give **AWS credentials** to your application. This ...
This is an example of a solution which allows your system to access an AWS S3 object's contents internally without the need to assign an access token to the object. ``` <?php if (!defined('MY_AWS_AUTOLOADER_FILE_LOCATION')) { // Replace /var/www/html/aws/aws-autoloader.php with wherever your actual file is // Mak...
152,701
I heard about these dragons on this site and was curious to know, when do legendary dragons appear in the world? Is there a step-by-step guide to getting them to appear?
2014/01/28
[ "https://gaming.stackexchange.com/questions/152701", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/67678/" ]
There is a guaranteed spawn at Arcwind Point. [From Elder Scrolls Wikia](http://elderscrolls.wikia.com/wiki/Legendary_Dragon): > > A legendary dragon can also always be found at Arcwind Point perching > above a sarcophagus that contains either a Draugr Deathlord or a > Dragon Priest. > > > This spawning point st...
You need dawnguard and to be lvl 78+
297,526
Here's a problem that i've seen for the first time and unfortunatley after trying everything I still couldn't fix the issue. Any suggestions will be a great help. The issue is that when we try to open greenworldinvestor.com it takes awful amount of time to load. The browser keeps on showing that its trying to find gre...
2011/08/04
[ "https://serverfault.com/questions/297526", "https://serverfault.com", "https://serverfault.com/users/90480/" ]
From what I can see using the Chrome developer tools, your site is take a long time to serve the initial html of the page you request. I can say this isn't a DNS problem because, even if it were, only the first page requested would be slow. The client caches the DNS answer for a short time, so it wouldn't be slow on th...
Not sure what may causing this, but it definitly is your main html page that is slow to load (not to render, only to load). Your problem might come from a misconfigured PHP handler. Could you try putting a simple HTML page (with the same content as your index page) and see if it loads faster (my guess is yes). The...
3,183,064
> > **Possible Duplicates:** > > [For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subversion?](https://stackoverflow.com/questions/1218471/for-home-projects-can-mercurial-or-git-or-other-dvcs-provide-more-advantages-o) > > [What are the relative strengths and weaknesses of Gi...
2010/07/06
[ "https://Stackoverflow.com/questions/3183064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/375106/" ]
SVN is different from Git and Mercurial, in that it is a single repository that all users have to pull and commit to. Git and Mercurial have a distributed model. This means that there is a repository on every computer and there is usually an "Official" repository that people will choose to commit their changes to and ...
Git and Mercurial are quite similar (but different enough to warrant caution). SVN on the other hand is quite different: the first two are distributed VCSs, so they do not require a central server, while SVN does. In general many projects are moving toward distributed systems. For your small project, you're probably b...
156,500
How do I write an Excel workbook to a `MemoryStream` without first saving it to the file system? All options within the `Microsoft.Office.Interop.Excel.WorkBook` save options take a filename.
2008/10/01
[ "https://Stackoverflow.com/questions/156500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10830/" ]
I have done extensive work with the PIA and with storing Excel files in a document repository and streaming it out to the browser, and I have not been able to find a solution to using the PIA without first writing the contents to the file system first. I think that you are going to have to swallow the bullet and deal ...
The only way you could do this is if you were prepared to create a custom object that allowed you to store all the various bits and pieces of data/formulas/vba/links/ole objects that you wanted to keep, copy from your workbook to the object, and then persist that object to a memory stream. In affect using your proxy ob...
10,343,106
I've been using ``` mail -s "here is a log file" "person@example.com" < log/logfile.log ``` Which used to come through with headers: ``` User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit ``` But now the files are longer I'm getti...
2012/04/27
[ "https://Stackoverflow.com/questions/10343106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/516748/" ]
The man page is a good place to start! Keep reading until you get to the `MIME TYPES` section, and pay close attention the following: > > Otherwise, or if the filename has no extension, the content types > text/plain or application/octet-stream are > used, the first for text or international text files, the second ...
I had some trouble to get my automatic email scripts to run after changing to Ubuntu Precise 12.04. I don't know, when Ubuntu (or Debian) exchanged bsd-mailx against heirloom-mailx, but the two "mail"-commands behave very differently. (E.g. heirloom uses -a for attachments, while it's used for additional headers in bsd...
26,113,233
I have a build file in shell script which has a variable VAR, that has to be exported to a makefile. In the build file, ``` if [ "$arg" == "something" ]; then export VAR=$arg fi make ``` Now in the makefile, I need to use that variable in a conditional statement: ``` ifeq ( $(VAR),somethin...
2014/09/30
[ "https://Stackoverflow.com/questions/26113233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4091232/" ]
In shell script, ``` export VAR=hello make all ``` In makefile, ``` all : ifeq ($(VAR),hello) $(eval var1:="hello world in if block") else $(eval var1:="hello world in else block") endif @echo "$(var1)" ```
Your code does not work the way you expect, because you have an extra space before `$(VAR)`- it should be: ``` ifeq ($(VAR),something) ``` Spaces do matter in makefiles sometimes.
31,953
Proprietary software generally relies on the fact that in keeping the encryption algorithm private, it gets an extra layer of security implying "Security through Obscurity." Obviously this phrase has been hotly debated and surely is only acceptable if discovering the mechanics of a proprietary algorithm doesn't actuall...
2016/01/15
[ "https://crypto.stackexchange.com/questions/31953", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/28589/" ]
Generally speaking, using proprietary encryption is a major problem, because the algorithms which are used are not subject to the same amount of review they would be if public. But it is possible to gain some advantages this way, by taking advantage of public knowledge. Maurer & Massey (1993) prove that a cascade of c...
I think the answer is in some ways very obvious and in some ways less obvious. The advantage is that if it's proprietary, then that means you're almost certainly paying another party for it and therefore holding them responsible for reviewing, maintaining, and debugging the encryption library when problems arise. Con...
2,313,925
I'm writing a program where each component has an inheritance structure has three levels... ui, logic, and data... where each of these levels has an interface of defined functionality that all components must implement. Each of these levels also has some functionality that could be written generically for the whole int...
2010/02/22
[ "https://Stackoverflow.com/questions/2313925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/124034/" ]
Why not have each one of the components (UI, logic and data) in a different class and then have the UI using the logic class then have the logic class use the data class. That way you could have each class inherit from the appropriate generic class. Remember, you should [prefer composition over inheritance](https://s...
Each (abstract class & interface) offers their own set of advantages and disadvantages. While Russell is correct in suggesting *composition over inheritance*, using patterns suggests *program to an interface, not an implementation* (Head First Design Patterns). An abstract class offers tons of flexibility where you ca...
876,775
Can data be recovered from a "broken SSD" in a similar manner as from an HDD? Or once the drive is "broken" is the data "toast"? EDIT: I don't mean using the same methods. I am just trying to find out if data is generally recoverable or not.
2015/02/11
[ "https://superuser.com/questions/876775", "https://superuser.com", "https://superuser.com/users/11546/" ]
NAND chips are typically standardized parts with datasheets available. All the ones I've seen on flash drives are BGA mounted, which is difficult to remove and work with, but not impossible. So it's not impossible for someone to pull chips off the board and read them in another device. Getting meaningful data off of t...
Unlike an HDD, an SSD has no separate electronics board that controls/reads/writes to platters inside the capsule -- which is one of the biggest tricks to recovering data from a physically damaged or electronically "fried" HDD: you can plug in a good controller board and the data inside the capsule is usually (mostly) ...
13,468,248
I have a list of type object as follows, `List<object>` recordList which will contain database record(integer,string) as follows, ``` [[1,AAAAAAAA],[2,BBBBBB]] ``` I need to split the data in the list and put into `Hashmap<Integer,String>` as follows, I do knw how to split the data form the object list and popl...
2012/11/20
[ "https://Stackoverflow.com/questions/13468248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1321824/" ]
``` List<String> l = new ArrayList<String>(); Map<Integer,String> m = new HashMap<Integer, String>(); Iterator<String> ite = l.iterator(); while(ite.hasNext()) { String sTemp[] =ite.next().split(","); m.put(Integer.parseInt(sTemp[0]), sTemp[1]); } ```
``` package listHashMap; import java.util.*; public class MyList { public static void main(String [] args) { List<String> aList=new ArrayList<String>(); Map<Integer,String> aMap = new HashMap<Integer, String>(); aList.add("AAAA"); aList.add("BBBB"); for(int i=0;i<aList.si...
19,304,597
I am using Codeigniter and as much as possible i don't want to use the $\_GET method. What are the other ways to get the value of a button tag? Here's my button code: ``` <button id="first" name="first" type="submit" value="Php3000"></button> ``` I just want to get the value of the button to be able to...
2013/10/10
[ "https://Stackoverflow.com/questions/19304597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2144219/" ]
Sorry for the additional answer.. HTML Buttons in forms are treated as input fields, but only the value of the pressed button will actually be submitted. So you should rewrite your buttons as follows or similiar: ``` <button id="first" name="selected_button" value="Php3000">Choose php 3000 label</button> ...
I don't use CodeIgniter, but according to <http://ellislab.com/codeigniter/user-guide/libraries/input.html> you should be able to just grab the values from the input handler inside your controller: ``` if( $this->input->post('first') ) { // First button was pressed; } ```
21,757,179
I have the following problem with a small Spring MVC project I'm trying to create. I'd like to create the DispatcherServlet, but the wizard list is empty. ![enter image description here](https://i.stack.imgur.com/y7ewC.png) I believe I have all the necessary dependencies covered: * spring-core * spring-beans * spri...
2014/02/13
[ "https://Stackoverflow.com/questions/21757179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3306409/" ]
Found the solution. I just had to select a **Target runtime** when creating the Dynamic Web Project. Once I did that the New Servlet list worked properly and I could add the DispatcherServlet. Of course, it can also be done manually on web.xml (that's what I did), but I was worried since the other method was supposed ...
You should set server runtime in your project. To do that, Right click project -> Click properties -> Java Build Path ->Add Library –> Click Next -> Select server and add it.
2,746,750
When debugging the following console program: ``` class Program { static void Main(string[] args) { Console.WriteLine(DoIt(false)); Console.WriteLine(DoIt(true)); } private static Boolean DoIt(Boolean abort) { try { throw new InvalidOperationException(); ...
2010/04/30
[ "https://Stackoverflow.com/questions/2746750", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32588/" ]
**edit** - Looks like I was wrong, but leaving my original answer here anyway: Are you sure that it works with a `List<Integer>`? It shouldn't. The method `subList()` returns a separate `List`. If you remove elements from that list, it shouldn't affect the original list. The API docs for `List.subList()` say this: >...
Two things I can think of are: 1. `list.sublist(0, 5)` returns an empty list, therefore `.clear()` does nothing. 2. Not sure of the inner workings of the List implementation you're using (ArrayList, LinkedList, etc), but having the `equals` and `hashCode` implemented may be important. I had a simiarl issue with Maps, ...
49,635,495
I have a text in a .txt file and there are some paragraphs,and you can see this structure: ``` name:zzzz,surnames:zzzz,id:zzzz,country:zzzz ... name:zzzz,surnames:zzzz,id:zzzz,country:zzzz ... name:zzzz,surnames:zzzz,id:zzzz,country:zzzz ... name:zzzz,surnames:zzzz,id:zzzz,country:zzzz ... ``` And I would know how t...
2018/04/03
[ "https://Stackoverflow.com/questions/49635495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9590852/" ]
Enable Hyper V as following: Run a command prompt as administrator and execute: ``` dism /Online /Disable-Feature:Microsoft-Hyper-V ``` reboot and ``` bcdedit /set hypervisorlaunchtype off ```
After following the answer left by Bub Espinja, these were my steps. --- Run Powershell/CMD as Administrator and enter ```bsh dism /Online /Disable-Feature:Microsoft-Hyper-V ``` Reboot, then enter ```bsh bcdedit /set hypervisorlaunchtype off ``` However, I ran into some difficulty so I came back here and follow...
39,490,201
I don't know how to explain,what I want but from examples I think you know. Momently my registration link is: ``` example.com/pages/registration.php ``` but I want to open my registration.php on this link: ``` example.com/registration ``` How can I do this? Or where can I learn about it,and how to call this? Tha...
2016/09/14
[ "https://Stackoverflow.com/questions/39490201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6740538/" ]
I know them as pretty URL's/clean URL's. You can create them using a .htaccess file. <http://www.desiquintans.com/cleanurls>
You can achieve that using normal Header Redirect. Open the file... ``` `example.com/pages/registration.php` ``` At the top of that file simply add the lines: ``` <?php header('location: example.com/registration'); exit; ```
16,055,915
I have a file in which first row contains the number and second row contains a statement associated with it and so on like the below example ``` 12 stat1 18 stat2 15 stat3 ``` But i need to print the output like sorting reversely as per numbers and so the statement related to it and pri...
2013/04/17
[ "https://Stackoverflow.com/questions/16055915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2194036/" ]
From Sql Server 2008 onwards you can use `Merge` syntax ``` MERGE user target USING user_new source ON taget.ID = source.ID WHEN MATCHED THEN UPDATE SET target.Column= source.Column1,target.column2=source.column2 WHEN NOT MATCHED BY TARGET THEN INSERT (ID,Column1,Column2) VALUES (source.ID,source.column1,source.colum...
You can't do `insert` and `update` in a single query you have to do in seperate ``` select * from user where user_id not in (select user_new.user_id from user_new ) ``` this query results the data for insert query similarly u have to update by replacing `not in` to `in`
64,399,585
In my **register** screen, part of the content(at the bottom) is hidden by the phone's bottom navbar. The content is only visible when I close the bottom navbar. What I want to achieve is, whenever the bottom navbar is displayed on the phone, I want content that is hidden by it to be pushed upwards for visibility and ...
2020/10/17
[ "https://Stackoverflow.com/questions/64399585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10617728/" ]
Any special requirement for using a `SingleChildScrollView`? If not can you please try the code below, if this works for you, here's what it does 1. Replace `SigleChildScrollView` with `Container` 2. Wrap your `SignupForm()` inside an `Expanded()` widget. Here is the code - ``` class Body extends StatelessWidget { ...
Use SafeArea Widget to avoid the bottom navigation bar. To know more about SafeArea widget click [here](https://stackoverflow.com/questions/49227667/using-safearea-in-flutter)
523,933
I need to process the following text to get rid of the strange symbols such as: `â<80><99> â<80><9c> â<80>?` Example text: > > With the mystery unexplained, the Hyatt tried to give its guests a sense of security by posting a guard in its lobby. But Wolf couldnâ<80><99>t shake the notion that a thief could re-enter ...
2012/12/24
[ "https://superuser.com/questions/523933", "https://superuser.com", "https://superuser.com/users/-1/" ]
Just so that other people too can have an answer - Try installing ["European Union Expansion Font Update"](https://www.microsoft.com/en-us/download/confirmation.aspx?id=16083) from Microsoft. This solution is what I found at [Google Forums](http://productforums.google.com/forum/#!msg/chrome/wt4k-H-_s8Q/-oWZ5uC5rOkJ) an...
So partial thanks to some answers, but instead of closing chrome, I copied all my helvetica fonts (i'm a designer, i had 50+) into another folder. Since it detects which is in use... I decided I'd rather delete that one instead to at least get rid of the boldness which was fine by me. So, closed chrome and as I guesse...
9,790,665
On fan pages, tab apps used to be displayed on the left side of the page, and their order was controlled by the "position" value they have (which is described on the api). On the new Facebook layout for profiles, tab applications are now displayed at the top of the profile, with the description, the profile pic, etc. a...
2012/03/20
[ "https://Stackoverflow.com/questions/9790665", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1272933/" ]
Here is a solution for doing it in C#: <http://leeontech.wordpress.com/2012/03/01/customizing-gridview-items-in-metro-app-4/>
I am not sure about C# and XMAL code of doing this. But in Javascript, instead of creating the template in HTML, you can create the item template in javascript by doing something like this ``` function MyItemTemplate(itemPromise) { return itemPromise.then(function (currentItem) { var result = document.crea...
26,650,456
look at the following snippet: ``` class C val c1 = new C { def m1 = "c1 has m1" } val c2 = new C { def m2 = "c2 has m2" } c1.m1 c2.m2 //c2.m1 //c1.m2 ``` run it in the REPL, then you know what I mean. My limited java knowledge tells me that in java, objects of same class will have the same methods signagure, and...
2014/10/30
[ "https://Stackoverflow.com/questions/26650456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157300/" ]
You're extending `C` with traits, so `c1` and `c2` are anonymous classes : ``` scala> c1.getClass res0: java.lang.Class[_ <: C] = class $anon$1 scala> c2.getClass res1: java.lang.Class[_ <: C] = class $anon$2 ``` Looking at the java code, you'll see (`O` being a surrounding object to get it to compile) : ``` publi...
The Java equivalent is ``` C c1 = new C { public String m1() { ... } } C c2 = new C { public String m2() { ... } } ``` Now, you can't call `c1.m1()` directly, but you can do it using reflection: ``` c1.getClass().getMethod("m1").invoke(c1) ``` Scala just allows you to do it with a simpler syntax.
7,991,425
I need to see if a specific image exists on my cdn. I've tried the following and it doesn't work: ``` if (file_exists(http://www.example.com/images/$filename)) { echo "The file exists"; } else { echo "The file does not exist"; } ``` Even if the image exists or doesn't exist, it always says "The file exists"...
2011/11/03
[ "https://Stackoverflow.com/questions/7991425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804992/" ]
Here is the simplest way to check if a file exist: ``` if(is_file($filename)){ return true; //the file exist }else{ return false; //the file does not exist } ```
`file_exists($filepath)` will return a true result for a directory and full filepath, so is not always a solution when a filename is not passed. `is_file($filepath)` will only return true for fully filepaths
68,449,461
I want to install Openstack on CentOS 8(single node). I am having single machine (physical machine) where I want to install all nodes of Openstack. This setup I required for simulation only not production use. I have tried to install Openstack using packstac 3 times but couldn't success. I got different issues during i...
2021/07/20
[ "https://Stackoverflow.com/questions/68449461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9891377/" ]
I would use official [Packstack documentation](https://www.rdoproject.org/install/packstack/). Note that you should start with a totally fresh Centos installation; i.e. don't try to install Packstack on a server where a previous installation failed (or succeeded). You can also try [Devstack](http://docs.openstack.org/...
I tried to install Openstack several times last week (october 2021): a) with CentOS 8 Stream to metal hardware (real server) with devstack - no one version was installed (neither Master nor Xena & Wallaby, version Viktoria & below are not for Stream OS); b) Virtual machine with CentOS 8 Stream installed with packstack ...
17,027,759
I deleted a project in my workspace, then tried to create a new project with the same name. Eclipse told me that it overlaps the location of another project (the one I just deleted). How do I fix this?
2013/06/10
[ "https://Stackoverflow.com/questions/17027759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Go to Window >> Preferences >> General >> startup and shutdown >> workspace theen select Recent work space then click Remove and close the program and open it again ![screenshot](https://i.stack.imgur.com/wBhNx.png)
go to the folder and delete the file *.project*. This worked for me.
11,696,327
After installing OS X Mountain Lion and XCode, I'm getting this error: ``` Jonathans-MacBook-Air:fme jong$ npm install bcrypt npm http GET https://registry.npmjs.org/bcrypt/0.7.0 npm http 304 https://registry.npmjs.org/bcrypt/0.7.0 npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.np...
2012/07/27
[ "https://Stackoverflow.com/questions/11696327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/927092/" ]
Apparently I just need to install the Command Line Tools from the downloads panel in XCode
The problem may be that your Node.Js is version 0.10 and some modules only work with the previous 0.8.22 version which you can get here: <http://blog.nodejs.org/2013/03/06/node-v0-8-22-stable/>
34,720
I used to duplicate layers such as watermarks or adjustment layers from one document to another in Photoshop all the time. Layers are mostly put in a group. Now, I am starting to use Photoshop CS6 and I've fallen in love with the new Color Lookup adjustment layers. I found that whenever I have a Color Lookup layer in a...
2013/02/15
[ "https://photo.stackexchange.com/questions/34720", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/11384/" ]
This appears to be a bug within the type of Color Lookup profile. The abstract profiles can be duplicated, while the 3DLUT and Device Link fail. You will also notice that the Color Lookup layer will persist across changes to the document bit depth only when it is an abstract profile. The layer will be removed with eit...
Drag and drop your layer from layers toolbar to another window: ![drag and drop](https://i.stack.imgur.com/ei6zv.jpg)
1,284,904
SQLite first timer, and I want to use Linq for data access. I made a SQLite database with sqliteadmin, and added it as a data source in VS2008. The problem is that when i try to drag&drop a table from the server explorer to the .dbml file, i get the error: > > "The selected object(s) use an > usupported data pro...
2009/08/16
[ "https://Stackoverflow.com/questions/1284904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64999/" ]
One way to deal with this is to : * First, create the site, without any javascript * Then, when every works, add javascript enhancements where suitable This way, if JS is disabled, the "first" version of the site still works. You can do exactly the same with CSS, naturally -- there is even one "[CSS Naked Day](http:...
What you're aiming for is [progressive enhancement](http://en.wikipedia.org/wiki/Progressive_enhancement). I'd go about this by first designing the site without the JavaScript and, once it works, start adding your JavaScript events via a library such as jQuery so that the behaviour of the site is completely separate fr...
6,629,686
I am trying to learn Unix C and doing some exercises for practice. I am currently working on writing my own shell that works similar to the linux bash shell. The code I have below provides for a fairly basic shell. It now provides I/O redirection. I am trying to add support for piping. Initially, I just want to add su...
2011/07/08
[ "https://Stackoverflow.com/questions/6629686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/695752/" ]
After you use `dup2()` (successfully), you have two file descriptors open for the one file. You need to close the original file descriptor; the executed process should not have the extra file descriptors open. You are also going to need to open the files in the appropriate way before using `dup2()`. Amongst other thin...
Why do you need to check the type of command? Unix shells don't treat any commands specially; all redirections, including pipes, are handled the same way. One thing to watch out for is that redirections can happen *anywhere* in a command, so you should parse them out first; try ``` >foo ls <bar -la ``` in a shell so...
110,081
I am having a hard time identifying different principles of design in action. It is hard for me to identify the relationship between different elements on a page and to know what approach was used to create that particular relationship. How can I identify and understand which principles were used in a design?
2018/06/01
[ "https://graphicdesign.stackexchange.com/questions/110081", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/118300/" ]
A good way to identify principles of design is to study each of them in isolation with a definition, an explanation, and examples of the principle. Graphic Design studies include areas in different specialties: Human Visual Perception, Applied Behavioural Psychology, and Anthropology. A cross-subject web search will h...
**How to identify principles of design more easily.** Everyone immediately responds to the subject matter in a composition. Harder to understand after-the-fact is the design (as in plan or scheme) behind the finished piece. After the work is complete, deconstructing it to reveal the principle behind it can be difficul...
889,663
What do I need to do in order to produce PDF invoices with a file size smaller than 20kb? [Example PDF](https://drive.google.com/file/d/0B6HXMKHljcfYV1d5Yl9YNzd4TWM/view?usp=sharing) I create invoices for a small business and I have 60,000+ invoices stored as PDFs (non scanned) that are about 108kb per page on avera...
2015/03/14
[ "https://superuser.com/questions/889663", "https://superuser.com", "https://superuser.com/users/318312/" ]
From the result of Acrobat Audit tool, **the biggest part of your PDF is due to Fonts** inclusion (91kb) , not to real PDF content (3kb+11kb). So you can try some of the following: * **use a single font** for the whole document * while using a single font, **try out different fonts** to see which on give you the smal...
You could create the PDF using PHP write commands. I just did a quick search for PHP PDF and came up with several ways to produce pdfs. such as... "TCPDF is a PHP class for generating PDF documents without requiring external extensions. TCPDF Supports UTF-8, Unicode, RTL languages, XHTML, Javascript, digital signature...
54,371
I frequently use and edit config files inside /etc on OS X Lion. I would like to be able to access this dir in Finder easily, but don't want to unhide hidden files system-wide using `defaults write com.apple.Finder AppleShowAllFiles`. Anyone know how?
2012/06/21
[ "https://apple.stackexchange.com/questions/54371", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/19162/" ]
Enable ShowAllFiles one more time, long enough to drag `/etc` onto your Finder sidebar. From then on, `/etc` will be available in Finder and in Open and Save As dialogs, regardless of ShowAllFiles.
Although its not exactly what you want, you could make an *Application* with **Automator**. To do so: * Open **Automator**. * Select **Work Flow**. * Select **Run Shell Script** and type `open /etc`. * Hit *Save* and choose **Application** as the format. You will, then, be able to open the **etc** folder by double c...
19,638,473
``` System.Threading.ThreadPool.SetMaxThreads(50, 50); File.ReadLines().AsParallel().WithDegreeOfParallelism(100).ForAll((s)->{ /* some code which is waiting external API call and do not utilize CPU */ }); ``` I have never got threads count more than CPU count in my system. Can I use PLINQ and get more than one thr...
2013/10/28
[ "https://Stackoverflow.com/questions/19638473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/655310/" ]
If you're calling external web API, you might be hitting the limit of concurrent simultaneous connections, which is set to 2. In the begining of your application do the following: ``` System.Net.ServicePointManager.DefaultConnectionLimit = 4096; System.Net.ServicePointManager.Expect100Continue = false; ``` Try if th...
PLINQ does not fit in this case. I have found next article useful for me. <http://msdn.microsoft.com/en-us/library/hh228609(v=vs.110).aspx>
1,742
I'd heard that some people have a custom not to give knives as a gift (as knives are a sign of shortening life, not extending it); I asked one rabbi who said he hadn't heard of such a custom, but it seemed reasonable. Does anyone have a source for this custom? Would it therefore be advisable not to register for kitchen...
2010/06/09
[ "https://judaism.stackexchange.com/questions/1742", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/21/" ]
"[Rabbi Nachman of Breslev said] in the name of the Ba'al Shem Tov, one should not give his fellow a knife as a gift" ([Sichot Haran no. 9](https://he.wikisource.org/wiki/%D7%A9%D7%99%D7%97%D7%95%D7%AA_%D7%94%D7%A8%22%D7%9F/%D7%90-%D7%A0#%D7%98), first printed in 1815. Maaglei Tzedek pg. 3a. This tradition is also foun...
Rav Bentzion Mutzafi says there is no source for the custom of not handing someone a knife, but then he says "maybe for being careful for a good (cause)." *שאלה* - 2673 שלום לכבוד הרב הגאון האם יש מקור לדבר שאסור להעביר סכין מיד ליד אלה להניח על השולחן ולקחת או שזה סתם שטות והמצאה? *תשובה* **אין לזה מקור, ואולי זה ...
46,035
People often tag their questions with the words from the question title. Other times they use some syntactic keywords or classes. Examples: * `[arraylist]` * `[extends]` * `[properties]` * `[stringbuffer]` * `[break]` * etc, etc. From time to time I remove those tags, because they do not *categorize* the question. In...
2010/04/09
[ "https://meta.stackexchange.com/questions/46035", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/141771/" ]
The SO community *does* have a lot of power, but the with exception of the moderators, no one user has power to do more than downvote a question, flag it, and vote to close. Ignoring moderators, voting to close requires 5 people, flagging requires 5 people, downvoting takes off just 2 rep, and you need 3 10k users to v...
What's your stackoverflow account? Anyways as you see from [the list of questions tagged marketing](https://stackoverflow.com/questions/tagged/marketing) all of them are very programming related or closed. **EDIT**: it appears that one of your posts was flagged as offensive or spam by a large number of people, and th...
4,753,372
Typically interfaces that let you add listeners also include a remove method something like the following. ``` interface SomeInterface { addListener( Listener) removeListener( Listener ); } ``` This however suck for several reasons. * It is possible to pass a Listener that has not yet been removed to SomeInter...
2011/01/20
[ "https://Stackoverflow.com/questions/4753372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56524/" ]
My proposal would be to have the AddListener method return an object of type ISubscriptionCanceller with one method: CancelSubscription and possibly a SubscriptionActive property. This object would contain all information necessary to cancel a given subscription, whether subscriptions are stored in an array, linked lis...
I think a lot of your underlying assumptions are wrong. Lets consider the alternative in Java, that removeListener is not a method on the class until a listener has been registered. 1. This isn't possible in Java; Java is not a dynamic language (ignoring reflection) 2. Even if it was possible, as it is in javascript,...
14,003
[Is it ever correct to have a space before a question or exclamation mark?](https://english.stackexchange.com/questions/4645/a-space-before-a-question-or-an-exclamation-mark-can-it-be-correct) is affirming what I always use, but now some translators I know said that I always need a space before. I am sure they are Fren...
2011/02/24
[ "https://english.stackexchange.com/questions/14003", "https://english.stackexchange.com", "https://english.stackexchange.com/users/2022/" ]
As far as authority goes, I'd put my money with Fowler's *[Modern English Usage](http://en.wikipedia.org/wiki/A_Dictionary_of_Modern_English_Usage)*. In the first edition (1926), Fowler uses what seem to be half-spaces before colons, semicolons, question marks, and exclamation marks, but not before full stops or commas...
Do you trust Microsoft? When you type a question in Microsoft Word and leave a space before the question mark. It says you have a grammar mistake and puts a green line under it. I know you're looking for a book or something though.
575,364
Recently I noticed that there are some sentences which contain "can't" that sound wrong when you replace "can't" with "cannot." Here's one example. The sentence > > Why can't I do it? > > > sounds correct. But replacing "can't" with "cannot" yields this sentence > > Why cannot I do it? > > > I don't know if...
2021/09/21
[ "https://english.stackexchange.com/questions/575364", "https://english.stackexchange.com", "https://english.stackexchange.com/users/433699/" ]
I would second the answer to [this question](https://english.stackexchange.com/questions/82982/why-does-why-doesnt-it-work-become-why-does-it-not-work) that points out that constructions analogous to "why cannot I" were common through the 18th century and beyond, so though they sound old-fashioned today, they haven't a...
Before we start, think of how "gonna" and "wanna" arose in English - they are phonetic corruptions of "going to" and "want to". They are relatively common even in writing in which the writer does not intend to mimic speech. The history of can't/cannot is much the same. New Fowler's Modern English Usage (2000) states ...
2,359,537
Using the HTML5 `<canvas>` element, I would like to load an image file (PNG, JPEG, etc.), draw it to the canvas completely transparently, and then fade it in. I have figured out how to load the image and draw it to the canvas, but I don't know how to change its opacity. Here's the code I have so far: ``` var canvas =...
2010/03/01
[ "https://Stackoverflow.com/questions/2359537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18986/" ]
This suggestion is based on pixel manipulation in canvas 2d context. From MDN: > > You can directly manipulate pixel data in canvases at the byte level > > > To manipulate pixels we'll use two functions here - `getImageData` and `putImageData`. `getImageData` usage: ``` var myImageData = context.getImageData(l...
You can't. It's immediate mode graphics. But you can sort of simulate it by drawing a rectangle over it in the background color with an opacity. If the image is over something other than a constant color, then it gets quite a bit trickier. You should be able to use the pixel manipulation methods in this case. Just sa...
13,592,786
I have a query where I am doing an `INNER JOIN` on couple sub-queries. In this query I use a similar `WHERE` clause which has a `LIKE` statement; `WHERE bookName LIKE '%INTERVIEWS%'`. But there are about five different variations of a `bookName` which has the word "INTERVIEWS". So would the query perform better if I d...
2012/11/27
[ "https://Stackoverflow.com/questions/13592786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/830545/" ]
There is multiple aspects to consider: * You do not have an `index` on the bookName column: in this context that does not matter, the query is going to perform the same way by executing a clustered index scan or a table scan. * You do have a `non clustered index` on the bookName column + this is a `non covering index...
If the bookName column is indexed and the table has a substantial number of columns, the second option will definitely run more quickly because it will be ab index scan instead of a table scan. If there is no index then they will be approximately the same because they will both require a table scan. As for the idea of...
24,536
I'm planning on building a small model turbofan engine for a bit of fun but I thought I'd better get a better understanding of how they work first. I understand the majority of it at the moment but I'm struggling to see what the bypass air actually does, to my mind it seems like a waste of air and energy if its just go...
2016/01/22
[ "https://aviation.stackexchange.com/questions/24536", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/13120/" ]
The bypass air is actually what gives the jet engine most of its thrust. As the air enters the engine, some of it goes to the turbine core and runs the whole engine. But most of the air goes through and is sped up by the large fan giving it the thrust. Doing it this way increases the efficiency because the engine moves...
Jet planes like fighter planes have their geometry designed for supersonic speed which is usually achieved with high velocity combusted jet exhaust from the jet engine. This consumes a lot of fuels in the high pressure compressor section. Passenger planes on other hand are not designed to fly at supersonic speed so hi...
7,403,457
been researching this a while and not sure entirely what to do. I want to allow users to switch debug mode either on or off. With debug mode on NSLogs will be printed to console. currently I can set debug mode on or off in the build settings using a preprocessor (DEBUG) and I use the following code to "block" NSLogs....
2011/09/13
[ "https://Stackoverflow.com/questions/7403457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/529432/" ]
You should not use preprocessor directives: using `#ifdef DEBUG` means that, if `DEBUG` is not defined, that piece of code doesn't get compiled at all. You should instead replace preprocessor directives with a simple if statement that check a global variable (or, at least, that may be a solution).
I believe your code block would only check if you are building for debug or release and will build accordingly. You can build it on a device it will be on release mode , I don't think it is possible to run the simulator in release mode otherwise. Maybe manually building the application for simulator and moving the p...
33,813
The Galleons, Sickles, and Knuts are described as the currency of wizards. I don't remember seeing anything about any other currency used by wizards. Is there such currency? Are Galleons, Sickles, and Knuts universal, or do wizards outside of Britain/Commonwealth/English speaking world use different currency?
2013/04/03
[ "https://scifi.stackexchange.com/questions/33813", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4004/" ]
There is almost certainly some kind of different currencies, though there's not enough canon info to know if they are some rare outlier country's coin, or every country has it own coins. From ***Goblet of Fire*, Chapter 7 - BAGMAN AND CROUCH** > > "You foreign?" said Mr. Roberts as Mr. Weasley returned with the corre...
There's a different currency in America at least: the dragot. It's mentioned in [this passage](https://www.wizardingworld.com/writing-by-jk-rowling/rappaports-law-en) on new-Pottermore. > > In brief, the catastrophe involved the daughter of President Rappaport’s trusted Keeper of Treasure and Dragots (the Dragot is t...
27,745,456
In the python, the `if` statement can have parentheses or not like this: ``` if True: pass if (True): pass ``` Is there any difference at all, even a performance difference, between these?
2015/01/02
[ "https://Stackoverflow.com/questions/27745456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2968663/" ]
In Python, parenthesis are not required. You usually use them to group long complex expressions.
As in most languages, extra parentheses are ignored. In Python the `if` statement doesn't require any at all. Both statements are identical.
2,129,642
Let $E$ is a splitting field of a polynomial over $K$ then $E/K$ is finite normal extension. Now the polynomial is of finite degree and will have finitely many roots, so the extension $E/K$ is finite and also since $E$ is the splitting field of the polynomial over $K$ so it contains all the roots of the polynomial and...
2017/02/05
[ "https://math.stackexchange.com/questions/2129642", "https://math.stackexchange.com", "https://math.stackexchange.com/users/98414/" ]
Your reasoning that $E$ is finite over $K$ is correct. For normality, it depends on what definition of a normal extension you are using. There are a few equivalent ones, and from your proof it is not clear to me which definition you are using. Here is one definition we can take for $E$ to be normal over $K$ (from wik...
> > **Theorem:** Let be $K$ field extension of $k$, the the following are equivation: > > > $(1)$ $K$ normal extension of $k$ and finite > > > $(2)$ $K$ splitting fields of $k$ for $f\in k[x]$ > > > proof $2) \to 1)$ Let be $\alpha\_1,..,\alpha\_n $ roots of polynomial $f(x)$ then $K=k(\alpha\_1,..,\alpha\_n)$...
2,933,029
I have two image swap functions and one works in Firefox and the other does not. The swap functions are identical and both work fine in IE. Firefox does not even recognize the images as hyperlinks. I am very confused and I hope some one can shed some light on this for me. Thank you very much in advance for any and all ...
2010/05/28
[ "https://Stackoverflow.com/questions/2933029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/353310/" ]
Both your examples work for me, though they're pretty unappealing examples of ancient Netscape 3-era coding. ``` var aryImages = new Array(); aryImages[1] = "/tires/images/mich_prim_mxv4_profile.jpg"; ``` Arrays are `0`-indexed. Currently your loop will try to access `aryImages[0]` and get an `undefined`, which is w...
Just checked up on this. If you are using XHTML, it may not be the JavaScript that is corrupt, but your markup: XHTML needs tags and attributes to be specified in lowercase. I assume, that IE in its much-to-desire standards support perhaps partially ignores this, and evaluates your latter example as you think it should...
8,543
I remember a rumour from my youth in the late seventies / early eighties, that there was supposedly cadmium in older (relative to that time) LEGO bricks. Searching for `LEGO cadmium` yields quite a lot of hits, but so far, nothing conclusive. I also note that LEGO has never recalled any old bricks, which I admit wo...
2017/01/28
[ "https://bricks.stackexchange.com/questions/8543", "https://bricks.stackexchange.com", "https://bricks.stackexchange.com/users/3176/" ]
I asked Gary Istok on your behalf in [this Brickset Forum thread](http://bricksetforum.com/discussion/comment/498950), who is an expert on LEGO's history. He said the following: > > When LEGO replaced the Cellulose Acetate bricks circa 1963 with ABS > plastic for non-trans parts, and polycarbonate for the trans one...
Even in early 1980s there were some patches having Cadmium. I should link to the study but lost it now. Here is somewhat proper reference: <https://www.thesun.co.uk/news/5436922/second-hand-plastic-toys-including-lego-could-harm-children-with-toxic-chemicals/> Eating is something to avoid. Hand-to-mouth (hand skin ...
12,298,237
I am new to java language and have been reading over the API documentations. I was wondering if someone could help me with what some of the symbols mean? For example, in PriorityQueue there is: ``` Constructor Summary ... PriorityQueue(Collection<? extends E> c) ... Method Summary ... <T> T[] ... ``` My problem is ...
2012/09/06
[ "https://Stackoverflow.com/questions/12298237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You're right that `T` is a type parameter. In this case it can be replaced by any type, since it does not have constraints. This constructor has a type constraint: ``` PriorityQueue(Collection<? extends E> c) ``` and should be read as: create a new `PriorityQueue` instance using a `Collection` taking as type param...
You should learn some basic java concepts.Stack Overflow's [java tag](https://stackoverflow.com/tags/java/info) has many information. The tag's `<? extends E>` means Wildcard generic parameter that the parameter can be any generic Collection where the parametrized type extends the collection. The "parameter" E is rep...
50,127,362
The below API is called from the UI, as well as it wants to be redirected to, by other APIs. ``` @RequestMapping(value = "/showAbc", method = RequestMethod.POST) public ModelAndView showAbc(@RequestBody Abc abcInstance) { //doSomething } ``` The below API is also called from the UI end, but it fetches an instanc...
2018/05/02
[ "https://Stackoverflow.com/questions/50127362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9602278/" ]
I wouldn't recommend calling one API to another if it's in the same application. This way you are tightly coupling API to API. Either leave the API contract to be called to UI or handle the delegation via plain java service calls. ``` @RequestMapping(value = "/showAbc", method = RequestMethod.POST) public ModelAndView...
Please try this ``` ModeAndView m = new ModelAndView("redirect:/showAbc"); Abc abc = abcRepository.findByBcdId(bcdId); m.addObject("abc",abc); return m; ```
28,282
Let $G$ be a simple algebraic group over a field $k$, and let $U$ be the unipotent radical of a Borel subgroup $B$. Because $B$ normalises $U$, the group $H = B/U$ acts on the coordinate ring $\mathcal{O} = k[X]$ of the basic affine space $X = G/U$ via $(h.f)(x) = f(xh)$. We get a decomposition of $\mathcal{O}$ into a ...
2010/06/15
[ "https://mathoverflow.net/questions/28282", "https://mathoverflow.net", "https://mathoverflow.net/users/6827/" ]
The question has an affirmative answer and a fairly long history as well, but the proof uses some nontrivial ideas. The notation used here is nonstandard relative to that found in Jantzen's book *Representations of Algebraic Groups* (second edition, AMS, 2003). Also, a "Weyl module" (in the usual sense) of a given high...
Yes, it is true in general. I found it as Thm 3.1.2 of *Brion, Michel(F-GREN-IF); Kumar, Shrawan(1-NC) Frobenius splitting methods in geometry and representation theory. Progress in Mathematics, 231. Birkhäuser Boston, Inc., Boston, MA, 2005. x+250 pp. ISBN: 0-8176-4191-2*. The result itself is earlier (see historical ...
11,321,001
I kind of suck at recursion (which is why im working on this) and I'm having trouble figuring out how to do this: `("Hello" foldLeft(1))((x, y) => x * y.toInt)` recursively. Any thoughts?
2012/07/04
[ "https://Stackoverflow.com/questions/11321001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479180/" ]
``` scala> def r(s : String) : Int = { | s match { | case "" => 1 | case _ => s.head.toInt * r(s.tail) | } | } r: (s: String)Int scala> r("hello") res4: Int = 714668928 ```
Here's a tail recursive version using an accumulator. This version has a clean API too. ``` import scala.annotation.tailrec def unicodeProduct(string: String): Int = { @tailrec def unicodeProductAcc(string: String, acc: Int): Int = { string match{ case "" => acc case _ => unicodeProductAcc(string...
30,787
We have already discussed why $e^{(\pi\sqrt{163})}$ is an almost integer. [Why are powers of $\exp(\pi\sqrt{163})$ almost integers?](https://mathoverflow.net/questions/4775/why-are-powers-of-exppisqrt163-almost-integers) Basically $j(\frac{1+\sqrt{-163}}{2} ) \simeq 744 - e^{\pi\sqrt{163}}$, where $j(\frac{1+\sqrt{-1...
2010/07/06
[ "https://mathoverflow.net/questions/30787", "https://mathoverflow.net", "https://mathoverflow.net/users/6769/" ]
The standard reason why $e^{\pi\sqrt{N}}$ is a near integer for some $N$ is that there is some modular function $f$ with $q$-expansion $q^{-1} + O(q)$, such that substituting $\tau = \frac{1 + i\sqrt{N}}{2}$ (or perhaps $\frac{i\sqrt{N}}{2}$) and $q = e^{2 \pi i \tau}$ into the $q$-expansion of $f$ yields a rational in...
Frictionless Jellyfish deleted his useful (but snide) answer, so here is some elaboration. Define $r[q] = f2[q]^{24} + 2^{12}/f2[q]^{24} = q^{-1} - 24 + 4372q + O(q^{2})$, where f2[.] is a Weber function. Weber functions satisfy quadratic polynomials for Class 2 numbers such as 232: $r[e^{-\pi \sqrt{58}}] = 64(((5 +...
3,857
I want to create an automated process, that will trigger/create the Export Service * <https://eu1.salesforce.com/ui/setup/export/DataExportPage/d> ![enter image description here](https://i.stack.imgur.com/BG2G8.jpg) And once complete, will upload all the resulting files to an FTP. The files are 512MB in size each. ...
2012/10/30
[ "https://salesforce.stackexchange.com/questions/3857", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/260/" ]
The FREE Jitterbit data loader lets you query all fields, export to an FTP site, and to schedule that process. Only downside is spending an hour or two setting up the query for each object (custom and system). On the plus side, it exports a lot of objects that the salesforce data export doesn't.
For future visitors, you can try this solution to [upload data on FTP server using Command line dataloader.](http://www.jitendrazaa.com/blog/salesforce/using-dataloader-and-ant-to-backup-salesforce-data-on-ftp-server-video/)
8,089,125
When i ran PMD on my Java Code , one of the Error Message it is showing is "The class STWeb has a Cyclomatic Complexity , of 20 " . Typically my java class is of this way ``` public class STWeb implements STWebService { public String getData(RequestData request) { validate(request); } public boolean va...
2011/11/11
[ "https://Stackoverflow.com/questions/8089125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/784597/" ]
It helps if you have something like this: ``` if (a) { return true; } else if (b) { return true; } else if (c) { return true; } else { return false; } ``` then, you replace it with this: ``` return a || b || c; ```
If this is mandatory - yes this happens despite it's futil - you can often reduce the class cyclomatic complexity by introducing base classes and move distribute the functions into the base classes until the per class cyclomatic complexity is ok. Or simpler: add // NOPMD to your class: ``` public class VeryComplexStu...
37,798,690
I'm using the leaflet library in R, which is a wrapper to the leaflet.js library. I'm wondering if it is possible to add a query or search button using the R interface (or some hack to the underlying code)? There are search plug-ins to the javascript library here <http://leafletjs.com/plugins.html#search--popups>, but ...
2016/06/13
[ "https://Stackoverflow.com/questions/37798690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2615477/" ]
It appears that there is a search plugin for the R leaflet package: <https://github.com/byzheng/leafletplugins>
[Check out](https://owi.usgs.gov/blog/inlmiscmaps/) the `inlmisc` package and `AddSearchButton` ``` df = read.csv(textConnection( 'Name, Lat, Long <b>location 1</b>,42.3401, -71.0589 <b>location 2</b>,42.3501, -71.0689')) map=leaflet(df) %>% addTiles() %>% setView(lng=-71.0589,lat=42.3301, zoom=12) %>% addMarkers(~L...
92,869
I am going to be starting up a new project at work and want to get into unit testing. We will be using Visual Studio 2008, C#, and the ASP.NET MVC stuff. I am looking at using either NUnit or the built-in test projects that Visual Studio 2008 has, but I am open to researching other suggestions. Is one system better tha...
2008/09/18
[ "https://Stackoverflow.com/questions/92869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13593/" ]
I have been using NUnit for two years. All is fine, but I have to say that the unit testing system in Visual Studio is pretty nice, because it's inside the GUI and can more easily do a test for private function without having to mess around. Also, the unit testing of Visual Studio lets you do covering and other stuff ...
I got messages that "NUnit file structure is richer than VSTest"... Of course, if you prefer the NUnit file structure, you can use this solution to the other way, like this (NUnit → Visual Studio): ``` #if !MSTEST using NUnit.Framework; #else using Microsoft.VisualStudio.TestTools.UnitTesting; using T...
1,617,524
I plan on writing a Java 3D game that will work both on PC and Android. Unfortunately it looks like there is no common OpenGL API for both platforms. Do the APIs differ significantly? Is there a way I could use the same 3D code in both versions? Is it a good idea?
2009/10/24
[ "https://Stackoverflow.com/questions/1617524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78145/" ]
Android supports OpenGL ES 1.0 which overlaps with OpenGL 1.3 so this should be possible, but it is not as simple a just replacing the jar files at runtime. It is a good idea to try to reuse as much as possible of you application across both platforms. Anyway it is generally good practice to isolate the rest of you co...
There is actually quite a bit of difference between java3d and the android opengl api. First java3d is a higher level abstraction on 3d. And even if you were to use something like JOGL there would be some differences in the api's. Your best bet would be to abstract out the actually 3d drawing implementation in the code...
50,933,364
I am new to VueJS and web development in general. I am working on a project that displays my Vue components as cards. I was hoping to make this web app a SPA with only 1 card ever appearing at a time. Is it possible to put something such as a search field where I can type (say a name or some text found within the card...
2018/06/19
[ "https://Stackoverflow.com/questions/50933364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9841091/" ]
Using `str_detect` from the `stringr` pacakge: ``` library(stringr) str_detect(df1$column1, df1$column2) [1] TRUE FALSE TRUE ``` or using only base R combining `grepl` with apply: ``` apply(df1,1, function(x){ grepl(x[2], x[1]) }) [1] TRUE FALSE TRUE ```
We can do this using `stringr`. First, let's create a data frame: ``` df <- data.frame(column1 = c("Target_US_Toy", "Target_CA_Toy"), column2 = c("_US_", "_NZ_"), stringsAsFactors = FALSE) ``` Next, we create a new column called `result`: ``` library(stringr) df$result = str_detec...
6,248,814
We created a few applications targeting iPhone 3 and iPhone 4. When we tested these apps on iPad, they worked well. We thought we do not need to create separate apps targeting iPad. We went with that decision. A few months later, we realized that the graphics are not looking as good as are on the iPhone. Even the text ...
2011/06/06
[ "https://Stackoverflow.com/questions/6248814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/186148/" ]
You just need to change the images and size for ipad. A few changes in xibs that are for ipad. you can make same app work on iphone as well as ipad... Check out this Link that convert iphone app to universal ipad apps [Link here](http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html) ...
The iPad uses "pixel doubling" to expand an iPhone app to completely fill its screen in 2x mode. That is usually why it won't look as sharp as a native iPad app. The best way to answer whether or not you should make an native iPad app is a matter of customer base and funds for R&D. Do you think your customers will dema...
723,380
Today i've faced with loggin loop on my Ubuntu 14.04.3 LTS again. I've started with most popular scenarios to fix but everything fails. All articles on the first 4-5 pages of google search are read but no success. For now i can login to Guest, to tty with my user, to my new user using GUI, but my old user via GUI is u...
2016/01/20
[ "https://askubuntu.com/questions/723380", "https://askubuntu.com", "https://askubuntu.com/users/327741/" ]
I had the same query when I had updated some systems installed with the 14.04.1 installation medium, that had been updated to 14.04.3 without pushing the kernel onto one of the HWE releases. The thing that made sense of it in my mind is that the installation medium (CD release) for 12.04.5 will use the Trusty HWE kern...
You can find out exactly which version Ubuntu version you are using by typing > > cat /etc/issue > > > or with the command > > lsb\_release -a > > > as indicated by other answers (you need to install it first, as it doesn't come with Ubuntu by default)
10
If magic were to manifest in the modern (present) age, how would first world governments attempt to classify and regulate its usage? To be more specific (and an example), if the USA created a Department of Magical Affairs, what would the primary and secondary concerns of such an agency be? Further clarification, let's...
2014/09/16
[ "https://worldbuilding.stackexchange.com/questions/10", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10/" ]
This is a rather more complicated subject than the question would make it. There's an old saying about how there are two things you would not want to see the making of: sausage and legislation. This issue is further clouded by the unique political landscape of the US, in as far as there are quite a few people who dead ...
Probably the primary concerns would be that people did not use magic for illicit purposes (putting curses on people, etc.). A secondary concern might be something like encouraging education about magic, or if magic is an inborn rather than learned ability, seeking out and identifying magic-users. It would probably issu...
9,982,433
I'm developing an application for my final thesis on computer science, and I need to collect and log accelerometer data. I need to acquire it for a whole day long, so there are serious battery constraints (for instance, I cannot leave the screen on). Also, this isn't a market targeted application, so it is pretty accep...
2012/04/02
[ "https://Stackoverflow.com/questions/9982433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1308680/" ]
Basically, it is a problem with my phone. Other users have reported this also happens with their phones, from different brands but same Android version. Other persons have no problem at all - strongly indicating that this is not a problem with the stock version of android but from the implementations of each company fo...
I've ran into similar problems with the Samsung Nexus running *Android 4.0.2* using other system services that stop/pause while the screen is off even though a `PARTIAL_WAKE_LOCK` is acquired. My solution was to use a `SCREEN_DIM_WAKE_LOCK` as in: ``` lockStatic = mgr.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK,NAM...