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
25,321,224
I have two linQ queries below and am wondering if there's a way to combine both of them. Essentially I have a list of strings. Then from that list of strings, I want to create a new list of object and order it based on a property of the object. This new list of object, which has been ordered, will then be returned. ``...
2014/08/15
[ "https://Stackoverflow.com/questions/25321224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1835622/" ]
You can do something like this: ``` var dirs = from file in myList let fileInfo = new DirectoryInfo(file) orderby fileInfo.CreationTime ascending select fileInfo; ```
Yes, you can try something like this: ``` var dirs = (from file in myList select new DirectoryInfo(file)).OrderBy(x => x.CreationTime); ```
37,503,435
I have an android app that I created and it keeps getting the "App Has Stopped" error and cannot find help anywhere. Can someone please help. My Codes are below Main Activity ``` import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebVie...
2016/05/28
[ "https://Stackoverflow.com/questions/37503435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6287974/" ]
One must not initialize a `View` on class level. The line `private WebView webView = (WebView)findViewById(R.id.webView);` must be like: ``` import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; ...
Try to change the code from: ``` public class MainActivity extends AppCompatActivity { private WebView webView = (WebView)findViewById(R.id.webView); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebSettings webSe...
204,007
I am using QGIS 2.16 / Windows 10. I have a point shapefile which I have been using for a little while that has always been editable. Today I was editing the layer, saved my edits and left my computer for a few hours. When I came back I was not able to toggle the editing button on the toolbar and when I right click o...
2016/07/29
[ "https://gis.stackexchange.com/questions/204007", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/14355/" ]
It happened the same to me. Sometimes QGIS (2.18.11) blocks the edition when you "save as..." your project. Just remove the shp from the box and import it again. That should work. If not, save your layer as a new shp. It also happens with duplicate layers.
I imported my point files as a delimininated text layer (originally) and was unable to edit. If you then save layer as a shapefile or export as a geopackage, this might help. It did for me but mine was originally a different file format
17,052,344
I know it's a new feature and this may not be possible, but I would love to be able to use an Asset Catalog to organize my assets, but I access all of my images programmatically. How would I access my images, now? Do I still access them by their file names like so: `[UIImage imageNamed:@"my-asset-name.png"];` Seeming...
2013/06/11
[ "https://Stackoverflow.com/questions/17052344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1292230/" ]
Also Apple has added new way to get image from assets with Swift 3, It is calling as *'Image Literal'* and work as below: ![Image Literal](https://i.imgur.com/5U0SFYf.gif)
**Swift** You can get a reference to an image in your asset catelog with ``` UIImage(named: "myImageName") ``` You don't need to include the extension.
7,672,511
Is there anyone that can clearly define these levels of testing as I find it difficult to differentiate when doing TDD or unit testing. Please if anyone can elaborate how, when to implement these?
2011/10/06
[ "https://Stackoverflow.com/questions/7672511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/493290/" ]
Briefly: **Unit testing** - You unit test each individual piece of code. Think each file or class. **Integration testing** - When putting several units together that interact you need to conduct Integration testing to make sure that integrating these units together has not introduced any errors. **Regression testing...
Can't comment (reputation to low :-| ) so... @Andrejs makes a good point around differences between environments associated with each type of testing. Unit tests are run typically on developers machine (and possibly during CI build) with mocked out dependencies to other resources/systems. Integration tests by defini...
944,509
Apple provides the NSArchiver and NSUnachriver for object serialization / deserialization, but this can not handle any custom xml schema. So filling an object structure with the data of any custom xml schema has to be made manually. Since the iPhone developer community is rapidly growing, a lot of newbie programmer are...
2009/06/03
[ "https://Stackoverflow.com/questions/944509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90745/" ]
The NSKeyedArchiver works precisely because it doesn't try to map onto an XML schema. Many, many XML schemas are badly designed (i.e. they're translating an in-memory object structure to an external representation format). The key problem is that the documents should be designed to make sense from a document perspectiv...
What you are describing is buried inside of the [ObjectiveResource](http://github.com/yfactorial/objectiveresource/tree/1.1) [implementations](http://github.com/lgalabru/objectiveresource/blob/cb12c9772314088c26e66c921ae17754f9d9b89b/src/Classes/NSObject+ObjectiveResource.m), and it supports both JSON and XML. It shoul...
2,493
In Mahayana Buddhism we can see various artistic expressions: Thangka and Songs of Milarepa in Tibetan Buddhism, Chinese and Japanese art also were influenced heavily by Buddhism. Is there any forms of art practiced by Theravada monks? Do you know of any monks who were painters or poets?
2014/08/05
[ "https://buddhism.stackexchange.com/questions/2493", "https://buddhism.stackexchange.com", "https://buddhism.stackexchange.com/users/563/" ]
[The arts](http://buddhistartnews.wordpress.com/what-is-buddhist-art/)—be it painting, sculpture, architecture, calligraphy, etc.—have certainly flourished in the Theravada communities of the Southern Buddhist countries (Sri Lanka, Myanmar, Thailand, Laos, and Cambodia). See, for example, [this section](http://en.wikip...
Householder, `Is there any forms of art practiced by Theravada monks?` Yes, the art of taming ones own mind. What ever art aside of this will for the most cases not be conform to Vinaya, not to speak of Dhamma-practice, and is for the most not allowed, not to speak of teaching such, trade or make favors with such. ...
59,332,653
I am dealing with this example of Javascript code: ``` const real_numbers_array = [4, 5.6, -9.8, 3.14, 42, 6, 8.34, -2]; //Karkoli že je increment, sedaj postane funkcija. const increment = ( function(){ //Namesto zgornjega "function()" dobimo "increment" ...
2019/12/14
[ "https://Stackoverflow.com/questions/59332653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689242/" ]
I am not sure that I understood your question correctly, but out of the box, you can use TypeORM (assuming you use a SQL DB, Mongoose works similarly, though). The repository functions return a `Promise<>`, so you could use something like this (from the [docs](https://docs.nestjs.com/techniques/database)): ``` return ...
This is not much to do with Nest itself, it's just how you write your code and handle whatever libraries you might have. Let's say you have your database fetching function with a callback: ``` function findUsersWithCallback(function callback() { // do something with db callback(err, results); }); ``` You can wra...
35,967,050
I have an array of my class type "Room". There are two constructors for Room, a default and a custom. I want to call a specific constructor when initializing elements of my Room array. Neither default or custom works. I'm getting this error: No operator "=" matches these operands, operand types are Room = Room\* Here...
2016/03/13
[ "https://Stackoverflow.com/questions/35967050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5925067/" ]
I got this error when tried to install app directly from Android Studio. It was due to certificate mismatch, since I used release certificate for setting up the app in Play Console, while Android Studio signs the app with debug certificate by default. Installing app via adb resolved the error. <https://developer...
This happened to me, auth errors in ADB, among them: `android Warn Auth [GoogleAuthUtil] GoogleAuthUtil` Because, like mentioned above, I had a debug build running on phone previously. So I fully uninstalled the app on my phone, and the next [Build and Run] ran successfully.
1,059,857
I see [here](https://www.centos.org/centos-stream/) that EOL for Centos 8 Stream is 2024-05-31. Probably I'm not getting something but I understand it is upstream of RHEL 8 which has EOL in 2029. What's happening in 2024?
2021/04/09
[ "https://serverfault.com/questions/1059857", "https://serverfault.com", "https://serverfault.com/users/627257/" ]
Centos 8 Stream is a separate thing, not really trying to be a direct equivalent of RHEL 8 (not in terms of the packaged software or timeline). Centos 8 (non-"stream") was supposed to track RHEL 8 and presumably would have matched the RHEL 8 EOL date if the project hadn't been killed off. From the [Centos FAQ](http...
What will happen is RHEL 8 Full Support ends, which is the EOL for CentOS Stream 8. CentOS Stream versions do not have a 10 year life, more like 5 years. As the testing repo for RHEL, Red Hat wants you to keep QAing features, and has no interest in providing 5 additional years of security updates for free.
1,449,343
I have 2 27'' displays: 4K and FullHD native resolutions. If I set 1920\*1080 on the 4K display, the image looks blurry in comparison with FullHD native display. I would not be surprised with any other resolutions, because I understand that pixels are physical squares, so if a ratio between 2 numbers is not a whole nu...
2019/06/16
[ "https://superuser.com/questions/1449343", "https://superuser.com", "https://superuser.com/users/653005/" ]
This problem has a long history. You may see an NVIDIA feature request dating from the year 2012 at [Nonblurry Upscaling at Integer Ratios](https://forums.geforce.com/default/topic/844905/geforce-drivers/-feature-request-nonblurry-upscaling-at-integer-ratios/), still today without any answer or solution. In short: The...
I know this post is old, but I spent hours on this issue today, and finally find a solution that worked for me, so I wanted to share. For me, the solution was to go in the NVIDIA Control Panel, select the blurry screen, use NVIDIA Color settings and select : "Output color depth: 10 bpc" (the default was 8). I has been...
26,403,927
``` #include <windows.h> #include <pkfuncs.h> #define WATCHDOG_NAME L"wd_critproc" #define WATCHDOG_PERIOD 5000 // milliseconds #define WATCHDOG_WAIT_TIME 2000 // milliseconds //WDOG_NO_DFLT_ACTION, WDOG_KILL_PROCESS, WDOG_RESET_DEVICE #define WATCHDOG_DEFAULT_ACTION WDOG_RESET_DEVICE #define MAX_COUNT 10 int _tmain(i...
2014/10/16
[ "https://Stackoverflow.com/questions/26403927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4128080/" ]
First determine and finalize what this class template `TriMaps` is expected to do. In C++, you must initialize a reference to something. You probably need a non-reference type (or a pointer type). Consider: ``` template <typename Map> struct TriMaps { Map next; Map prev; Map curr; }; ``` Usage: ``` TriMaps<i...
You can't have a `std::vector` of different type but if you can have base class ``` struct TriMapBase { virtual ~TriMapBase() = default; }; template <typename Map> struct TriMaps : TriMapBase { /* Your implementation */ }; ``` Then you may have: ``` TriMapBase<std::map<int, int>> mapint; TriMapBase<std::map<int, c...
178,401
What is 'falls' or 'individual falls' here? It is difficult for me to find the right word for 'falls' which has many meanings. > > I think they convincingly showed that genetically this **individual > falls** halfway between the Neanderthal and Denisovan fossils found in > the same cave, > > >
2018/09/02
[ "https://ell.stackexchange.com/questions/178401", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/80300/" ]
to fall [somewhere] between x and y means: to come somewhere between x and y. It is used with time periods. Of course, you would have to know when the Neanderthals were running around and when the Denisovans were running around. The time periods. The text assumes you know the time periods of those two categories of t...
* > > 2 falls between 1 and 3 on a ruler. > > > * > > This model falls between the base model and the luxury model. > > > On any sort of *continuum*, to **fall** means to occupy a specific place on the continuum.
132
For an example of a question I was thinking of, I wanted to know how I could use the pencil tool in the midi editor of Studio One to change the pitch of notes. This isn't really related to sound design directly, but I feel it's a little too niche to ask over on superuser. [This question](https://sound.stackexchange.com...
2014/03/13
[ "https://sound.meta.stackexchange.com/questions/132", "https://sound.meta.stackexchange.com", "https://sound.meta.stackexchange.com/users/6609/" ]
Nope. Learning to use basic daw tools is not at all sound design. How to do it should be kosher IF the question was asked not from a usability standpoint but from a conceptual standpoint. As in "I built the sequence up like THIS to accomplish THAT (type of feeling or creative solution), but I don't quite get it to wo...
i'll go first: no they are not, unless you want the RTFMs and down-votes.
316,921
I'm looking for an equivalent to the following proverb which states, "The cactus is only visited when he has prickly pears." It means something like "He is only visited when he has money." I can't think of any in English to be equal.
2016/03/31
[ "https://english.stackexchange.com/questions/316921", "https://english.stackexchange.com", "https://english.stackexchange.com/users/168146/" ]
Proverbs 14:20 reads > > The poor are shunned even by their neighbors, but the rich have many > friends. > > > [[New International Version](http://biblehub.com/proverbs/14-20.htm)] But this is far more transparent, and one version even helpfully [!] puts 'friends' in scare quotes. I think I'll start using the t...
In the American Blues tradition, the expression > > Nobody knows you when you['re] down and out > > > has been a familiar refrain for [almost a hundred years](https://en.wikipedia.org/wiki/Nobody_Knows_You_When_You're_Down_and_Out). On YouTube, you can hear [Bessie Smith's 1929 version](https://www.youtube.com/w...
4,281,424
I've got safe/sanitized HTML saved in a DB table. How can I have this HTML content written out in a Razor view? It always escapes characters like `<` and ampersands to `&amp;`.
2010/11/25
[ "https://Stackoverflow.com/questions/4281424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/520640/" ]
Sometimes it can be tricky to use raw html. Mostly because of XSS vulnerability. If that is a concern, but you still want to use raw html, you can encode the scary parts. ``` @Html.Raw("(<b>" + Html.Encode("<script>console.log('insert')</script>" + "Hello") + "</b>)") ``` Results in ``` (<b>&lt;script&gt;console.lo...
Complete example for using template functions in RazorEngine (for email generation, for example): ``` @model SomeModel @{ Func<PropertyChangeInfo, object> PropInfo = @<tr class="property"> <td> @item.PropertyName </td> <td class="value"> ...
57,200,052
**Target** : if the **8th (or n of )** of character in string **match condition**, **then update in new column** **By word in a single string :** ``` # if i want to check the 3rd character IN[0]: s = "apple" s[2] OUT[0]: 'p' ``` **Code** : ``` tt = pd.DataFrame({"CC":["T020203J71500","Y020203K71500","T02...
2019/07/25
[ "https://Stackoverflow.com/questions/57200052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8935953/" ]
Use Regex. **Ex:** ``` import re s = "2019-07-25 15:23:13 [Thread-0] DEBUG - Serial : INFO: QQQ=00000D00001111 AAA=8 BBB=0 CCC=0 DDD=1.08% XXX=2401" m = re.search(r"DDD=(.*?)%", s) #if you want it to be strict and get only ints use r"DDD=(\d+\.?\d*)%" if m: print(m.group(1)) ``` **Output:** ``` 1.08 ```
Use string find operation: **Example** ``` my_string="2019-07-25 15:23:13 [Thread-0] DEBUG - Serial : INFO: QQQ=00000D00001111 AAA=8 BBB=0 CCC=0 DDD=1.08% XXX=2401" fst = my_string.find("DDD=") snd = my_string.find("%") if fst >= 0 and snd >= 0 print(my_string[fst+4,snd]) ``` **Output** ``` 1.08 ``` Or you ...
6,172,451
I am developing an application wherein I get the latitude, longitude in my android device and post them to a web server. and in a web application I show the location details with the help of google maps. Here I have huge collection of lat long values which i loop it in my jsp and create multiple markers with info win...
2011/05/30
[ "https://Stackoverflow.com/questions/6172451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/746921/" ]
``` StringBuilder _homeAddress = null; try{ _homeAddress = new StringBuilder(); Address address = null; List<Address> addresses = _coder.getFromLocation(_lat,_lon,1); for(int index=0; index<addresses.size(); ++index) { address = address...
``` private String getAddress() { GPSTracker gps = new GPSTracker(ProductList.this); Geocoder geocoder = new Geocoder(ProductList.this, Locale.getDefault()); String address=""; try { List<Address> addresses = geocoder.getFromLocation(gps.getLatitude(), gps.getLongitude()...
14,217,216
``` #include <stdlib.h> struct timer_list { }; int main(int argc, char *argv[]) { struct foo *t = (struct foo*) malloc(sizeof(struct timer_list)); free(t); return 0; } ``` Why the above segment of code compiles (in gcc) and works without problem while I have not defined the foo struct?
2013/01/08
[ "https://Stackoverflow.com/questions/14217216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/581085/" ]
because in your code snippet above, the compiler doesn't need to know the size of `struct foo`, just the size of a **pointer** to `struct foo`, which is independent of the actual definition of the structure. Now, if you had written: ``` struct foo *t = malloc(sizeof(struct foo)); ``` That would be a different story...
"And what about free(t)? Can the compiler free the memory without knowing the real size of the struct?" No, compiler doesn't free anything. Free() is just a function with input parameter void \*.
32,120
I'm building a test suite with Cucumber on Java + Maven + jUnit and I need to pass a username and a password to the test suite so it can log in to the application under test. I don't like the idea of hardcoding the credentials, so I thought maybe I should be passing them as arguments when running the maven command, or...
2018/02/16
[ "https://sqa.stackexchange.com/questions/32120", "https://sqa.stackexchange.com", "https://sqa.stackexchange.com/users/25971/" ]
There is a feature called **Scenario Outline** for data driven tests in cucumber. It can be used in this scenario to pass different user/passwords as data to the test as parameters. [![enter image description here](https://i.stack.imgur.com/K6ouF.png)](https://i.stack.imgur.com/K6ouF.png)
I've found that [keychain](https://github.com/conormcd/osx-keychain-java) and secret stash can help with these - plugins that can access your operating system's credential storage. The documentation should give you more information, but essentially, you store your passwords in your OS's password manager, and then cal...
57,057,162
\*\*There is a paragraph in the div class container, how can i hide the text before "-"? \*\* ```html <!DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title></title> </head> <body> <div class="container"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do ...
2019/07/16
[ "https://Stackoverflow.com/questions/57057162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
in js ``` var element = document.querySelector('.container p') if(element){ element.innerText = element.innerText.replace(/.*- /, ''); // if you need non greedy regexp use /.*?- / instead } ```
just put the content before - in a span. and then apply display: none to span. ``` span{ display: none; } ```
4,797,418
Is there any method I can override that will allow me to use print statements / pdb / etc. to keep track of every time an instance of my class is allocated? While unpickling some objects I am seeming to get some that never have either `__setstate__` or `__init__` called on them. I tried overriding `__new__` and printin...
2011/01/25
[ "https://Stackoverflow.com/questions/4797418", "https://Stackoverflow.com", "https://Stackoverflow.com/users/378469/" ]
(This is more of a comment than an answer.) Quoting Guido's [Unifying types and classes in Python 2.2](http://www.python.org/download/releases/2.2.3/descrintro/#__new__): > > There are situations where a new instance is created without calling `__init__` (for example when the instance is loaded from a pickle). There...
Not sure if this can help you, but Python's garbage collector has [introspective capabilities](http://docs.python.org/library/gc.html) that might be worth taking a look at.
53,631,167
I have a logic app which triggers my HTTP endpoint every 15 minutes. Then the endpoint connects to SharePoint using Rest API and gets the data from specific list which is then added to my db. But to get the data from SharePoint, i need access token. Do i need to write logic to get access token in the endpoint itself?...
2018/12/05
[ "https://Stackoverflow.com/questions/53631167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1215594/" ]
The error indicates that the Interval value has reached zero. So these lines are executed several times until it crashes: ``` if (score > 0 && score % 1000 == 0) { GameTimer.Interval -= 20; } ``` And that is because the condition is met in every interval after the timer passes the condition once. Define yo...
The tick rate cannot be less than or equal to 0. You could simply add an if statement to check that: ``` if (GameTimer.Interval <= 20) { GameTimer.Interval = 1; } else { GameTimer.Interval -= 20; } ``` However, this means that the timer interval will reach a limit after a certain score is reached. Also, the...
66,877,894
I use Selenium Webdriver in a python script to download sites from my webpage and convert them into PNGs: ``` from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC fr...
2021/03/30
[ "https://Stackoverflow.com/questions/66877894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1069083/" ]
might be your container/zeronet updated or firefox updated after that you are facing issue For Temporary Workaround in chrome for localhost you can add — disable-web-security while starting chrome in firefox you can do the following : about:config -> security.fileuri.strict\_origin\_policy -> false
### Workaround 1. go to `about:preferences` and create a new empty profile 2. change to that profile in a new window 3. install the **Allow CORS: Access-Control-Allow-Origin** there now change your python code to use that new profile with ``` profile = webdriver.FirefoxProfile("/home/your_user/.mozilla/firefox/your_...
4,323
The title says it all. How can I detect duplicates in my media library?
2010/09/18
[ "https://askubuntu.com/questions/4323", "https://askubuntu.com", "https://askubuntu.com/users/2192/" ]
You can use [fdupes](http://en.wikipedia.org/wiki/Fdupes) for that: ``` $ fdupes -r ~/Music ``` which gives you a list of all duplicate files. You can easily install it with ``` sudo apt-get install fdupes ```
Try **FSlint** or dupe gredtter To install **FSlint** type in terminal (Ctrl-Alt-T) ``` sudo apt-get install fslint ``` hope this is useful..
73,845
I need a numerical example to illustrate cases where $Cov(X\_1, X\_2) = 0$. Can you think of examples involving functions or matrices?
2013/10/26
[ "https://stats.stackexchange.com/questions/73845", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/31672/" ]
As a very simple example (maybe too simple?), consider $X,Y\in\{0,1\}$ with joint distribution defined by the table ``` Y \ X 0 1 0 1/4 1/4 1/2 1 1/4 1/4 1/2 1/2 1/2 1 ``` This table also displays the marginal distributions of $X$ and $Y$. First, check that $X$ and $Y$ are indepen...
Obviously whenever $X\_1,X\_2$ are independent but I guess that's not the point. My go-to for dependent rvs is $U$ uniform on $[0,1]$ and take $X\_1 = \sin(2\pi U), X\_2=\cos(2\pi U)$. This basically says that if you pick a point uniformly on the unit circle then the coordinate functions are uncorrelated. This fact bo...
51,331,261
I am facing a small problem where I can not select the character ':' which are not between two digits before and after ':' . Here are the examples: ``` user1:18 (should match) date:2018-06-28 16:12:09 (should match : after 'date') dueDate:28 (should match) details:none (should match) ``` In the demo I only got look ...
2018/07/13
[ "https://Stackoverflow.com/questions/51331261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5556720/" ]
The logically appropriate regex for this is ``` (?<!\d):|:(?!\d) ``` I.e. a `:` not preceded by a digit or a `:` not followed by a digit (which matches all `:` except those surrounded by digits on both sides). It looks like `gsub` from `mutate` just calls Ruby's native `gsub`, which supports both look-ahead and loo...
`/:[^\d]|[^\d]:/` matches any colon that is either preceded by a non-digit or followed by a non-digit. Is that good enough?
28,210,525
Say there is a string: `"first option<option 1/option 2/option 3>second option<option 5/option 6/option 7>selection{aaaaa/bbbbb/ccccc}{eeeeee/fffff/ggggg}other string"` Now I want to get 3 `ArrayList` one for string inside "<>": ``` {"option 1/option 2/option 3", "option 5/option 6/option 7"} ``` one for string in...
2015/01/29
[ "https://Stackoverflow.com/questions/28210525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3386916/" ]
With the use of `\G` (asserts that the next match starts from where the last match ends), it is possible to do this in one pass: ``` \G(?:[^<>{}]++|<(?<pointy>[^<>]++)>|\{(?<curly>[^{}]++)\}) ``` A simple break down of the regex above: ``` \G # Must start from where last match ends (?: [^<>...
``` (?<=<)[^>]*(?=>)|(?<={)[^}]*(?=}) ``` You can use this to get both strings inside `<>` and `{}`.See demo. <https://regex101.com/r/pM9yO9/19> Use this to get all separately including those outside. ``` (?<=<)[^>]*(?=>)|(?<={)[^}]*(?=})|[^<>{}]+ ``` <https://regex101.com/r/pM9yO9/20>
18,915,688
I am currently writing a Spring batch where I am reading a chunk of data, processing it and then I wish to pass this data to 2 writers. One writer would simply update the database whereas the second writer will write to a csv file. I am planning to write my own custom writer and inject the two itemWriters in the cust...
2013/09/20
[ "https://Stackoverflow.com/questions/18915688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1303680/" ]
Java Config way SpringBatch4 ``` @Bean public Step step1() { return this.stepBuilderFactory.get("step1") .<String, String>chunk(2) .reader(itemReader()) .writer(compositeItemWriter()) ...
Here's a possible solution. Two writers inside a Composite Writer. ``` @Bean public JdbcBatchItemWriter<XPTO> writer(DataSource dataSource) { return new JdbcBatchItemWriterBuilder<XPTO>() .itemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<>()) .sql("U...
49,320,862
I assume that an ES6 class is an object as "everything" is objects in JavaScript. Is that a correct assumption?
2018/03/16
[ "https://Stackoverflow.com/questions/49320862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1283776/" ]
From the point of view of `Object Oriented Programming` *class* is **not** an *object*. It is an *abstraction*. And every object of that is a concrete instance of that abstraction. From the point of view of JavaScript, *class* is an *object*, because *class* is a *ES6* feature and under it simple function is used. It ...
ES6 class is a function, and any function is an object: ``` (class {}).constructor === Function (class {}) instanceof Function === true (class {}) instanceof Object === true ``` Although not every object is `Object` instance: ``` Object.create(null) instanceof Object === false ``` The statement that everything is...
3,546
I am new to this site and posted a question about RAID 10 configuration in CentOS Linux on the Unix & Linux portion of the site. [Software RAID 10 Array Space Loss](https://unix.stackexchange.com/questions/207997/software-raid-10-array-space-loss) @psusi, @Anthon, @Archemar, @slm put the question on hold as off-topic...
2015/06/08
[ "https://unix.meta.stackexchange.com/questions/3546", "https://unix.meta.stackexchange.com", "https://unix.meta.stackexchange.com/users/118358/" ]
The terminology in that close reason can be confusing since it's covering a few different scenarios: > > off-topic → Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers. > > > The ...
You cannot know this, but it's a side effect of this site being part of the larger Stack Exchange network. These sites all have a few common close reasons (e.g. the question is so broad the answers would fill a book). One of the close reasons is "off topic". What is "off topic" is defined per-site. Most sites on the ...
7,457,057
this has been bugging me for over a week now, I seriously need help with this one, I am basically trying to get one of my navigation buttons to toggle the sub menu, open and closed, but when open change the homepage opacity to 50% and when closed back to 100% I also need the Button to work in relation to another div,...
2011/09/17
[ "https://Stackoverflow.com/questions/7457057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/950555/" ]
If you want to change your current working directory for a script, then use the && between the CD and script so it will change directory and then if that's successful it will execute the second command. ``` mysql> SYSTEM cd /home && ls ```
What you're looking for is the escape to shell command: `\!` ``` mysql>\! cd ./my_dir ``` You can even use it to escape to the shell completely and then come back to the mysql environment. ``` mysql>\! bash bash>cd ./my_dir bash>exit mysql>SELECT * ALL FROM <table>; ```
6,410,494
I am developing a visual C++ video capture application using DirectShow. When I checked the media subtype of the AM\_MEDIA\_TYPE structure of the Capture filter's Output pin, I could see that different webcams capture data in different formats such as MEDIASUBTYPE\_RGB24, MEDIASUBTYPE\_MJPG etc. Is there any way I can...
2011/06/20
[ "https://Stackoverflow.com/questions/6410494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807858/" ]
Besides [what raj correctly said](https://stackoverflow.com/q/6410492#6410562) about the error messages you'd receive if using `use 5.014` with an older version of Perl, you can find a list of features enabled reading the [source code of `feature`](http://cpan.uwinnipeg.ca/htdocs/perl/feature.pm.html#package-feature-)....
The `use x.x.x` pragma **does** turn on some features, and it's easy enough to test this: ``` #!/usr/bin/env perl use warnings; use 5.14.0; say "hello world!" ``` Runs great; outputs "hello world!". ``` #!/usr/bin/env perl use warnings; # use 5.14.0; say "hello world!" ``` Flaming death; outputs this error mess...
71,914
I saw this photograph by Ben Leshchinsky: [![Lake Banff](https://i.stack.imgur.com/kfU6R.jpg)](https://i.stack.imgur.com/kfU6R.jpg) [Source](https://www.nationalgeographic.com/photography/photo-of-the-day/2014/10/lake-louise-banff/) I understand that the photograph was taken from a high vantage point, but the rock fa...
2015/12/17
[ "https://photo.stackexchange.com/questions/71914", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/11582/" ]
Looks like a very long lens to me, as the perspective looks very compressed. It's often used on rows of picturesque houses hugging a hillside to make them all look like they are in the same plane, giving a very "painting-like" effect. It's an effective artistic trick because as you've noticed, it looks very unlike w...
Perception is a mental activity that uses organized inputs. If the input received is not clearly organized, then the mind takes over and creates a most plausible organization for it before perceiving. In this instance, the high altitude, lack of perspective and clear sense of scale, the transition from the monochromati...
804,276
While making some changes in `exim4`, I decided to use the monolithic config style. So as not to confuse myself, I deleted `/etc/exim4/conf.d/`. I now regret this and wish to switch back to the split config style. However, no amount of `dpkg-recongifure`ing or `update-exim4.conf`ing will bring the files back. In fact,...
2016/09/20
[ "https://serverfault.com/questions/804276", "https://serverfault.com", "https://serverfault.com/users/376317/" ]
I think you can just do this. ``` /usr/bin/mysqldump -h $mysql_host -u $mysql_username -p$mysql_password $mysql_database | gzip -9 -c > $backup_path/$today/$mysql_database-`date +%H%M`.sql.gz ```
You can pipe it though **gzip** (or **bzip2**, **pbzip2**, **xz**, etc...) like so: ``` /usr/bin/mysqldump -h $mysql_host -u $mysql_username -p$mysql_password $mysql_database | gzip -c > $backup_path/$today/$mysql_database-`date +%H%M`.sql.gz ``` **zip** isn't the optimal tool for this job because it stores data as ...
26,467
The ability to title/attach an author to a published PDF file is in [`\hypersetup`](http://en.wikibooks.org/wiki/LaTeX/Hyperlinks) which is part of package `hyperref`. But it seems rather unintuitive to me that the `pdftitle`, `pdfauthor`, `pdfsubject` items are part of the `hyperref` package. Why is that? A reason I ...
2011/08/25
[ "https://tex.stackexchange.com/questions/26467", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/5950/" ]
From my reading of OP's question, it sounds like he's asking, if Latex as an overall collection of software/ utilities were made by one person or group, why would they choose to put PDF titling in `hyperref`, a package seemingly with the more concise goal of providing hyper referencing? So, the best answer might be t...
Actually PDF titling can be done using pdfLaTeX without any additional package. For example: ``` \documentclass{article} \pdfinfo{ /Title (thesis.pdf) /Creator (TeX) /Producer (pdfTeX 1.40.0) /Author (Stefan) /Subject (Artificial intelligence and self-modifying TeX documents) /Keywords (pdflatex,latex,pdft...
3,770,100
I'm trying to set a defaultValue to a ListPreference item. Here is an sample of my preference.xml file: ``` <ListPreference android:key="notification_delay" android:title="@string/settings_push_delay" android:entries="@array/settings_push_delay_human_value" android:entryValues="@array/settings_push_delay_...
2010/09/22
[ "https://Stackoverflow.com/questions/3770100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384483/" ]
In addition to Sven's answer, you have to call the setDefaultValues() method in the starting activity. This will set once all default values. ``` public class MainActivity extends Activity { protected void onCreate(final Bundle savedInstanceState) { // Set all default values once for this application // This mus...
If it is a valid value from the list, then re-install the app. It will work.
16,267
Why can't James, Laurent & Victoria "hear" Bella's heartbeat as they are standing in the field? In all of the books it is made quite clear that the vampires hear Bella's heartbeat whenever she's in close proximity to them. Any ideas?
2012/05/06
[ "https://scifi.stackexchange.com/questions/16267", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
In Midnight Sun, Chapter 24, Blood, it shows that Edward had red eyes and that he used contacts to cover up.
Vampire not only have red or golden eyes color, it is said that they also have blue,green, etc. The color of their eyes show their best vampire power, for example, if a vampire have green eyes, they are very good in speed and so on.
914,583
I need to add a choice field to sharepoint that has values depending on the current selection. Example: if the current selection is Open then the options have to be 'open, and In progress ``` **Current selection | Possible selections** Open | Open,In progress In progress | In progress...
2009/05/27
[ "https://Stackoverflow.com/questions/914583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64160/" ]
You can achieve this sort of behavior by editing your list's EditForm.aspx page and adding some JavaScript to the page. Although I can't seem to find any examples for making dependant drop downs, there are a couple examples of modifying the EditForm to hide fields or make them readonly: * [Making a field read-only](h...
So these are 2 columns out of which one filters the other? Sounds like a cascading drop down list, there are a few (commercial) solutions out there. See <http://cascddlistwithfilter.codeplex.com> for a free one.
49,142,180
I am starting to learn how to handle multiple tabs in a browser using Selenium with Java. looks like my code below is not working. ``` import java.util.ArrayList; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium....
2018/03/07
[ "https://Stackoverflow.com/questions/49142180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9453967/" ]
I had a loader on the page that was showing until all the data was returning on the page: ``` public getData() { this.loading = true; this.homeService.getData().subscribe(response => { this.resort = response; this.loading = false; this.error = false; this.getMap(); }, error ...
Perhaps because `HomeComponent` has no `@Component` annotation? For one thing, without `@Component`, there's no way for `HomeComponent` to know that home.component.html is its template, and if it doesn't know its template, it doesn't know `#gmap` is a view child. Simply matching templates to classes by naming conventi...
18,185,749
i have two hbase input aliases: ``` X: (a1,b2) (a2,b2) ... (an,bn) Y: (c1) (c2) ... (cn) ``` Now i want to "join" both aliases: the first line from X with the first line from Y. The final result should be: ``` RESULT: (a1,b1,c1) (a2,b2,c2) ... (an,bn,cn) ``` How can I do that?
2013/08/12
[ "https://Stackoverflow.com/questions/18185749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2653748/" ]
Use `.index()` ``` var index = $('.focus').index(); ``` [**DEMO**](http://jsfiddle.net/7YPAn/) **Specific list** ``` $('.mylist .focus').index() ``` [**DEMO**](http://jsfiddle.net/7YPAn/1/)
In pure JavaScript: ``` var index = 0; var lis = document.getElementsByTagName('li'); for (var len = lis.length; index < len; ++index) { if (lis[index].className.match(/\bfocus\b/)) { break; } } ``` [(fiddle)](http://jsfiddle.net/nAKZF/)
59,261,198
I am writing a bash script that takes information from a text file called "studentlist.txt" and that text file gets passed to the script through a positional parameter. The text file contains firstname, lastname, and ID number. Using that information, I have to create a username and the username is a combination of Fir...
2019/12/10
[ "https://Stackoverflow.com/questions/59261198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12509438/" ]
Is there any need to involve a shell script at all? `awk` alone can handle generating and outputting the combined names without any help from the shell. In your case: ``` $ awk 'NF==3{printf "%s%s%s\n", substr($1,1,1), $2, substr($3,5)}' studentlist.txt JDoe5678 ORaborn6789 LGillan7891 SBisram8912 KEscudero9123 CEspin...
here is a working script: ``` #!/usr/bin/env bash PATH_STUDENTS_FILE="studentlist.txt" USERS_LIST=($(awk '{print substr($1,1,1) $2 substr($3,length($3)-3,length($3))}' "${PATH_STUDENTS_FILE}")) for USER in "${USERS_LIST[@]}" do echo "Delete user account: ${USER}" userdel -r "${USER}" done ``` The result: ...
3,337,868
The question is: Which term of the geometric sequece $4,12,36,\ldots$ is equal to $78732.$ My process of working it out is: $t\_n= t\_1\cdot r^{n-1}$ $78372 = 4\cdot3^{n-1}$ $78372 = 12^{n-1}$ From here onwards I am not sure on what to do. Like how do I go further into solving which term it is. Any steps or commen...
2019/08/29
[ "https://math.stackexchange.com/questions/3337868", "https://math.stackexchange.com", "https://math.stackexchange.com/users/669859/" ]
$$4\cdot3^{n-1}=78732$$ or $$3^{n-1}=19683$$ (here was your mistake) or $$n=1+\frac{\ln19683}{\ln3},$$ which gives $n=10.$ Also, it's better to learn that $$3^9=19683.$$
Note that $78732 = 4\cdot3^{n-1}$ does not imply $78732 = 12^{n-1},$ as you wrote. Instead, from the first equation, divide both sides by $4$ to get $19683= 3^{n-1}.$ This says that $19683$ is some power of $3.$ Multiply both sides by $3$ to give $$3×19683 = 3^n.$$ Now taking logs to base $3$ gives $$1+\log{19683}=n,$$...
678,393
ETA: When I ask "Why do you not use CPAN modules?", I am referring to the people who refuse to use **any** CPAN modules (including high quality ones like [DBI](http://search.cpan.org/dist/DBI/DBI.pm)). Not all CPAN code is of high quality, and it is fine to stay away from modules that are trivial or are based on experi...
2009/03/24
[ "https://Stackoverflow.com/questions/678393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/78259/" ]
You may have the Perl scripting engine embedded in a host application (for example a webserver, or any complex application requiring scripting), and have a whole lot of restrictions in that embedded context, like not being able to load files.
This is an answer with the positive approach, i.e. it says how you can fix the restrictions keeping you from using CPAN modules: [Yes, even you can use CPAN](http://perlmonks.org/?node_id=693828).
8,263,477
So i have a NivoSlider on my page. My problem is that i want the first slide only to show for 2 seconds, and all the other slides for 5 seconds (first one is only some text "Product version 2 is here"). How can i do this? i didn't find any (good) documentation at <http://nivo.dev7studios.com/support/> . here is what i...
2011/11/24
[ "https://Stackoverflow.com/questions/8263477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/728410/" ]
I had this same problem as I had a page with 3 sliders on it, where we wanted 1 to change every 5 seconds, which meant while each one had a 15 second pauseTime, the second one needed a 5 second delay, and the 3rd needed a 10 second delay. I tried the above solutions and many others but couldn't get it to work with the ...
I was having a similar problem. I'm using the fade transition, and it seems like the animSpeed is part of the pauseTime for all slides except the first slide. So, I had these settings: ``` effect: 'fade', animSpeed: 3000, pauseTime: 7000, ``` And it seemed like the first slide displayed for 7 seconds, th...
39,079,850
I am learning Protractor and it seems great. But I'd like to run couple of specs on a single page opening. How can I achieve that? My problem is, a lot of stuff on my page is loaded via ajax, some by cascade. Currently, I am running specs by using `wait` and `beforeEach`. Here's the code: ``` const br = browser; cons...
2016/08/22
[ "https://Stackoverflow.com/questions/39079850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1409674/" ]
One way to do it is as follows: ``` $text = 'test' $found = $false $infile = '.\a.txt' $outfile = '.\b.txt' Get-Content -Path $infile | % { if ($_ -match $text) { $found = $true "SQL.test = False" } else { $_ } } | Out-File -filepath $outfile if (!$found) { "SQL.tes...
I think that this should work for you :) ``` # Get content from the original file $TXT = Get-Content "C:\temp\New Text Document.txt" #Path to new file $NewTXT="C:\temp\newTxt.txt" $i=0 $TXT|ForEach-Object { if ($_ -match "test") {($_ -replace $_,"SQL.test = False") | Out-File $NewTXT -Append $i++ #...
18,533,362
I want to rotate the entire table 90 degrees in the anticlockwise direction. ie. contents of td(row=ith,column=jth) should be transferred to the td(row = (total number of rows-j+1)th , column = ith). The text inside the div also should be rotated by 90degrees. ``` <table><tbody> <tr><td>a</td><td>1</td><td>8</td></tr>...
2013/08/30
[ "https://Stackoverflow.com/questions/18533362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2732631/" ]
> > The text inside the div also should be rotated by 90degrees. > > > So basically you just want the whole thing to be rotated as a block? Maybe you should just use CSS? ``` #myTable { transform:rotate(270deg); } ```
try this **[DEMO](http://jsfiddle.net/pintu31/MRBQ8/3/)** **reference : [Convert TD columns into TR rows](https://stackoverflow.com/questions/2730699/convert-td-columns-into-tr-rows) and modified `david` answer** ``` TransposeTable('myTable'); function TransposeTable(tableId) { var tbl = $('#' + tableId); ...
32,745,866
I have a RSpec test with this: `within all('tr')[1] do expect(page).to have_content 'Title' expect(page).to have_content 'Sub Title' end` And it's failing at `expect(page).to have_content 'Title'` with the following error message: `Element at 54 no longer present in the DOM` I have not been able to find the exact...
2015/09/23
[ "https://Stackoverflow.com/questions/32745866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2690790/" ]
I would try using `one` and `mouseover`: ``` $('.sidebar-trigger').one('mouseover', function() { $('.ui.sidebar').sidebar('show') }); ``` Then, when it has finished animating, reattach the event: ``` $(document).on('transitionend', function(event) { $('.sidebar-trigger').one('mouseover', function() { ...
Ok, my first answer was (of course) way too much work for what it really needed. The onVisible seems to work perfectly. Was that not working for you? Demo [HERE](http://jsfiddle.net/hrn8j0gq/) Simply change 'onShow' to 'onVisible' in your sidebar setting: ``` $('.ui.sidebar').sidebar('setting', { onVisib...
38,477
I have started to notice my 2007 Honda Accord EX V6 wobbles, just slightly. At 5 MPH, It's not very noticeable. When I accelerate to 19-20 MPH, I can definitely tell that it's wobbling. The wobble stops when you go over 20 MPH, but then it starts to vibrate again at 80 MPH. It feels like it is coming from the rear. ...
2016/11/09
[ "https://mechanics.stackexchange.com/questions/38477", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/23381/" ]
If you can feel the car wobbling at such low speeds and you've already put new tyres on it. You likely have bent rear wheel rim.
Your suspension is probably messed up. This is usually caused by driving with mismatched tires. For example, if you get a flat and just replace one tire, you will have mismatched tires. Once the suspension is messed up, you often end up having to replace a bunch of stuff. What happens is that all the seals get all brok...
29,778,809
I am uploading images for our application to the server. Is there any way to validate the extensions in client side by JS before submitting them to the server before uploading them to server? I am using AngularJs to handle my front-end.
2015/04/21
[ "https://Stackoverflow.com/questions/29778809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2809423/" ]
You can use this simple javascript to validate. This code should be put inside a directive and on change of file upload control. ``` var extn = filename.split(".").pop(); ``` Alternatively you can use javascript substring method also: ``` fileName.substr(fileName.lastIndexOf('.')+1) ```
Here is the complete code for validating file extension usign AngularJs ``` <!DOCTYPE html> <html> <head> <title></title> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script type='text/javascript'> var myApp = angular.module('myApp', []); ...
103,027
I am looking for the origin of the phrase "break bread" meaning to eat (or, I expect, to share food). I know that it can be sourced to the book of Acts but I have also seen many websites which say that it is older than that, reflecting a biblical era practice of sharing food to solemnize a meal, just with no actual ref...
2013/02/05
[ "https://english.stackexchange.com/questions/103027", "https://english.stackexchange.com", "https://english.stackexchange.com/users/24436/" ]
Although it is seen in the Bible, I am sure we can find references in other Greek and Hebrew literature if one really put the effort in some database. I am from India, and I have heard the phrase "to break bread" in Hindi idioms like "to break breads for free", the idiom is used to malign someone that he is eating for ...
It also appears in Mark and Mathew. But the notion can also be seen in some of the Pre-socratic thinkers.
29,306,386
I am building a VB Parser and I have to parse VB classes as file. Right now I'm proceeding like this: ``` Dim lines As List(Of String) = File.ReadAllLines(fileName).ToList() ``` Where `fileName` is the actual path of the vb class file to parse. However my main concern is that it actually get ALL the lines in the fi...
2015/03/27
[ "https://Stackoverflow.com/questions/29306386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2021863/" ]
Unfortunately it seems to be an [unsupported feature](http://public.kitware.com/Bug/view.php?id=13007) (issue is "tracked" [here](https://gitlab.kitware.com/cmake/cmake/issues/13007), doesn't look like it will ever be handled). But there's a workaround: you can use [configure\_file](http://www.cmake.org/cmake/help/lat...
With [CMake 3.14](https://blog.kitware.com/cmake-3-14-0-available-for-download/) you can now do: ``` cmake -E compare_files --ignore-eol file1 file2 ```
6,774,235
I am using Selenium to test a web site which has HTTP Auth and now even SSL certificate. As workaround for HTTP Basic Authentification I am using ChromeDriver - <http://code.google.com/p/selenium/wiki/ChromeDriver> and opening URLs in format ``` https://username:password@my-test-site.com ``` But now from security r...
2011/07/21
[ "https://Stackoverflow.com/questions/6774235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/855636/" ]
Instead of installing the Client Certificate you could just tell Chrome to ignore the untrusted certificate error using the `--ignore-certificate-errors` command line switch. To do this, create your instance of `ChromeDriver` as follows: ``` DesiredCapabilities capabilities = DesiredCapabilities.chrome(); capabilitie...
You can tell the Chrome browser to use a specific client certificate for a particual URL by adding a registry KEY with the following content: ``` HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\AutoSelectCertificateForUrls\1 = "{\"pattern\":\"https://www.example.com\",\"filter\":{\"ISSUER\":{\"CN\":\"cn of issuer\"...
56,595,080
I want change the launcher icon but it doesn't change it. I followed the instruction in other SO post. What's wrong in my code? Thanks in advance. [![enter image description here](https://i.stack.imgur.com/uHquUl.jpg)](https://i.stack.imgur.com/uHquUl.jpg)[![enter image description here](https://i.stack.imgur.com/A...
2019/06/14
[ "https://Stackoverflow.com/questions/56595080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In short: * You are changing the *legacy launcher PNG*, but you are viewing your app on a newer device which uses *adaptive launcher icons*. --- Android API 26 introduced the concept of [Adaptive icons](https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive). Instead of supplying the icon ...
Android API 26 introduced the concept of Adaptive icons. Instead of supplying the icon and background in one PNG (per DPI size), we now supply the icon as a "foreground" image, and the "background" resource seperately. This allows the launcher app to choose whichever shape of background it is configured for, and use t...
346,547
I have a center tap transformer that does 110 or 220VAC stepdown to two 6V rails (with opposing phases). On the 110/220 side there are what appear to be two separate rails, and the wiring diagram is a bit confusing to me: [![Two black/red rails on left, 6/0/6 center-tap rails on right](https://i.stack.imgur.com/kZ8iy....
2017/12/24
[ "https://electronics.stackexchange.com/questions/346547", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8780/" ]
Your understanding is correct. ![schematic](https://i.stack.imgur.com/ZwVjC.png) [simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fZwVjC.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/) *Figure 1. Primary and secondary windings.* Note that the voltage between...
Parallel black to black. Parallel red to red. Apply 110 Vac between black and red. Take out 6 Vac between blue and yellow. Yes, the idea for 230 V operation is to tie them in series. Very common arrangement to be able to have the same transformer for the world market. Dual 6 V secondaries is most probably to be able ...
11,273,684
I am trying to sort the NSMutablArray values by Aa-Zz format in iPhone app. I have used the below code in my project. ``` for (id key in [dictionary allKeys]) { id value = [dictionary valueForKey:key]; [duplicateArray addObject:value]; [value release]; value =nil...
2012/06/30
[ "https://Stackoverflow.com/questions/11273684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1005346/" ]
Gopinath. Please use this updated code in your project. ``` for (id key in [dictionary allKeys]) { id value = [dictionary valueForKey:key]; [duplicateArray addObject:value]; [value release]; value =nil; NSSortDescriptor *sortdis = [[[NSSortDescriptor alloc] initWithKey:@...
``` for (id key in [dictionary allKeys]) { id value = [dictionary valueForKey:key]; [duplicateArray addObject:value]; } NSSortDescriptor *sortdis = [[[NSSortDescriptor alloc] initWithKey:@"Name" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)]autorelease]; NSArr...
86,669
Hey fellow Photographers, I've taken the below image today and info attached. Please review and comment on it which would help me to improve. Exif : Body : Nikon d5300 Lens : 50mm Exposure : 1/400s Aperture : f1.8 ISO : 100 No Flash Photoshop Edits : * Clarity been increased * Adjusted whites/black/shadows [![e...
2017/01/29
[ "https://photo.stackexchange.com/questions/86669", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/59984/" ]
Yes, there is demand for it. Film sales seem to have hit the bottom and are picking up (from a low base). Instead of all the doom and gloom stories of a few years back there is a trickle of good news as well - especially the Black & White film scene is doing well, with several new emulsions introduced on the European m...
There is absolutely a demand growing for medium format (MF) film photography (i can not speak for large format since i never touched it). Sure, demand is not high as before, because there are many MF digital options in the market for every budget, do not think it's cheap; cheaper than hasselblads let's say). However...
22,345,409
I am create view pager with custom view pager adapter but when i run the project i can not see anything ``` public class CustomAdapter extends PagerAdapter { private List<NewsObject> newsObjects; private Activity mActivity; private LayoutInflater inflater; private ImageLoaderConfigu...
2014/03/12
[ "https://Stackoverflow.com/questions/22345409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2150318/" ]
write ``` container.addView(viewLayout); ``` before returning the view in `instantiateItem` ``` public Object instantiateItem(ViewGroup container, int position) { ImageViewPlus img_news_image; TextView txt_news_title; TextView txt_news_description; inflater = (LayoutInflater) mA...
``` <TabHost ...... <TabWidget ..... <FrameLayout android:id="@android:id/tabcontent" android:layout_width="0dp" android:layout_height="0dp" > </FrameLayout> <android.support.v4.view.ViewPager ```
232,571
I have a second Radeon 5850 coming, and I'd like to see the performance that the second card offers. To do this, I'd like to try the game with Crossfire, disable it, and then try it with just a single card. Can this be done easily in software, or do I need to remove the bridge or (even worse) the second card?
2011/01/13
[ "https://superuser.com/questions/232571", "https://superuser.com", "https://superuser.com/users/25808/" ]
Head over to Catalyst Control Center, Crossfire tab & uncheck the checkmark against Crossfire. ![alt text](https://i.stack.imgur.com/7TKt5.jpg)
Do it in the other direction man...I've had problems disabling crossfire and SLI without uninstalling the driver and re-install. Just saying. That's how I got it demonstrated though.
48,121,050
I write a program that read from text file. I need to read the lines and do as follow the text. for example: > > aaaa=3 > > > cccc=hi > > > bbb=2 > > > ee=true > > > print(bbb) > > > so my output will be:*2* I use a template and write the "generic" function print. but I'm looking for Data Structure that ...
2018/01/05
[ "https://Stackoverflow.com/questions/48121050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9179230/" ]
To change to the project folder you can use the command **--chdir**. Example: ``` gunicorn -w 2 -b 0.0.0.0:8000 --chdir /code/myproject myproject.wsgi ```
Change this: ``` CMD gunicorn -w 3 -b 0.0.0.0:8080 wsgi --reload ``` to this: ``` CMD gunicorn -w 3 -b 0.0.0.0:8080 /full/path/to/wsgi --reload ``` where `/full/path/to/wsgi` is the absolute path of your app--I'm guessing it's `/usr/src/app/wsgi`?)
69,724,626
Hiyya, So much like the title says, I've stumbled upon a issue where I cannot get two buttons that are inline centered, when one has more content than the other. First and foremost, this is what it's currently looking like: [![](https://i.stack.imgur.com/cy2Do.png)](https://i.stack.imgur.com/cy2Do.png) As we can se...
2021/10/26
[ "https://Stackoverflow.com/questions/69724626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4508613/" ]
Something like this should work, making it one div instead of two. ``` <div class="row-fluid visible-desktop"> <div class="span12" style="text-align: center;"> <a href="#"><button type="button" class="btn btn-default">Ja, tack!</button></a> <a href="#"><button type="button" class="btn btn-inverse">...
I would consider using a grid layout so that it can account of varying lengths of text. However, from a UI / UX point of view, equal button sizes in this scenario would look and feel much nicer. ```css .wrapper { width: 500px; background: #ebebeb; border: 1px solid #d9d9d9; border-radius: 5px; padding:10px; ...
1,154
Is it best to remove tags of closed questions? Or is it best to update their tags to keep them current, just like any other question?
2015/03/31
[ "https://softwarerecs.meta.stackexchange.com/questions/1154", "https://softwarerecs.meta.stackexchange.com", "https://softwarerecs.meta.stackexchange.com/users/8503/" ]
A good question I'm also thinking about from time to time: though "closed", those questions stay and are often kept as references – especially with "duplicates", which serve as pointers to the "originals"; which allows for finding those with different search patterns. Still, I'd say: Unless worth re-opening for some r...
Expanding a bit on Izzy's answer. Closed questions are of several types: 1. *Questions closed as duplicates*: These questions remain as a reference and serve as an additional link to direct search results to the answers of the original (sometimes even less popular) question. In this case, I think that the tags on such...
52,504,732
I have the issue that my GPU memory is not released after closing a tensorflow session in Python. These three line suffice to cause the problem: ``` import tensorflow as tf sess=tf.Session() sess.close() ``` After the third line the memory is not released. I have been up and down many forums and tried all sorts of...
2018/09/25
[ "https://Stackoverflow.com/questions/52504732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10414947/" ]
Refer to [this](https://github.com/tensorflow/tensorflow/issues/17048#issuecomment-367948448) discussion. You can reuse your allocated memory but if you want to free the memory, then you would have to exit the Python interpreter itself.
If I'm understanding correctly, it should be as simple as: `from numba import cuda` `cuda.close()`
352,036
I'm training a neural network but the training loss doesn't decrease. How can I fix this? I'm not asking about overfitting or regularization. I'm asking about how to solve the problem where my network's performance doesn't improve on the **training set**. --- This question is intentionally general so that other ques...
2018/06/19
[ "https://stats.stackexchange.com/questions/352036", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/22311/" ]
Verify that your code is bug free ================================= There's a saying among writers that "All writing is re-writing" -- that is, the greater part of writing is revising. For programmers (or at least data scientists) the expression could be re-phrased as "All coding is debugging." Any time you're writin...
The posted answers are great, and I wanted to add a few "Sanity Checks" which have greatly helped me in the past. 1) **Train your model on a single data point. If this works, train it on two inputs with different outputs.** This verifies a few things. First, it quickly shows you that your model is able to learn by ch...
73,083,174
I'm trying to implement a function to send a a notification using FirebaseCloudMessaging, I got the Auth part, But seems there is an issue with the GuzzleHttp\Client and how it passes the `data` part This is my code ``` public function send(){ putenv('GOOGLE_APPLICATION_CREDENTIALS=<path-to-json-file>.json');...
2022/07/22
[ "https://Stackoverflow.com/questions/73083174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19601996/" ]
As, [rafaelc](https://stackoverflow.com/users/2535611/rafaelc) [mentioned](https://stackoverflow.com/questions/73083163/pandas-apply-converts-index-values-to-float-while-iterating#comment129076415_73083163): This is an automatic conversion that pandas will do to optimize operations with row. If row contained both inte...
I expect this to happen because `pandas.Series` can have only one `dtype` and therefore 'int' is automagically converted to `float`. As a workaround, this may work for you: ``` for i in df[df['b'].eq(0)].reset_index().itertuples(index=False): print(i) ``` Result: ``` Pandas(index=2, a=163, b=0.0, c=0.034) Pandas(i...
33,946,149
I'm trying to get a list of installations based on a userID field. Currently this returns the error "at least one ID field (installationId,deviceToken) must be specified in this operation" ``` $url = 'https://api.parse.com/1/installations'; $user_id = "3014"; $APPLICATION_ID = 'xxxxxxxxxxxxxxxx'; $REST_API_KEY = 'xxxx...
2015/11/26
[ "https://Stackoverflow.com/questions/33946149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1092872/" ]
[`docker compose`](https://github.com/docker/compose) is just a way to declare the container you have to start: ~~it has no notion of node or cluster~~, unless it launches swarm master and swarm nodes, but that is [`docker swarm`](https://docs.docker.com/swarm/)) Update July 2016, 7 months later: docker 1.12 blurs t...
There's a difference with respect to networking: * Containers in a pod share the same IP address. From [kubernetes docs](https://kubernetes.io/docs/user-guide/pods/#resource-sharing-and-communication): > > The applications in a pod all use the same network namespace (same IP and port space), and can thus “find” each...
7,037,092
Is it true that template code compiled and linked into a PE will increase in size compared to code without templates. I think each instances of templates used is packed orderly so it will output a match if required faster. Sorry for the question I just don't know much about template.
2011/08/12
[ "https://Stackoverflow.com/questions/7037092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/891341/" ]
The template itself doesn't take any space at all. It the instantiations of that template that do. A template is instantiated once you use it with a type parameter - `MyClass<int> mc`. An instantiation is created once for every type you use, so `MyClass<int> mc2` won't cause another instantiation, but rather use the ex...
In addition to answers given by @Als and @eran: Compiler and Linker would work collectively to find out code that is same for two or different data types for given class/functions, and if they find out similar code, that is **not-dependent** on datatype, they may create one copy of that code. The code might be a metho...
13,962,743
I have a form that give `Fname` and `Lname` and `Date` and a method to write this information to a file. If `Fname` or `Lname` contain digit, the program should display an error message and not run all below statements ,(like write to file and generate random number and...), and not exit. since i dont know how to do l...
2012/12/19
[ "https://Stackoverflow.com/questions/13962743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1900445/" ]
As a general rule, try to stay away from using `System.exit()` in GUI-driven applications. It'll just make the whole program quit, leaving the user wondering what happened. `System.exit()` is usually better suited for command line applications that want to provide an exit code to the shell and it's a parallel to the [s...
``` if(havedigit(getFName())==true) { System.exit(1); } setLName(jTextField2.getText()); if(havedigit(lastName)==true) { System.exit(1); } ``` should be ``` if(havedigit(getFName())) { JOptionPane.showMessageDialog(.....); return; //get out of method, no need...
11,376,002
I have developed a jsf application with following facets * Dynamic Web Module 2.5 * Java 5 * JavaServer Faces 1.2 * Rich Faces 3.3.2 I have a page with an t:inputFileUpload component. it was working fine till i added ajax and rich faces components and taglibs to my page. As follows:- ``` <%@ taglib uri="http://java....
2012/07/07
[ "https://Stackoverflow.com/questions/11376002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1353036/" ]
It should work fine as long as you don't submit the form by ajax. It's namely not possible to upload files by ajax using the `<t:inputFileUpload>`. So, you need to make sure that you submit the form by a synchronous (non-ajax) request. You should also make sure that the Tomahawk's `ExtensionsFilter` is been registered...
Please make sure that you have an "encrypeType" in your form. ``` <h:form enctype="multipart/form-data"> ```
23,379,170
I want to add arbitrary item to Pidgin menu. Let it be *Buddies → Show → Groups*. I want it to be checkbutton (like *Buddies → Show → Empty Groups*) with custom function associated. How can I do this? * [In Pidgin 2.10.9](https://stackoverflow.com/a/23379171/2572082) * [In Pidgin 3.0.0 (development branch)](https://st...
2014/04/30
[ "https://Stackoverflow.com/questions/23379170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2572082/" ]
*The following example is for Pidgin version 2.10.9. I believe there are not many changes in 3.0.0 (current development branch) so it will be applicable there too with minimal modifications.* First of all, download Pidgin sources. In Ubuntu this is done simply by running ``` apt-get source pidgin ``` Which will fet...
Pidgin-3.0.0 ------------ There are some changes in the way which Pidgin generates menu in 3.0.0 version. First, there is new array `GtkToggleActionEntry blist_menu_toggle_entries[]`. You need to add there ```c { "ShowGroups", NULL, N_("_Groups"), NULL, NULL, G_CALLBACK(pidgin_blist_show_groups_cb), FALSE }, ``` af...
168,928
Let's say that I have earned 100% of the trophies in *Borderlands 2* on the PS3. If I were to play the PS Vita version, would it register as a new *game* on my PSN, therefore allowing me to earn all the trophies again? Or rather, would it *stack* on top of my existing trophies? And in the same line of question: Would ...
2014/05/22
[ "https://gaming.stackexchange.com/questions/168928", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/77107/" ]
No, PS3 and Vita have the same trophy list. There is cross save between PS3 and vita for Borderlands 2.
You will not re-earn trophies.
70,006,819
I have an application that is composed by different layers and written in three different languages: c++, bash and python EDIT: on a Linux/Raspbian platform Since now we are managing different build, platform depending, with different branches of sw development, but I'm trying to merge everything in a single branch to...
2021/11/17
[ "https://Stackoverflow.com/questions/70006819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17439426/" ]
I fixed using a barrier and `app:barrierAllowsGoneWidgets="false"` and setting the right view constrained to the barrier ``` <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/myLayout" android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android...
To solve the problem I will recommend you to use LinearLayout and the property weightSum. So it will be something like this: ``` <LinearLayout android:id="@+id/myLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:weightSum="3"> <TextView android:id="@+...
68,286,020
I am trying to create a registration form using Django as I have created the form and model on the website after clicking the submit it calls for the view as action provided to the form but it seems that no data is been inserted in the database and no error in the terminal as well. I have tried to find solutions but no...
2021/07/07
[ "https://Stackoverflow.com/questions/68286020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13016907/" ]
Try using this: ``` createnewuser=Writer.objects.create_user(username,first_name,last_name,email,gender,contactnumber,password) createnewuser.save() ``` You should use the default 'User' model of django.It will be easy for you
Question, why are you not using a ModelForm? A modelform can do a lot of validation for you, such as checking for required fields and even custom validators? See documentation: <https://docs.djangoproject.com/en/3.2/topics/forms/modelforms/>
18,423,124
I'm under osx 10.8.4 and have installed gdb 7.5.1 with homebrew (motivation get a new gdb with new features such as --with-python etc... ) Long story short when I run debug within a c++ Eclipse project I get : ``` Error in final launch sequence Failed to execute MI command: -exec-run Error message from debugger back ...
2013/08/24
[ "https://Stackoverflow.com/questions/18423124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2714339/" ]
None of this worked for me and I had to go with a long run. Here is a full list of steps I've done to get it working. 1. Create a certificate to sign the gdb. Unfortunately, system certificate gave me `Unknown Error = -2,147,414,007` which is very helpful, so I had to go with a workaround. `Keychain Access -> Create ...
I can recommend to follow this gist: <https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d#file-codesign_gdb-md> With trick to overcome: `unknown error = -2,147,414,007` during Certificate Creation described here: <https://apple.stackexchange.com/a/309123> **Notes:** Path for gdb installed as `homebre...
20,467,617
Following is code ``` class Hotel { public int bookings; public void book() { bookings++; } } public class Test extends Hotel{ public void book() { bookings--; } public void book(int size) { book(); super.book(); bookings += size; } public static void main(String... args) { Hotel hote...
2013/12/09
[ "https://Stackoverflow.com/questions/20467617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2902950/" ]
`hotel` is of type `Hotel`, which **doesn't have** `book(int)` method. If you want to call `book(int)` you need to change (or cast) `hotel`'s type to `Test` ``` Test hotel = new Test(); hotel.book(2); // No error ```
Class `Hotal` is not aware of the method `public void book(int size)` , and for invocation you are using the reference of `Hotel`. Runtime polymorphism is nothing but defining a contract for all who implement the base class/interface. This enable objects to interact with one another without knowing their exact type. ...
58,019,275
I am reading [this book](https://www.amazon.co.uk/Beginning-STM32-Developing-FreeRTOS-libopencm3/dp/1484236238) and I have come across this code: ``` static void task1(void *args) { int i; (void)args; for (;;) { gpio_toggle(GPIOC,GPIO13); for (i = 0; i < 1000000; i++) __asm__(...
2019/09/19
[ "https://Stackoverflow.com/questions/58019275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8896573/" ]
In general when one does not use an function argument, the compiler is likely to warn you about it. After all if you aren't going to use it why put it there in the first place? In effect it is an artificial use of the argument that does nothing useful other than telling the compiler you know what you are doing, so "*S...
It's a compiler warning (`-W unused-variable` or `-W all`) they're suppressing by using it. You are correct in that `__attribute__((unused))` is a valid C macro to do what you're asking, but it's a matter of preference. It's also not supported by all C compilers. Sources: <http://www.keil.com/support/man/docs/armcc/ar...
23,867,903
Now I have a directory with bunch files with format of name like "EXT2-401-B-140422-1540-1542.mp4", within which the "140422" part indicates the date. Now assume that this bunch of files have the dates like 140421, 140422, 140423...(for every date there are couple of files). Now I shall sort these files according to th...
2014/05/26
[ "https://Stackoverflow.com/questions/23867903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3433408/" ]
``` directory = new DirectoryInfo(camera_dir); string[] date = new string[directory.GetFiles().Length]; int i=0; foreach (FileInfo file in directory.GetFiles()) { name[i] = file.Name.Substring(11, 6); i++; } ```
In fact you are asking two questions. 1. You cannot assign a variable from the `foreach`. Create a new one to store the name in. 2. For the second part, how to extract it: use this regex: ``` string s = Regex.Replace(file.Name, @"(.*?)\-(.*?)\-(.*?)\-(.*?)\-(.*)", "$4"); ``` The `?` makes the regex non-greedy, mean...
4,084,212
Just switched from Cucumber+Webrat to Cucumber+Capybara and I am wondering how you can POST content to a URL in Capybara. In Cucumber+Webrat I was able to have a step: ``` When /^I send "([^\"]*)" to "([^\"]*)"$/ do |file, project| proj = Project.find(:first, :conditions => "name='#{project}'") f = File.new(File....
2010/11/03
[ "https://Stackoverflow.com/questions/4084212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/216287/" ]
Capybara's `visit` only does GET requests. This is by design. For a user to perform a `POST`, he must click a button or submit a form. There is no other way of doing this with a browser. The correct way to test this behaviour would be: ``` visit "project/:id/edit" # This will only GET attach_file "photo", File.ope...
With an application using RSpec 3+, you would not want to make an HTTP POST request with Capybara. Capybara is for emulating user behavior, and accepting the JS behavior and page content that results. An end user doesnt form HTTP POST requests for resources in your application, a user clicks buttons, clicks ajax links,...
34,605,163
I'm using a select tag to create a currency menu , what I'm trying to do is get the value of the selector so i can turn it into a variable to use. I already tried various methods that were also posted on stack but I keep getting returned my line of code instead of the value of the currency. this is my javascript. `...
2016/01/05
[ "https://Stackoverflow.com/questions/34605163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5451743/" ]
This can be done by using `$('#selectId option:selected').text();`. ``` $(document).ready(function(){ $(".btn").on("click", function(){ var userCurrency = $('#userCurrency option:selected').text(); console.log(userCurrency) $.ajax({ type: "GET", url: bitcoinApiUrl, dataType: "json", success: function(currency...
you have to change. ``` document.getElementById('userCurrency'); ``` to ``` document.getElementById('userCurrency').value; ``` to get the value of select box.
3,074,452
Is it best to program a game for the iPhone in Objective C or in C++. What language would a game like Flight Control be written in? What format should graphics be in to show properly and load quickly on the iPhone?
2010/06/19
[ "https://Stackoverflow.com/questions/3074452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/370865/" ]
Games like Flight Control are usually written in Objective-C with some C calls to OpenGL and other C APIs. The graphics can be stored in PNG or JPEG. I would stay out of C++ unless I had to use some C++ code or had developers with good C++ knowledge. According to my experience the bottleneck is seldom in the language, ...
I appreciate everybody's quick response and expertise. I am in the process of learning either C++ or Objective C and it looks as though Objective C is more direct to the iPhone. My background is "gasp" COBOL85 (among other arcane languages). I would rather have someone already fluent in iPhone apps code the game, b...
29,797,367
My inexperience has me here asking this question. Can I pass a value to multiple `PHP` pages in `JQuery`? Here is an example of what I am trying to do. ``` $(function() { $("#account").change(function() { $("#facilities").load("displayfacilities.php?q=" + $("#account").val()); $("#facilities").load("updatef...
2015/04/22
[ "https://Stackoverflow.com/questions/29797367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2057853/" ]
Since the inner exception is an exception itself, perhaps you can just recurse and reuse the method you already have: ``` if (e.InnerException != null) { LogCompleteException(controllerName, actionName, e.InnerException); } ``` If this does work, however, you will still be missing the EntityValidationErrors. An...
you could use [elmah](https://code.google.com/p/elmah/) and the [log4net appender](https://www.nuget.org/packages/elmahappender_log4net_1.2.10/). Elmah logs catches all exceptions and can log them to a log4net instance.
161,263
I'm building a new SharePoint farm to test migration of old, old, old MOSS content to SP13. Using a migration tool to migrate content, but need recommendation for build sequence: **Option 1:** build farm, build web app, apply all service packs, etc to get to current release, use migration tool to migrate old content t...
2015/11/02
[ "https://sharepoint.stackexchange.com/questions/161263", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/48403/" ]
I have yet to actually deploy it - but I'm pretty sure it will still be around - at minimum to support upgrade. 1. It's not on the deprecated feature list <https://technet.microsoft.com/en-us/library/mt346112%28v=office.16%29.aspx?f=255&MSPPError=-2147217396> 2. They still exist in Office 365 3. The biggest reason - ...
What my understanding as Microsoft bring back InfoPath forms in sharePoint 2016. that's mean SharePoint 2010 Workflow will work as some of infopath services required for the Workflow in Sp 2010. > > This leads me to believe that SharePoint 2016 may still be able to run > SharePoint 2010 Workflows like 2013 did by d...
40,898,512
I am using the Street View Javascript Api in a project, and I understand how to use heading to make the Google's panorama aim north. Now I am also getting all the tiles that create this panorama and using them to create a 360° raw panorama image. However, I want to know if there is a way to find out automatically whe...
2016/11/30
[ "https://Stackoverflow.com/questions/40898512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2578183/" ]
`INT` and `NUMERIC` isn't the same. `ISNUMERIC` is returning anything that *could* possibly be a numeric type `(INT, BIGINT, DECIMAL, FLOAT, MONEY)`. Example: `SELECT ISNUMERIC('$')` This isn't an `INT` but returns true because it is something that is correctly formatted as `MONEY`. `ISNUMERIC` also works on scientif...
You hit by chance one valid notation (I did not know this either): ``` SELECT CAST('45D-1' AS FLOAT) --4.5 SELECT CAST('45D-2' AS FLOAT) --0.45 SELECT CAST('45D-3' AS FLOAT) --0.045 SELECT CAST('45D+1' AS FLOAT) --450 SELECT CAST('45D+3' AS FLOAT) --45000 ``` Produces the same results as ``` SELECT CAST('45e-1' AS ...
170,308
The cover was white and had a red swirly mask on it. I think the first book started with her flying. There were hunters and the main character got captured and they did experiments and locked them in cells and stuff. I'm pretty sure that, before all that, they lived in this village thing hidden by people with magic o...
2017/09/24
[ "https://scifi.stackexchange.com/questions/170308", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/90272/" ]
Could this possibly be the [***Firelight***](https://www.goodreads.com/book/show/6448470-firelight) series by Sophie Jordan? > > Marked as special at an early age, Jacinda knows her every move is watched. But she longs for freedom to make her own choices. When she breaks the most sacred tenet among her kind, she near...
Another possibility: The [***Talon***](https://www.goodreads.com/series/96817-talon) series by Julie Kagawa. > > The series revolves around dragons with the ability to disguise themselves as humans and an order of warriors sworn to eradicate them. The dragons of TALON and the Order of St. George have been at war with...
36,052
1. **Why “Strings” are bad for Arduino?** 2. **Which is the most efficient and fastest solution to read and store the data from Accelerometer and GPS?** --- ***Stings are evil for Arduino*** --------------------------------- --- An Uno or other ATmega328-based board only has 2048 bytes SRAM. The SRAM is composed b...
2017/03/20
[ "https://arduino.stackexchange.com/questions/36052", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/20786/" ]
A chat system I used to use "back in the day" used a fixed "stack" based string buffer. Basically a single `char *` buffer of a fixed size was created at the beginning of the program and initialised to 0. Then strings were appended to that buffer using whatever functions were appropriate at that time. A pointer was k...
For fixed strings (which do not change), use e.g. F("Text") ... this will place the string in flash instead of heap space. Note that the Uno has 32 KB of flash and 2 KB of SRAM (which is used for heap space among others). If you need variable sized strings but one or few at a time, make a dedicated buffer (of e.g. 64 ...
59,219,485
I have a full-width Bootstrap dropdown menu that is not working properly as it has a lot of space between the button and the menu. So far I am only using CSS for this, no javascript. Here´s the code: HTML: ``` <nav class="p-4 navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#"> ...
2019/12/06
[ "https://Stackoverflow.com/questions/59219485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6751870/" ]
One solution (works with your text input in your question, probably needs more input data to work-out quirks): ``` data = [ "get it as soon asdec. 5 - 9 when you choose expedited shipping at checkout.", "get it as soon asdec. 10 - 13 when you choose standard shipping at checkout.", "get it as soon as", ...
You may use a pattern with a bit more precise patterns in between numbers and a couple of optional groups: ``` (jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\W*(\d{1,2})(?:(?:.*?(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?\W+(\d{1,2}))? ``` Or, add word boundaries to only match months as whole words: ``` ...
1,540,658
I have been trying to solve this "Concurrent Programming" exam exercise (in C#): > > Knowing that `Stream` class contains `int Read(byte[] buffer, int offset, int size)` and `void Write(byte[] buffer, int offset, int size)` methods, implement in C# the `NetToFile` method that copies all data received from `NetworkStr...
2009/10/08
[ "https://Stackoverflow.com/questions/1540658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/76219/" ]
Even though it goes against the grain to help people with their homework, given that this is more than a year old, here's the proper way to accomplish this. All you need to **overlap** your read/write operations — no spawning of additional threads, or anything else is required. ``` public static class StreamExtensions...
It's strange that no one mentioned TPL. [Here](http://blogs.msdn.com/b/pfxteam/archive/2009/06/30/9809774.aspx)'s very nice post by PFX team (Stephen Toub) about how to implement concurrent async stream copy. The post contains out-dated refenrece to samples so here's corrent one: Get [Parallel Extensions Extras f...
44,989,393
I have created dialog as component inside another component. Dialog opens without issue but after closing and trying reopen it id not visible. Parent component ```js import { Component,OnInit } from '@angular/core'; import { PostComponent } from './post/post.component'; @Component({ selector: 'app-root', tem...
2017/07/08
[ "https://Stackoverflow.com/questions/44989393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3063873/" ]
**Adding the code to solve the problem** Child Component HTML ``` <p-dialog header="Reschedule Unassigned Task" [(visible)]="_display" modal="modal" width="700" [responsive]="true" [blockScroll]=true (onHide)="onHide($event)"> ``` Child Component ``` @Input() get display(): string { return this._display; } s...
I managed to solve this issue but there are some key points missed in all the answers. When you click 'close' in the top right it runs close() in the child component. It is here where you have to emit the change back to the parent: ``` export class child-comp implements OnInit { @Input() showDialog: boolean; @Outp...
24,649,119
I have a class with n data members as follows : ``` public class Input { int mode1 {get; set;} int geom2 {get; set;} int type3 {get; set;} int spacing4 {get; set;} int fluid5 {get; set;} int spec6 {get; set;} ... ... ... int data_n {get; set;} } ``` and I have a filled li...
2014/07/09
[ "https://Stackoverflow.com/questions/24649119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2149396/" ]
You could try something like this (*object initializer*): ``` Input input = new Input { mode1 = dataList[0], geom2 = dataList[1], type3 = dataList[2], spacing4 = dataList[3], fluid5 = dataList[4], ...
You can do this from reflection using `GetProperties` method as others said but why not use a simple way to do this? ``` Input i = new Input(); i.mode1 = dataList[0]; i.geom2 = dataList[1]; i.type3 = dataList[2]; i.spacing4 = dataList[3]; i.fluid5 = dataList[4]; i.spec6 = dataList[5]; ```
9,833,009
I'm looking for a javascript diff algorithm implementation or library, which has been tested on and works with arbitrary utf8 text files. All of the ones I found so far (say for example, <http://ejohn.org/projects/javascript-diff-algorithm/>) fail on corner cases (Try using a file which contains the string `'__prot...
2012/03/23
[ "https://Stackoverflow.com/questions/9833009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173773/" ]
I'm a fan of [google diff match patch](https://code.google.com/p/google-diff-match-patch/). You can try out an example [here](http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_diff.html). There are different cleanup option to tweak the level of commonality between the diffs. I don't like the seman...
There is an diff algorithm implementation that I wrote with javascript in the following page. <https://github.com/cubicdaiya/onp> This runs with node.js. Forthermore there is a C++ addon version for node.js in following page. <https://github.com/cubicdaiya/node-dtl> You can install this with npm. $ npm install -g...
348,943
I have a multipolygon containing a one large polygon, itself containing a number of smaller polygons, which constitute 'holes' in the largest polygon. My goal is to simplify the multipolygon into one polygon that closely respects the existing perimeter but removes all the smaller polygons (holes) I have been using a ...
2020/01/29
[ "https://gis.stackexchange.com/questions/348943", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/157261/" ]
According to the data provided Try to go that way: ``` SELECT ST_MakePolygon(ST_ExteriorRing((ST_Dump(geom)).geom)) geom FROM data ORDER BY geom ASC LIMIT 2; ``` It's gotta work... or ``` WITH tbla AS (SELECT ST_MakePolygon(ST_ExteriorRing((ST_Dump(geom)).geom)) geom FROM data) SELECT ST_Union(geom) geom FROM tb...
The "lines and points" in the geometry are actually very narrow/small holes. So it seems like you are looking to remove all the holes from a MultiPolygon. An approach for this is: * "Explode" the MultiPolygon into separate Polygons using `ST_Dump` * Remove the holes from each element Polygon using `ST_MakePolygon(ST_E...
20,512,141
User.Identity can be accessed in a controller of course. But I don't want to have every controller have a copied method to grab user common attributes. ``` public class myClass { public void myMethod() { //assume user is authenticated for the purposes of this question var currentUserId = User.Identity....
2013/12/11
[ "https://Stackoverflow.com/questions/20512141", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1779772/" ]
You may want to use an absolute-positioned set of coloured divs within a relative-positioned container. See this: <http://jsfiddle.net/aUsHh/13/> CSS: ``` #slidercontainer { display: block; position: relative; width: 100px; height: 100px; } #slidercontainer div { position: absolute; display: ...
try js like this ``` if(window.location.hash) { var hash = window.location.hash; $('div').hide(1000); $(hash).show(1000); } $(window).on('hashchange', function() { var hash = window.location.hash; $('div').hide(1000); $(hash).show(1000); }); ``` you can use time in jquery hide and show funct...
43,709,004
I'm working on app which shows the lyrics of song. And I have got an error: Method getText() must be called from the UI Thread. I was searching for answer, but no answer has helped solve the problem. ``` public class HomeActivity extends AppCompatActivity { private EditText wykonawca; private EditText tytul; private...
2017/04/30
[ "https://Stackoverflow.com/questions/43709004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7337397/" ]
In your parent constructor you need to bind the function properly. This is what it could look like: ``` constructor(props) { super(props); this.updateState = this.updateState.bind(this); this.state = { test: 0 }; } ```
Corrected, working example based on answers above: Parent: ``` export default class GameList extends Component { constructor({ navigation }) { super(); this.state = { test: 0, } }; updateState() { this.setState((prevState) => { debugger; return ({ test: prevState.test ...
38,883,921
Every time I make a new Script in Unity, I always end up doing a bunch of checks for any components my script depends on, like: ``` SpriteRenderer sr = gameObject.GetComponent<SpriteRenderer>(); if(sr == null) sr = gameObject.AddComponent<SpriteRenderer>() as SpriteRenderer; ``` So I decided to play around an...
2016/08/10
[ "https://Stackoverflow.com/questions/38883921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3476873/" ]
The GetComponent method is actually rather taxing on the system. If you are developing for mobile, too many of them can cause a noticeable lag in load times. I personally use RequireComponent method. Then the script would automatically add the component the moment it's added to the GameObject. Then I would manually dr...
In the new version of Unity (With C# 8.0 and above) you can simply do this in one line. ``` [SerializeField] private SpriteRenderer spriteRenderer; public SpriteRenderer GetSpriteRenderer => spriteRenderer ??= GetComponent<SpriteRenderer>() ?? gameObject.AddComponent<SpriteRenderer>(); ``` The code above does three ...
57,766,662
I am trying to retrieve images from Firebase Firestore. I am able to retrieve text in RecyclerView successfully however I'm not sure how to retrieve the images. I had a look at similar questions unfortunately none helped. **ListActivity :** ``` //initialize firestore db = FirebaseFirestore.getInstance(); ...
2019/09/03
[ "https://Stackoverflow.com/questions/57766662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11827718/" ]
Here is the solution for this issue: in my vue.config.js I made the following: ``` module.exports = { chainWebpack: config => { config.entry('theme') // you can add here as much themes as you want .add('./src/theme.scss') .end(); }, css: { extract: { f...
I've typically not used file-loader in my CSS setup; instead I've always used a style-loader, css-loader with MiniCSSExtractPlugin: <https://github.com/webpack-contrib/mini-css-extract-plugin#advanced-configuration-example> Give that setup configuration for MiniCSSExtractPlugin a review. MiniCSSExtractPlugin is a nic...
49,101,461
I would like to move my Player in "block" of 0.1 unity unit (or 1). How to modify / configure Character controller to move with "fixed" step?
2018/03/04
[ "https://Stackoverflow.com/questions/49101461", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141579/" ]
Your reasoning is correct. There are 5 processes created from this code for a total of 6 processes including the original. To verify, adding the following two lines after the above code: ``` printf("pid: %d, parent: %d\n", getpid(), getppid()); sleep(1); ``` Printed this on my machine (with comments added to match ...
Yes it is correct. If you want to be sure print the pid (using getpid())for each parent-son and count the unique numbers printed.
14,513,957
so here is the code (I have tried many variations of this (with the div, without the div) and jquery itself is working, but not the dialog box) I can do an alert box, but if I put a dialog in, it never works. No popup, nothing. A basic dialog box does not work. ``` $('#link).click(function(){ $('#dialog).dialog(); ...
2013/01/25
[ "https://Stackoverflow.com/questions/14513957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1839942/" ]
You missed a quote after the `#dialog` selector **and** the `#link` selector, try this: ``` $('#link').click(function(){ $('#dialog').dialog(); } ```
Ok. So I figured out that in order to use the dialog box I had to include the jquery-ui declaration at the top of the page instead of just the jquery declaration. ``` <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js" ></script> ```
984,419
I just installed a gem but when I type ``` gem_name --help ``` It says: ``` 'gem_name' is not recognized as an internal or external command ``` However, when I type ``` gem list --local ``` the gem shows up in the list so I know it's there - I just don't know how to see what it does. Is there a different in...
2009/06/12
[ "https://Stackoverflow.com/questions/984419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121636/" ]
Ruby gems can optionally install executable files. When you run `<gem_name> --help`, you're generally running the script, if any, installed by that gem, and passing it `--help` as a commandline parameter. By convention, most gems with executables support this parameter and output some useful information, but it's not a...
Try this: 1- gem server 2- Point your browser to: <http://localhost:8808/>
7,602,861
Is there any way to clear the STDIN buffer in Perl? A part of my program has lengthy output (enough time for someone to enter a few characters) and after that output I ask for input, but if characters were entered during the output, they are "tacked on" to whatever is entered at the input part. Here is an example of my...
2011/09/29
[ "https://Stackoverflow.com/questions/7602861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689136/" ]
It looks like you can accomplish this with the [`Term::ReadKey`](http://search.cpan.org/perldoc?Term::ReadKey) module: ``` #!perl use strict; use warnings; use 5.010; use Term::ReadKey; say "I'm starting to sleep..."; ReadMode 2; sleep(10); ReadMode 3; my $key; while( defined( $key = ReadKey(-1) ) ) {} ReadMode 0; ...
I had the same problem and solved it by just discarding anything in STDIN after the processing like this: ``` for(my $n = 0; $n < 70000; $n++){ print $n . "\n"; } my $foo=<STDIN>; print "would you like to continue [y/n]: "; chomp(my $input = <STDIN>); print $input . "\n"; ```
27,546,971
Lets say, I have a table, and I want to order by field with some string and size. When I use `ORDER BY size`, it gets something like this: ``` size 100 size 105 size 110 size 115 size 85 size 90 size 95 ``` String can be different in each row, this is just example, when there is same string - `size`. I want to retur...
2014/12/18
[ "https://Stackoverflow.com/questions/27546971", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1631551/" ]
I simple way to do this is to use the length as a key: ``` order by length(size), size ``` Alternatively, use `substring_index()`: ``` order by substring_index(size, ' ', 1), substring_index(size, ' ', -1) + 0 ``` The `+ 0` does silent conversion to convert the second value to a number.
You are partially right. You could just fetch the number from your alpha numeric column ``` SELECT * FROM MyTable ORDER BY CAST(SUBSTRING(size, LOCATE(' ',size)+1) AS SIGNED) ```