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
30,164,479
Here is html code for bootstrap icon, Bootstrap v3.3.4 ``` <span class="glyphicon glyphicon-briefcase" aria-hidden="true"></span> ``` this html code is working fine with all browsers, i can see briefcase icon properly. But with same code after developing in MVC Platfrom i can't see briefcase icon on IE and Safari (...
2015/05/11
[ "https://Stackoverflow.com/questions/30164479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4886703/" ]
Maybe this post will answer your question : [here](https://github.com/twbs/bootstrap/issues/9962) adding ``` <!--[if lt IE 9]> <script src="html5shiv.js"></script> <script src="respond.min.js"></script> <![endif]--> ``` Could solve your problem, by the way, which IE version are you using? EDIT: then it could be IE...
You need to include ``` < !--[if lt IE 9] > < script src="html5shiv.js"> < script src="respond.min.js"> < ![endif]-- > ``` Or ``` <link rel="stylesheet" media="screen" href="/css/glyphicons/glyphicons.min.css" > ``` OR ``` <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wid...
72,417,934
Is there a way to melt 2 columns and take there sums as value . For example ``` df <- data.frame(A = c("x", "y", "z"), B = c(1, 2, 3), Cat1 = c(1, 4, 3), New2 = c(4, 4, 4)) ``` Expected output ``` New_Col Sum Cat1 8 New2 12 ```
2022/05/28
[ "https://Stackoverflow.com/questions/72417934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16935119/" ]
Or using `base R` with `colSums` after selecting the columns of interest and then convert the named vector to data.frame with `stack` ``` stack(colSums(df[c("Cat1", "New2")]))[2:1] ind values 1 Cat1 8 2 New2 12 ```
Of course ```r df %>% summarise(across(starts_with('Cat'), sum)) %>% pivot_longer(everything(), names_to = 'New_Col', values_to = 'Sum') ``` ``` # A tibble: 2 × 2 New_Col Sum <chr> <dbl> 1 Cat1 8 2 Cat2 12 ```
19,931,756
I know the partial submit is used in icefaces 1.x, singlesubmit in icefaces 2.x and the tag in icefaces 3.x. May someone tell me what is the substantial difference between them? thanks.
2013/11/12
[ "https://Stackoverflow.com/questions/19931756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2983595/" ]
Both partialSubmit and singleSubmit does the same thing. But in different ways. Here is a typical form scenario: user sees a form and starts interacting. Those forms have some fields. Some of those fields are required and are necessary to process the form. Other fields are optional. When using partialSubmit, when a u...
<http://www.icesoft.org/wiki/display/ICE/Using+Single+Submit> The SingleSubmit tag is a replacement by PartialSubmit, according to ICESoft information. Cheers!
14,246
I have a couple questions for those more familiar. Most of my instances have been running Antelope despite having support for Barracuda. I was looking to play around with some compresses innodb tables. My understanding is this is only available under the Barracuda format. 1. I see innodb\_file\_format is dynamic so I...
2012/03/02
[ "https://dba.stackexchange.com/questions/14246", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/3423/" ]
So I'm answering this question almost 4 years late: * InnoDB file formats were conceived at a time when InnoDB was independent of the MySQL Server (for example: MySQL 5.1 could run two different versions of InnoDB). * The reason why you would not want to run Barracuda (in 2012) is that it could reduce flexibility in d...
If you really want to play with InnoDB using the Barracuda format, you should mysqldump everything to something like /root/MySQLData.sql. That makes the data file format independent. Use another MySQL instance with a fresh ibdata1 and innodb\_file\_per\_table (optional, my personal preference). Change the file format ...
5,108,555
I want to convert a List to a List so that each object on my new list includes the first element of each String[]. Do you know if this is possible to do in java? for example: ``` public List<String[]> readFile(){ String[]array1={"A","1.3","2.4","2.3"}; String[]array2={"B","1.43","3.4","2.8"}; String[]array3={"...
2011/02/24
[ "https://Stackoverflow.com/questions/5108555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/507079/" ]
I agree with the answer Alb provided, however this is what your friend has suggested, first you need a class to represent the data. I have included a constructor that parses the data and one that accepts already parsed data, depending on how you like to think of things. ``` public class NumberList { private double[]...
I don't understand your goal, but for 'an object with 2 parts' you might consider storing them in a Hashtable: <http://download.oracle.com/javase/6/docs/api/java/util/Hashtable.html>
9,932,972
I am working with a callback function going from unmanged code to my managed C# code. The callback has a parameter `void* eventData`. EventData could be several different struct types. In my C# code I define eventData as an `IntPtr` and use `Marshal.PtrToStructure` to get the struct. For most of the structs I have no i...
2012/03/29
[ "https://Stackoverflow.com/questions/9932972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55638/" ]
``` return this.substr(0, index) + char + this.substr(index + char.length); ``` `char.length` is zero. You need to add `1` in this case in order to skip character.
So basically, another way would be to: 1. Convert the string to an array using `Array.from()` method. 2. Loop through the array and delete all `r` letters except for the one with index 1. 3. Convert array back to a string. ```js let arr = Array.from("crt/r2002_2"); arr.forEach((letter, i) => { if(letter === 'r' && i...
65,998,838
I'm currently having an issue with updating a nested serializer field, the dict value provided is being thrown away and mapped to an empty dict on the code side Serializer: ``` class OrganizationSerializer(QueryFieldsMixin, BaseSecuritySerializer): class Meta: model = Organization fields = ("id", ...
2021/02/01
[ "https://Stackoverflow.com/questions/65998838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1647394/" ]
It's because the 'id' field in OrganizationSerializer is read\_only, you can check it yourself in python manage.py shell ``` test = OrganizationSerializer() print(repr(test)) ```
Using tempresdisk's method above, the serializer should look like this ``` OrganizationSerializer(): id = IntegerField(label='ID', read_only=True) ... ``` Overriding that field in the serializer and removing the `read_only=True` should do the trick. ``` class OrganizationSerializer(QueryFieldsMixin, BaseS...
24,372,931
I have a site running locally on MySQL i want to run it on H2 database. I have just run h2.jar file for console on the browser but whenever I Log in I have seen the list `jdbc:h2:/var/www/mysite/data/db; MODE=MySQL, information_schema and users.`I can create tables in it but don't know how to create new database? I a...
2014/06/23
[ "https://Stackoverflow.com/questions/24372931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2539746/" ]
From <http://www.h2database.com/html/tutorial.html#creating_new_databases>, > > By default, if the database specified in the URL does not yet exist, a > new (empty) database is created automatically. The user that created > the database automatically becomes the administrator of this database. > > >
The settings of the H2 Console are stored in a configuration file called `.h2.server.properties` in your user home directory. For Windows installations, the user home directory is usually `C:\Documents and Settings\[username]` or `C:\Users\[username]`. The configuration file contains the settings of the application and...
2,678,138
I am trying to sign a token object using SHA1. I am using bouncycastle as the security provider. Whenever the program tries to sign something it gives me this error. ``` java.security.SignatureException: java.lang.IllegalArgumentException: input data too large. ``` What is the maximum size for signing something? Do ...
2010/04/20
[ "https://Stackoverflow.com/questions/2678138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/321651/" ]
The input size is limited to the size of the key. If you use a 1024 bit key, you are limited to 128 bytes. Typically, you are signing the digest (hash value), not the actual data.
To fix that error one just need to use a larger key size. For example, if SHA 512 bit is chosen, the key could be a 1024 bit one. But you will fail with a key of the same (512) or lesser length. BouncyCastle just gives us an unusable error message. But the std lib does its job right. Compare them: ``` // using a 512 ...
46,094
I am transitioning from mountain bike shoes to road bike shoes. *A marked difference is the limitation of versatility in cleat placement.* I prefer to have my cleat as **far up and to the inner side of my foot as possible - pretty much at the balls of my feet**. This was possible with my mountain bike shoes but no long...
2017/04/07
[ "https://bicycles.stackexchange.com/questions/46094", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/20588/" ]
> > I am transitioning from mountain bike shoes to road bike shoes. A marked difference is the limitation of versatility in cleat placement. I prefer to have my cleat as far up and to the inner side of my foot as possible - pretty much at the balls of my feet. > > > Typical road shoes use three bolts holes, with ...
As previous poster said, a narrower Q factor on road bikes mean you may actually get the same width between your feet. Adjustment is normally in the cleats. Also important: The cleats usually have a specific amount of float for rotation during the pedal stroke; Look KEO for example have cleats with both 0°, 4.5° and 9...
12,580,598
I have [recently discovered and blogged about the fact](http://java.dzone.com/articles/throw-checked-exceptions) that it is possible to sneak a checked exception through the javac compiler and throw it where it mustn't be thrown. This compiles and runs in Java 6 and 7, throwing a `SQLException` without `throws` or `cat...
2012/09/25
[ "https://Stackoverflow.com/questions/12580598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/521799/" ]
All this amounts to exploiting the loophole that an unchecked cast to a generic type is not a compiler error. Your code is explicitly made type-unsafe if it contains such an expression. And since the checking of checked exceptions is strictly a compile-time procedure, nothing will break in the runtime. The answer from...
This example is documented in [The CERT Oracle Secure Coding Standard for Java](http://books.google.co.in/books?id=uLQhBkzH0DUC&pg=PA284&lpg=PA284&dq=Noncompliant+Code+Example+%28Generic+Exception%29&source=bl&ots=6BpVA0zRGW&sig=xQS5cBSwtnl9EJ1aZXSNrZ84Zzs&hl=en&sa=X&ei=zbVhUNDxGczJrAeRjYGoDg&ved=0CFEQ6AEwBg#v=onepage&...
187,846
Can these two sentences be used interchangeably? > > 1. He reminds me of me. > 2. He reminds me of myself. > > > I think the second one is wrong. Am I right?
2018/12/07
[ "https://ell.stackexchange.com/questions/187846", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/65554/" ]
> > Can these two sentences be used interchangeably? > > > Answer: I think not. Between the two sentences, the second is more appropriate for formal writing. It is also the one that is widely used. See Ngram. The first sentence might sound a bit strange to some people, but it is often used in informal speech. ...
The *Cambridge Dictionary* provides a very helpful explanation of why "myself" is considered correct. > > Reflexive pronouns for same subject and object > ---------------------------------------------- > > > We often use reflexive pronouns when the subject and the object of the verb refer to the same person or thin...
48,375,598
I am building an application which uses authorization with Json Web Tokens. I'm building this application with Node.js, GraphQL and Apollo client V2 (and some other stuff, but those aren't related here). I have created a `login` resolver and a `currentUser` resolver that let me get the current user via a JWT. I later u...
2018/01/22
[ "https://Stackoverflow.com/questions/48375598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7284779/" ]
I think you might be able to solve this issue by setting the query's **FetchPolicy** to **"cache-and-network"**. You can read about fetch policies [here: "GraphQL query options.fetchPolicy"](https://www.apollographql.com/docs/react/basics/queries.html#graphql-config-options-fetchPolicy "GraphQL Queries - options.fetchP...
for me it worked when I refetched the currentUser query in my login mutation. I added my code below. Maybe it helps: ``` onSubmit(event) { event.preventDefault(); const { email, password } = this.state; this.props .mutate({ variables: { email, password }, update: (proxy, { data }) => { // Get Token f...
14,937,532
I am working with an array of roughly 2000 elements in C++. Each element represents the probability of that element being selected randomly. I then have convert this array into a cumulative array, with the intention of using this to work out which element to choose when a dice is rolled. Example array: {1,2,3,4,5} ...
2013/02/18
[ "https://Stackoverflow.com/questions/14937532", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1890050/" ]
You can use [`partial_sum`](http://en.cppreference.com/w/cpp/algorithm/partial_sum): ``` unsigned int SIZE = 5; int array[SIZE] = {1,2,3,4,5}; int partials[SIZE] = {0}; partial_sum(array, array+SIZE, partials); // partials is now {1,3,6,10,15} ``` The value you want from the array is available from the partial sums...
Ok I think I've solved this one. I just did a binary split search, but instead of just having ``` if (arr[middle] == value) ``` I added in an OR ``` if (arr[middle] == value || (arr[middle] < value && arr[middle+1] > value)) ``` This seems to handle it in the way I was hoping for.
44,187,014
I'm doing a footer that is separated to 3 blocks. But they haven't equal height, and so border-right line's height isn't equal too. screen: [Not equal height of elements](https://i.stack.imgur.com/BIHRK.png) What to do with it? What is wrong with it? My way to handle this problem (3 blocks of content centered in one ...
2017/05/25
[ "https://Stackoverflow.com/questions/44187014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7902860/" ]
`footer` and `#footer` seem redundant, so I combined those. And `.f-block` should be on your `nav` since it's adjacent to the other `.f-block`s. And adding `display: flex` to the parent will cause them to stretch their height to match their siblings. ```css #footer { height: auto; width: 100%; margin-top: 30p...
Issue here is content of the div. white-space is not handled properly. change it to something else. ``` <footer> <div id="footer"> <div id="blocks"> <nav> <div class="f-block">asdasdasd aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaa aaaaaaaa </div> </nav> ...
29,462,217
I'm trying to get my fullcalendar.io event to show up at the bottom of the day instead of in the middle. I've been trying to modify different elements to vertical-align: "bottom" but nothing seems to work. Here is a link to my [**fiddle**](https://jsfiddle.net/4v65ggos/8/) that has different css overloaded calls to set...
2015/04/05
[ "https://Stackoverflow.com/questions/29462217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1186050/" ]
Two issues: 1) the containing element isn't 100% of the "cell" height (which is set by a second "skeleton" table) 2) the `vertical-align` is overriden, so we'll need to increase specificity Here's the CSS that will set the height to 100%: ``` .fc-row .fc-content-skeleton { position: absolute; top: 0; le...
You can set a fixed height to the table element. ``` .fc-row table{ height:72px; } ``` This though won't work well if the site you are working on it's **responsive**. Make sure you apply height:100% to both elements, the table and its container. ``` .fc-content-skeleton,.fc-content-skeleton table{ ...
46,615,083
I'm having an issue in UWP using MVVM, where I have a `Combobox` with an `ItemsSource` bound to a collection of items in my ViewModel, and also in my VM is an item from that collection that `SelectedItem` is bound to. I need to change both the items source and the selected item at will in my view model. The problem is...
2017/10/06
[ "https://Stackoverflow.com/questions/46615083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2272235/" ]
You can solve this mathematically. To make sure that I understand what you want, I will summarize what you are asking. You want to find the smallest integer n so that: 3^3 − 39^2 + 360 + 20 ≥ 2.25^3 (1) And any other integers bigger than n must also satisfy the equation (1). **So here is my solution:** (1) <=> 0.7...
Think about it like this. After a certain point 3^3 − 39^2 + 360 + 20 will always be greater than or equal to n^3 for the simple fact that eventually 3n^3 will beat out the -39n^2. So F(n) will never dip below n^3 for an extremely large number. You don't have to put the minimum nO, just choose an extremely large number...
49,066
I am presently using LAStools to analyse LiDAR data. Can LAStools classify the points into various features such as vegetation, roads, buildings etc? If so, how is it done?
2013/01/25
[ "https://gis.stackexchange.com/questions/49066", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/14594/" ]
LASTools can perform a ground classification using ["lasground"](http://www.cs.unc.edu/~isenburg/lastools/download/lasground_README.txt) and then can perform some limited feature classification using ["lasclassify"](http://www.cs.unc.edu/~isenburg/lastools/download/lasclassify_README.txt). The performance and quality o...
I'm not familiar with lastools, typically a las dataset has a class column that classifies the various points, see image below: ![enter image description here](https://i.stack.imgur.com/ahwfl.png) If you cannot process in lastools, then you can definitely do this in [GRASS](http://grass.osgeo.org/grass70/manuals/v.in...
118,843
``` b = nst[n_] := Length[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]]; nn = 500; With[{stps = Array[nst, nn]}, Table[Max[Take[stps, n]], {n, nn}] ] ``` I'm working with the following list and I am trying to find a fit so that it's always greater than the data rather then the normal fitting m...
2016/06/19
[ "https://mathematica.stackexchange.com/questions/118843", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/40388/" ]
Create the list `b` as you have shown. ``` nst[n_] := Length[NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]] b = With[{stps = Array[nst, nn]}, Table[Max[Take[stps, n]], {n, nn}]]; ``` It looks like ``` ListPlot[b, PlotStyle -> Blue] ``` ![Mathematica graphics](https://i.stack.imgur.com/8YxVg.png) It is...
I had the same idea as Jim Baldwin, as constraints are often implemented as penalty functions. Here is one that severely penalized any negative residual. The parameter `scale` might need to be adjusted to be a significant fraction of the range of the data values. ``` ClearAll[penalty]; penalty[residuals_?VectorQ, scal...
46,453
In a couple of jams I've been in recently there are players who play swing and jazz music but who play it as straight-eighths. Worse, they try to correct the other players who are swinging the beat because they hear it as unsteady. What is a relatively tactful way of teaching these players how to swing in a group sett...
2016/07/26
[ "https://music.stackexchange.com/questions/46453", "https://music.stackexchange.com", "https://music.stackexchange.com/users/10635/" ]
Assuming these are informal jams, you just don't have the authority to fire incompetents. I think the only possibility is to endure the fact that the material will not be played correctly. But do at least point out what "swing" means when they try to "correct" those who are playing it correctly. Is it tactless to teac...
If you're playing straight and switch to playing swing, the 'and's move but the strong beats don't. It might be that the players who are trying to play swung are pushing the strong beats around too, which would be disconcerting to the other players. I'd suggest an exercise where everyone plays the same line (a fragme...
20,792,724
I have developed an email form that sends the data to a sql database. However, I noticed that there can be duplicate emails. Is there something I can add to my php or sql to prevent duplicate emails? ``` <?php if (isset($_POST['submit']) && strlen($_POST['email'])>0 && strlen($_POST['city'])>0) { $good_input = tr...
2013/12/26
[ "https://Stackoverflow.com/questions/20792724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1691422/" ]
You could make the email the primary key for the table: ``` ALTER TABLE launchpage ADD PRIMARY KEY(email); ``` then use `REPLACE INTO` instead of `INSERT INTO`: ``` mysql_query("REPLACE INTO `launchpage` VALUES ('$email', '$city')"); ``` REPLACE updates an existing record if the key exists, otherwise inserts a...
You may try: ``` ALTER TABLE launchpage ADD UNIQUE (email); ```
10,617
I'm aiming this question at anyone who has made it in the audio post production area. How did you get to where you are now? how did you start off and what steps did you take? It would also be good to hear from people just starting out and what you're doing towards gaining a career within audio post production. Look for...
2011/09/30
[ "https://sound.stackexchange.com/questions/10617", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/2368/" ]
I'd recommend checking out the [Soundworks bid on The Social Network](http://soundworkscollection.com/socialnetwork). They go into detail on how the club scene was designed with lots of layers of different distortions used.
Well I can talk to you about distortion in music mixing/engineering. Distortion is the most useful tool of the mixing engineer, if you think about it you can only mix with distortion and EQ. The first thing distortion does is coloring the sound and producing harmonics, The second thing is it compresses the sound in a...
45,046,385
Now I have the following procedure: ``` CREATE OR REPLACE FUNCTION find_city_by_name(match varchar) RETURNS TABLE(city_name varchar) LANGUAGE plpgsql as $$ BEGIN RETURN QUERY WITH r AS ( SELECT short_name FROM geo_cities WHERE short_name ILIKE CONCAT(match, '%') ...
2017/07/12
[ "https://Stackoverflow.com/questions/45046385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6459947/" ]
Here is a simplified (w/o `WITH` and with `language sql`) version, that I've mentioned in my comment to the adjacent answer: ``` create or replace function find_city_by_name(text) returns table(city_name varchar, long_name varchar) as $$ select * from geo_cities where short_name ilike $1 || '%'; $$ language sql; ...
If you want a real row you must to explicit declare all fields in the return clausule: ``` create table geo_cities ( short_name varchar, long_name varchar ); insert into geo_cities values ('BERLIN', 'BERLIN'), ('BERLIN 2','BERLIN TWO'); CREATE OR REPLACE FUNCTION find_city_by_name(match varchar) RETURNS...
73,377,986
When we make a stored procedure call we pass input parameter of how many rows we want to get from result. Also, we want specific columns returned which is obtained through join operation on tables. My doubt is can we return the result as table but if in that approach how to limit result rows to specific count which is...
2022/08/16
[ "https://Stackoverflow.com/questions/73377986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16253207/" ]
A better way to do it is to use the dictionary attribute `get`. You can read on it [here](https://python-reference.readthedocs.io/en/latest/docs/dict/get.html) ``` from lxml import etree class CleanItem(): def process_item(self, item, spider): root = etree.fromstring(str(item['external_link_body']).split(...
Why not just use a conditional statement? ``` from lxml import etree class CleanItem(): def process_item(self, item, spider): root = etree.fromstring(str(item['external_link_body']).split("'")[1]) dict_ = {} dict_.update(root.attrib) dict_.update({'text': root.text}) if 're...
62,129,354
I read the answers ["unable to locate adb" using Android Studio](https://stackoverflow.com/questions/39036796/unable-to-locate-adb-using-android-studio) and [Error:Unable to locate adb within SDK in Android Studio](https://stackoverflow.com/questions/27301960/errorunable-to-locate-adb-within-sdk-in-android-studio) and ...
2020/06/01
[ "https://Stackoverflow.com/questions/62129354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4424099/" ]
I started getting this error after updating Android Studio from version 3.6.3 to 4.0. It didn't stop the emulator working, but it was vaguely annoying. I checked that adb.exe was in the folder C:\Users[username]\AppData\Local\Android\Sdk\platform-tools. I also ran it in a command-line to prove that the exe worked OK....
Looks like the installed driver is not correct. Steps to fix: ``` Delete the device from Device Manager. Rescan for hardware changes. "Your Device" will show up with "Unknown driver" status. Click on "Update Driver" and go to android sdk path and there select /extras/google/usb_driver Device Manager will find the driv...
3,757,948
Is there any way to open a new window or new tab using PHP without using JavaScript.
2010/09/21
[ "https://Stackoverflow.com/questions/3757948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/273266/" ]
Short answer: **No**. PHP is a [server side language](http://en.wikipedia.org/wiki/Server-side_scripting) (at least in the context of web development). It has absolutely no control over the client side, i.e. the browser.
No. PHP is a server-side language, meaning that it is completely done with its work before the browser has even started rendering the page. You need to use Javascript.
8,318,269
In android application i have a custom listview and sqlite database. I want to display the database table value to custom listview.Please any one help me some code
2011/11/29
[ "https://Stackoverflow.com/questions/8318269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609050/" ]
It isn't possible to move an iframe from one place in the dom to another without it reloading. Here is an example to show that even using native JavaScript the iFrames still reload: <http://jsfiddle.net/pZ23B/> ``` var wrap1 = document.getElementById('wrap1'); var wrap2 = document.getElementById('wrap2'); setTimeout...
Whenever an iframe is appended and has a src attribute applied it fires a load action similarly to when creating an Image tag via JS. So when you remove and then append them they are completely new entities and they refresh. Its kind of how `window.location = window.location` will reload a page. The only way I know to...
12,413,394
I have this line in my .vimrc file: ``` set directory=~/.vim/swapfiles// ``` *(Note that one extra slash makes the directory names to be included instead of just file names to reduce conflict)* The above config works fine on my Linux machine, but the problem is when I use the same file on Windows I get some warning...
2012/09/13
[ "https://Stackoverflow.com/questions/12413394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/939986/" ]
If you don't want to introduce a `$MYVIM` variable as ZyX suggests, maybe an alternative is placing the runtime files in `$HOME/.vim` instead of the default `$HOME/vimfiles` on Windows. You can then use `~/.vim/...` everywhere. This also helps with synchronizing the files across multiple mixed-platform machines. ``` "...
First of all, vim translates all forward slashes to backward on windows thus it won’t hurt having slashes. Just in case you think it can be a source of trouble. Second, it is not impossible to have `~/.vim` and all other directories on windows, just some programs don’t want to work with names that start with a dot. Yo...
12,996,692
I'm trying to understand the usage for getter/setter methods in a class. Let's say we have a class called A with some *public* instance variables followed by a constructor with parameters where arguments were passed from another class(main) to it. Inside the constructor we let those instance variables equal what was pa...
2012/10/21
[ "https://Stackoverflow.com/questions/12996692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1681158/" ]
Your interpretation is correct. Also (off the top of my head): * It allows the implementation of the class to change (eg if you wish to remove the field and replace it) without forcing consumers to interact with your class any differently. * It allows AOP frameworks to intercept calls to your get / set method. * You c...
if an instance variable is to be used only by methods defined with in its class, then it should be made it as private.If an instance variable must be within certain bounds, then it should be private and made available only through accessor methods[getter as well as Setter] Methods.
5,986,694
C#'s switch() statement is case-sensitive. Is there a way to toggle it so it becomes case-insensitive? ============================== Thanks, But , I don't like these solutions; Because case conditions will be a variable , and I don't know if they ALL are UPPER or lower.
2011/05/13
[ "https://Stackoverflow.com/questions/5986694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114656/" ]
Yes - use `ToLower()` or `ToLowerInvariant()` on its operands. For example: ``` switch(month.ToLower()) { case "jan": case "january": // These all have to be in lowercase // Do something break; } ```
You can do something like this ``` switch(yourStringVariable.ToUpper()){ case "YOUR_CASE_COND_1": // Do your Case1 break; case "YOUR_CASE_COND_2": // Do your Case 2 break; default: } ```
8,448,473
What I have : ``` <ul id="myId"> <li> My text <ul class="myClass"> <li>blahblahblah</li> </ul> </li> </ul> ``` What I want : ``` <ul id="myId"> <li> <span>My text</span> <ul class="myClass"> <li>blahblahblah</li> </ul> </li> <...
2011/12/09
[ "https://Stackoverflow.com/questions/8448473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/287082/" ]
Try: ``` $('#myId > li').each( function(){ $(this.firstChild).wrap('<span></span>'); }); ``` [JS Fiddle demo](http://jsfiddle.net/davidThomas/mmMXD/). With regards to wanting to add the `class` to the `ul`: ``` $('#myId > li').each( function(){ $(this.firstChild).wrap('<span></span>'); ...
``` var ul = document.getElementById("myId"); var li = ul.firstElementChild; var text = li.firstChild; var ul = li.childNodes[1]; ul.classList.add('myClass'); var span = document.createElement("span"); span.textContent = text.data; li.replaceChild(span, text); ``` Old fashioned DOM to the rescue.
64,936,440
Good evening, I am using python 3.9 and try to run a new FastAPI service on Windows 10 Pro based on the documentation on internet <https://www.uvicorn.org/> i executed the following statements ``` pip install uvicorn pip install uvicorn[standard] ``` create the sample file app.py ``` from fastapi import FastAPI a...
2020/11/20
[ "https://Stackoverflow.com/questions/64936440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4232472/" ]
You can also run `uvicorn` with the following command: ``` python -m uvicorn main:app --reload ```
I have faced the same problem when using a virtual environment in Windows, so the easiest to solve this problem is in the terminal typing with `python -m uvicorn main:app --reload` after already activate that environment with `activate xxx`.
57,004,407
I'm using `buildConfigField` to pass debug and release server Ip and other string literals into app. like this: ``` buildTypes { debug { buildConfigField "String", "url", "\"http:\\xxxxxxx.xx\"" } release { buildConfigField "String", "url", "\"http:\\ppppppp.xx\"" ...
2019/07/12
[ "https://Stackoverflow.com/questions/57004407", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6737471/" ]
You don't need to use java strings for this, Product flavors are the perfect solution in your android block in Gradle file use it like this ``` productFlavors { main { dimension "app" buildConfigField 'String', 'url', 'http://XXXXXXX' } test_local { dimension...
You can use **`BuildConfig`** class which is *auto-generated class* provides you variables that are defined by **buildConfigFields** in your gradle file. So, you'll not need to change major stuffs but some minor things in `API` object like below: ``` object API { const val URL_MAIN = BuildConfig.URL } ``` Now, ...
2,172,621
I met the share library not found on the head node of a cluster with torch. I have built the library as well as specify the correct path of the library while compiling my own program "absurdity" by g++. So it looks strange to me. Any idea? Thanks and regards! ``` [tim@user1 release]$ make ... ... g++ -pipe -W -W...
2010/01/31
[ "https://Stackoverflow.com/questions/2172621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/156458/" ]
Copied from my answer here: <https://stackoverflow.com/a/9368199/485088> > > Run `ldconfig` as root to update the cache - if that still doesn't help, you need to add the path to the file `ld.so.conf` (just type it in on its own line) or better yet, add the entry to a new file (easier to delete) in directory `ld.so.co...
``` sudo ldconfig ``` > > ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib). > > > Generally package manager takes care of this while installing...
53,750,958
I have been working on a small project and I have ran into this issue. I have a txt file full of lines and I need to store them in a List. Is there any elegant way of doing it? This is my code, however, it won´t work because something is out of bonds. The txt file have 126 lines but I need only 125 of them. Thank you f...
2018/12/12
[ "https://Stackoverflow.com/questions/53750958", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10782877/" ]
An `Array<string>` implements `IEnumerable<string>`, so if you use `System.Linq`, a bunch of convenient extension methods are available. ``` using System.Linq; // ... var listNumbers = System.IO.File .ReadAllLines("Numbers.txt") .Take(125) .ToList(); ```
List has an `AddRange()` method that takes an enumerable (such as your array) and adds all the items in it, to the list. It's useful because it doesn't require LINQ, and unlike passing the array into the List constructor, it can be used if the list is constructed elsewhere/already instantiated by some other process ``...
14,868,424
``` $(function(){ $('.inviteClass').keypress(function() { if(event.keyCode=='13') { doPost(); } }); ``` Here I have one small requirement. Pressing keyboard Enter to submit the form and it is working fine in FireFox and Chrome, as well as IE 7 and 8, but it is not working in IE9 and IE...
2013/02/14
[ "https://Stackoverflow.com/questions/14868424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1989472/" ]
**Points to note:** 1. You are missing a closing bracket. 2. Also, change the selector to `window` 3. Use `.on()` function 4. Use the `.which` property of event. See jQuery [documentation](http://api.jquery.com/event.which/) 5. The keycode is an integer - remove the quotes 6. Add a `return false;` to stop the event fr...
you must use jQuery's event.which, also change '13' to 13 (a closing bracket was also missing): ``` $(function(){ $('.inviteClass').keypress(function(event) { if(event.which == 13) { doPost(); } }); }); ```
72,289
I know from [here](https://answers.yahoo.com/question/index?qid=1006041614112) that a flame thrower can operate in deep space if specially built. However, I want to know if using a flamethrower on a spaceship in space could have any tactical benefits. Could a flamethrower be used to destroy or blind enemy sensors from ...
2017/02/26
[ "https://worldbuilding.stackexchange.com/questions/72289", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/20775/" ]
Nope ---- ### Improper Usage Remember that the **purpose of a flamethrower is to set flammable targets on fire** like wood structures and humans and to consume oxygen from enclosed spaces. It is safe to assume that spaceships will not be made out of flammable materials. Ships are sealed so that they do not lose oxyge...
A flamethrower is, fundamentally, a device that ejects burning-hot stuff at a moderate-to-fast speed. A rocket is a device that ejects stuff at *very* fast speeds, and the stuff it ejects tends to be burning-hot (since that's a very effective way to make fast-moving exhaust). If for some reason a spaceship builder de...
11,507
When a try: ``` sudo apt install elementary-sdk ``` it says ``` Unable to locate package elementary-sdk ``` It's a fresh install of loki. ``` apt update ``` give me a 404 error. ``` Err:7 http://br.archive.ubuntu.com/ubuntu loki Release ...
2017/04/13
[ "https://elementaryos.stackexchange.com/questions/11507", "https://elementaryos.stackexchange.com", "https://elementaryos.stackexchange.com/users/9338/" ]
This is a repository error: there is no Ubuntu version "loki", you should use "xenial" Ubuntu repositories with elementary repositories. `/etc/apt/sources.list.d/elementary.list`: ``` deb http://ppa.launchpad.net/elementary-os/stable/ubuntu xenial main deb-src http://ppa.launchpad.net/elementary-os/stable/ubuntu xeni...
I can verify updating "hera" to "bionic" in the following source list files allowed me to install elementary-sdk just now (for Elementary OS 5.1): ``` /etc/apt/sources.list /etc/apt/sources.list.d/elementary.list /etc/apt/sources.list.d/patches.list /etc/apt/sources.list.d/appcenter.list ``` This appears to be an on...
9,994,790
I have to disable and enable three checkboxes. if the user clicks on one the other will be disabled ``` <input type="checkbox" class="rambo" value='1' /> 45 <input type="checkbox" class="rambo" value='2' /> 56 <input type="checkbox" class="rambo" value='3' /> 56 ``` so i need a function that gives me this via jque...
2012/04/03
[ "https://Stackoverflow.com/questions/9994790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1241255/" ]
Try this: ``` $(".rambo").change(function() { var $el = $(this); if ($el.is(":checked")) { $el.siblings().prop("disabled",true); } else { $el.siblings().prop("disabled",false); } }); ``` [**Example fiddle**](http://jsfiddle.net/xUv9h/)
You can try: ``` $('.rambo').click( function() { if ($(this).attr('checked')) { $(this).siblings().attr('disabled','disabled'); } else { $(this).siblings().removeAttr('disabled'); } }​​);​ ``` As you can see on [this jsfiddle](http://jsfiddle.net/darkajax/jz8C5/2/)
70,504,639
`DT_DATE` and `DT_DBTIMESTAMP` both store the year, month, date, hour, min, sec, and fractional sec. What is the difference between `DT_DATE`, `DT_DBTIMESTAMP`? Which of them is to be used to store the DateTime value from the SQL database?
2021/12/28
[ "https://Stackoverflow.com/questions/70504639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1779091/" ]
Plan A: ======= You can deploy oracle services in the form of submitting yaml files directly to k8s. Deploy ------ The following is the definition code of Oracle deployment. This code consists of two parts, namely the deployment of Oracle deployment and its proxy service. The Oracle database deployed here is 11g r2...
It would help if you could share details regarding what you've already tried in order to deploy an Oracle database on minikube, otherwise your question appears too generic. For any application to be deployed on a kubernetes distribution like minikube -- you need the manifests of that application (in this case Oracle d...
35,315,090
Update: Now looking back more than a year later, I am giving an update hope that will help someone else. Spring IO recommend using CSRF protection for any request that could be processed by a browser by normal users. If you are only creating a service that is used by non-browser clients, you will likely want to disab...
2016/02/10
[ "https://Stackoverflow.com/questions/35315090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5377372/" ]
I had a a similar issue, only HEAD GET and POST were working for me. I found out that [`addCorsMappings`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/package-summary.html) has a default value for [`allowedMethods`](https://docs.spring.io/spring-fram...
Here is my `SecurityConfig.java`. I had to mix various answers in this post to get it to work for me. ```java @Configuration public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http.authorizeRequests().antMatchers(...
11,493,711
I'm making a pretty simple game just for fun/practice but I still want to code it well regardless of how simple it is now, in case I want to come back to it and just to learn So, in that context, my question is: How much overhead is involved in object allocation? And how well does the interpreter already optimize thi...
2012/07/15
[ "https://Stackoverflow.com/questions/11493711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864572/" ]
It's my understanding that garbage collection stops execution on most JS engines. If you're going to be making many objects per iteration through your game loop and letting them go out of scope that will cause slowdown when the garbage collector takes over. For this kind of situation you might consider making a single...
The short answer is to set one `current position` object and check against itself as you're literally going to use more memory if you create a new object every time you call `getCurrentGridPos()`. There may be a better place for the `is this a new position` check since you should only do that check once per iteration...
4,060
I need to get transaction list within theDAO system. Is it possible or it's the same case of getting the internal transactions in Ethereum? I want to know if there is a mechanism within theDAO to get these transactions.
2016/05/19
[ "https://ethereum.stackexchange.com/questions/4060", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/1670/" ]
**Q**: testnet or private? Is it better to just create a private testnet? One advantage of using the testnet is that there are testnet block explorers like <https://testnet.etherscan.io/> and <https://morden.ether.camp/> if you need to examine your blockchain. One problem with Testnet is that there are few peers runn...
You can mine on testnet relatively easy to earn ether. From your `geth console` run `miner.start(X)` (where X is the number of threads it should use) and let it run for a while. I think in about 30 minutes I was able to mine roughly 150 ether. But your mileage may vary Using the testnet would probably be a little easi...
434,229
My customer has quite a large (the total "data" folder size is 200G) PostgreSQL database and we are working on a disaster recovery plan. We have identified three different types of disasters so far: hardware outage, too much load and unintentional data loss due to erroneously executed bad migration (like DELETE or ALTE...
2012/10/02
[ "https://serverfault.com/questions/434229", "https://serverfault.com", "https://serverfault.com/users/69133/" ]
Why is FreeBSD not a viable option to run ZFS and PostgreSQL on? The FreeBSD ZFS developers works very close with the Illumos team and just recently Pawel Jakub Dawidek (The man who first ported ZFS to FreeBSD) added [SSD TRIM support for ZFS](http://lists.freebsd.org/pipermail/freebsd-current/2012-September/036777.htm...
I suggest you take a look at Barman, Backup and Recovery Manager for PostgreSQL, which has been written by us and is available as open-source under GNU GPL 3 terms. To give you an idea, we use it in production on databases larger than yours (7 Terabytes). Version 1.0 has been released latest July. There is an RPM versi...
27,135,488
In first loop I am looping through variable rgname which is [Monthly,Quarterly,Yearly]. Now,I created another method called listDir. If I pass variable value here folder = new File(reportFolderPath + reportPath + "/"+ rgname); and later to the method listDir it will return list of array like as shown below. ``` ...
2014/11/25
[ "https://Stackoverflow.com/questions/27135488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3025316/" ]
As found out in the [chat](https://chat.stackoverflow.com/rooms/65651/discussion-between-tom-and-lokesh), the problematic line is this: ``` rg.setReportDescr(reportDescr); ``` As I assumed in the comments before, this *is* a standard setter method which will overwrite the old data with the new one. Therefore the las...
Your code is very confusing! I'm not sure what the goal is here, but it seems like you are overwriting the folder such that only the last month is being printed out. You can try creating a new File each time and adding that to its own list. Then you can iterate through that. Here is some code, although it's not doing ...
18,374
Let $K$ be a field and $L$ an extension of $K$. I wonder how much larger the multiplicative group $L^\times$ of $L$ is than the multiplicative group $K^\times$ of $K$. I know that if $L=K(t)$ and $t$ is transcendental over $K$, then $L^\times/K^\times$ is isomorphic to the direct product of an infinite number of copie...
2010/03/16
[ "https://mathoverflow.net/questions/18374", "https://mathoverflow.net", "https://mathoverflow.net/users/3380/" ]
To add to Franz's nice answer: Let $\mathcal{C}$ be the collection of groups isomorphic to the direct sum of a free abelian group of countable rank with a finite abelian group. In the case where $L/K$ is a nontrivial finite separable extension of global fields, each of the following groups is in $\mathcal{C}$ (and th...
Perhaps useful to you: As a replacement of finitly generated in a local situation, one can sometimes use that the quotient is cocompact. For a local field, we have in the usual scaling of the multiplicative Haar measure that the quotient measure $F^\times / K^\times$ is the ramification index.
23,105,118
I'm Python newbie and would like to convert ASCII string into a series of 16-bit values that would put ascii codes of two consecutive characters into MSB and LSB byte of 16 bit value and repeat this for whole string... I've searched for similar solution but couldn't find any. I'm pretty sure that this is pretty easy t...
2014/04/16
[ "https://Stackoverflow.com/questions/23105118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2152780/" ]
If you take a look at the [date reference](http://php.net/manual/en/function.date.php), a lower-case `h` is the 12-hour formatted hour. You need a capital `H`: ``` echo date( 'Y:m:d H:i:s', strtotime( $date1 )); // 12:10:00 echo date( 'Y:m:d H:i:s', strtotime( $date2 )); // 00:10:00 ``` FWIW: Your time variables sho...
You can check difference using AM or PM or use 24 hours format cause 0 and 12 same mean for time different is it's am or pm ``` $date1 = '12:10:00'; $date2 = '00:10:00'; echo date( 'Y:m:d h:i:s A', strtotime( $date1 )); // 2014:04:16 12:10:00 PM echo date( 'Y:m:d h:i:s A', strtotime( $date2 )); // 2014:04:16 12:10:00 ...
3,917,081
I'm trying to convert from a SQL Server database backup file (`.bak`) to MySQL. [This question](https://stackoverflow.com/questions/156279/how-to-import-a-sql-server-bak-file-into-mysql) and answers have been very useful, and I have successfully imported the database, but am now stuck on exporting to MySQL. The *MySQL...
2010/10/12
[ "https://Stackoverflow.com/questions/3917081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265985/" ]
PhpMyAdmin has a Import wizard that lets you import a MSSQL file type too. See <http://dev.mysql.com/doc/refman/5.1/en/sql-mode.html> for the types of DB scripts it supports.
I used the below connection string on the Advanced tab of MySQL Migration Tool Kit to connect to SQL Server 2008 instance: ``` jdbc:jtds:sqlserver://"sql_server_ip_address":1433/<db_name>;Instance=<sqlserver_instanceName>;user=sa;password=PASSWORD;namedPipe=true;charset=utf-8;domain= ``` Usually the parameter has "...
33,255,058
``` p | user / a.active(href="#{back_url}") james ``` I even tried ``` p | user / | a.active(href="#{back_url}") james ``` No error in my terminal, just the html is broken. I want it to be like this ``` <p>user / <a class="active" href="link">james</a></p> ```
2015/10/21
[ "https://Stackoverflow.com/questions/33255058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5440072/" ]
Just sum two lists produced by multiplication first and second elements: ``` ['a']*100 + ['b']*100 ``` It's faster than list comprehension and sort: ``` python -m timeit "sorted(['a', 'b']*100)" 100000 loops, best of 3: 9.76 usec per loop python -m timeit "[x for x in ['a', 'b'] for y in range(100)]" 100000 loops,...
``` from itertools import repeat list(repeat('a',100)) + list(repeat('b',100)) ```
620,564
How can I replace a text in all files in all subfolders when my search includes "\*" for example I have many text files containing such pattern (some wrong paths that I want to correct) ``` /folder1/(abc)/params.launch /folder2/(efd)/gui.launch /folder3/(ghi)/robot.launch ``` Now I want to add /launch before each fi...
2015/05/07
[ "https://askubuntu.com/questions/620564", "https://askubuntu.com", "https://askubuntu.com/users/266492/" ]
Should be fairly simple with `sed`: ``` sed 's;\([^/]*.launch$\);launch/\1;' ``` * You can group matched text by surrounding the expression in brackets (`\( ... \)`). You need to escape the parentheses to make `sed` see them as special syntax. * The groups can be referred to using the position - the first group is `...
Using `bash`: ```bsh #!/bin/bash while IFS= read -r line; do ini="${line%/*}" last="${line##*/}" repl="${line##*.}" echo "${ini}/${repl}/${last}" done <file.txt ``` **Output :** ``` /folder1/(abc)/launch/params.launch /folder2/(efd)/launch/gui.launch /folder3/(ghi)/launch/robot.launch ``` Here we have...
38,202,769
I made a game in Swift but I need to download .zip files on my website, and use the content (images) in game. Actually, I download the .zip file and store it in documents, and I need to unzip the file into the same documents folder. I tried marmelroy's Zip, iOS 9 Compression module and tidwall's DeflateSwift but none ...
2016/07/05
[ "https://Stackoverflow.com/questions/38202769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6551357/" ]
I got it work with SSZipArchive and a bridging header: 1. Drag & drop the SSZipArchive directory in your project 2. Create a {PROJECT-MODULE-NAME}-Bridging-Header.h file with the line ***import "SSZipArchive.h"*** 3. In Build Settings, drag the bridging header in Swift Compiler - Code generation -> Objective-C Bridgin...
**Important: Requires Third Party Library** Using this [library](https://github.com/marmelroy/Zip) you can use this line: ``` let unzipDirectory= try Zip.quickUnzipFile(filePath) //to unZip your folder. ``` If you want more help , check the repository.
24,241,943
I'd like to create a 'go-to-top'-button via jquery - but scroll() and scrollTop() aren't working... Here's my setup: ``` <div id="go_top">go to top</div> ``` and CSS ``` #go_top { position: fixed; right: 2em; bottom: 2em; color: #000; background-color: rgba(167, 204, 35, 0.6); font-size: 12px; padding: 1em; cursor...
2014/06/16
[ "https://Stackoverflow.com/questions/24241943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3048602/" ]
``` $(document).ready(function() { $(window).scroll(function() { if ($(this).scrollTop() > 200) { $('#go_top').fadeIn(200); } else { $('#go_top').fadeOut(100); } }); // ')' is missing here** }); ``` You are missing **')'** in your function.
Try this, ``` $(document).ready(function() { $(window).scroll(function() { if ( $(this).scrollTop() > 200) { $('#go_top').fadeIn(100); } else { $('#go_top').fadeOut(100); } }); }); ``` you are missing one closing brace and remove the px from 200
48,076,425
What is the meaning and difference between these queries? ``` SELECT U'String' FROM dual; ``` and ``` SELECT N'String' FROM dual; ```
2018/01/03
[ "https://Stackoverflow.com/questions/48076425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5657953/" ]
*In this answer i will try to provide informations from official resources* (1) The N'' text Literal ======================== `N''` is used to convert a string to `NCHAR` or `NVARCHAR2` datatype **According to this Oracle documentation [Oracle - Literals](https://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_el...
* `N'*string*'` just returns the `*string*` as `NCHAR` type. * `U'*string*'` returns also `NCHAR` type, however it does additional processing to the `*string*`: it replaces `\\` with `\` and `\*xxxx*` with Unicode code point `U+*xxxx*`, where `*xxxx*` are 4 hexadecimal digits. This is similar to `UNISTR('*string*')`, t...
1,453,482
In Linux, if I want to observe the system log in terminal in real-time, I can use the `tail` command to output the `/var/log/syslog` file with the `-f` or `--follow` switch, which "output(s) appended data as the file grows", say: ``` tail -f /var/log/syslog ``` ... or could also use: ``` dmesg --follow ``` ... wh...
2019/06/27
[ "https://superuser.com/questions/1453482", "https://superuser.com", "https://superuser.com/users/688965/" ]
Go to [sysinternals.com](https://sysinternals.com), then look at the documentation for ProcessExplorer. You can set filters to exe, events, messages and in real-time or duration. You can trace and debug too. Sysinternals Suite gives much better detail than event viewer. 1. [ProcessExplorer](https://docs.microsoft.com/...
OK, so looked up something a bit more; found this: * <https://stackoverflow.com/questions/15262196/powershell-tail-windows-event-log-is-it-possible> ... which gives examples of using PowerShell for this behavior. Based on this post, this is what I did: First, I wanted to create a PowerShell script; the page <https:/...
58,303,657
Data Source ----------- I am trying to take the following XML structure, and transform it into a CSV file with XSL. ``` <Root> <Row> <Employee>Harry</Employee> <Employees_Manager_1>Ron</Employees_Manager_1> <Employees_Manager_2>Hermione</Employees_Manager_2> <Employees_Manager_3>Ginni</Employees_Man...
2019/10/09
[ "https://Stackoverflow.com/questions/58303657", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12188126/" ]
I don't think that you will need to save the data to a custom data structure, instead you could take a look at Hibernate's 2nd level cache for both entities and queries. With proper settings the Hibernate will cache the data and the query you are using for you. [There](https://www.baeldung.com/hibernate-second-level-...
i believe you should write a database listener that listens on DB records change event then fetches the records in the data structure of your choice then caches the records to be used in case the DB change event isn't triggered * this is a good [article](https://stackoverflow.com/questions/12618915/how-to-implement-a...
28,028,618
I'm currently implementing a KD Tree and nearest neighbour search, following the algorithm described here: <http://ldots.org/kdtree/> I have come across a couple of different ways to implement a KD Tree, one in which points are stored in internal nodes, and one in which they are only stored in leaf nodes. As I have a ...
2015/01/19
[ "https://Stackoverflow.com/questions/28028618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3750097/" ]
The explanation given on ldots.org is just plain wrong (along with many other top Google results on searching KD Trees). See <https://stackoverflow.com/a/37107030/591720> for a correct implementation.
Not sure if this answer would be still relevant, but anyway I dare to suggest the following kd-tree implementation: <https://github.com/stanislav-antonov/kdtree> The implementation is simple enough and could be useful in a case if one decided to sort out how the things work in practice. Regarding the way how the tre...
9,656,523
I'm trying to find a way to use jQuery autocomplete with callback source getting data via an ajax json object list from the server. Could anybody give some directions? I googled it but couldn't find a complete solution.
2012/03/11
[ "https://Stackoverflow.com/questions/9656523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1248959/" ]
My issue was that end users would start typing in a textbox and receive autocomplete (ACP) suggestions and update the calling control if a suggestion was selected as the ACP is designed by default. However, I also needed to update multiple other controls (textboxes, DropDowns, etc...) with data specific to the end user...
I used the construction of `$.each (data [i], function (key, value)` But you must pre-match the names of the selection fields with the names of the form elements. Then, in the loop after "success", autocomplete elements from the "data" array. Did this: [autocomplete form with ajax success](http://sysadmin-arh.ru/auto-c...
48,233,470
I'm trying to set my form to specif logic when the two dates are within 30 days. ``` Date fromDate = form.getFromDate(); Date toDate = form.getToDate(); if(fromDate.compareTo(toDate) > 30){ // if the selected date are within one month } ``` I want to add like validation to be sure the selected two dates are in mo...
2018/01/12
[ "https://Stackoverflow.com/questions/48233470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594057/" ]
``` Date fromDate = form.getFromDate(); Date toDate = form.getToDate(); LocalDateTime from = LocalDateTime.ofInstant(fromDate.toInstant(), ZoneId.systemDefault()); LocalDateTime to= LocalDateTime.ofInstant(toDate.toInstant(), ZoneId.systemDefault()); if(Duration.between(from, to).toDays() <= 30){ //do work } ``` Mak...
Since Java 8 you can get the help of [`ChronoUnit`](https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoUnit.html): To determine if the difference between your dates is 30 days use [`ChronoUnit.DAYS`](https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoUnit.html#DAYS): ``` LocalDate from...
4,324,969
Has anyone used Trent Richardsons TimePicker? It's a wonderful plugin, but I just can't seem to change the format of the date to dd/mm/yyyy Has anyone used this control and knows if this can be done?
2010/12/01
[ "https://Stackoverflow.com/questions/4324969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/296392/" ]
this works ``` > DatePicker2.datepicker({ dateFormat: > 'dd/mm/yy', changeMonth: true, > changeYear: true, showAnim: '', > showTime: true, duration: '' > }); ```
There is a property `dateFormat` on the `TimePicker` object itself. ``` $.datepicker.regional['en'] = { dateFormat: 'dd.mm.yyyy' } ```
5,221,757
It would be nice to have larger MessageBox Buttons since the target for this application is a tablet. ``` DialogResult dialogResult = MessageBox.Show( message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); switch (dialogResult) { case DialogResult.Yes:...
2011/03/07
[ "https://Stackoverflow.com/questions/5221757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/398460/" ]
It is a system setting. Tablet PCs are normally already configured to make it easy to tap buttons like this so that it works well in any program, not just yours. To configure your tablet, in Win7, use Control Panel + Display, Personalization, Window Color. Click Advanced appearance settings, select "Message Box" in the...
You can make a 2nd form, then you can make the buttons as big as you want
4,445,414
Consider the fragment below: ``` [DebuggerStepThrough] private A GetA(string b) { return this.aCollection.FirstOrDefault(a => a.b == b); } ``` If I use F11 debugger doesn't skip the function instead it stops at **a.b == b**. Is there any way to jump over this function rather than using F10?
2010/12/14
[ "https://Stackoverflow.com/questions/4445414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251231/" ]
I can see why it happens but don't have a way to get around it. Perhaps someone can build on this. The lambda expression gets compiled into an Anonymous Method. I see: Program.GetA.AnonymousMethod\_\_0(Test a) Just like if you called another method in the method you've shown, pressing F11 would go into that method. e...
IMO this is a bug in the C# compiler. The compiler should also place those attributes on the anonymous methods. The workaround is to fallback to doing the work manually that the C# compiler does for you: ``` [DebuggerStepThrough] private A GetA(string b) { var helper = new Helper { B = b }; return this.aColle...
263,103
I have a problem with lightning:inputField, in my page I have a mix of lighting:input and lightning:inputField. When I dispaly inputField in large screen, the label is horizontally aligned with the input. [![enter image description here](https://i.stack.imgur.com/X9i9Z.jpg)](https://i.stack.imgur.com/X9i9Z.jpg) I wou...
2019/05/21
[ "https://salesforce.stackexchange.com/questions/263103", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/55463/" ]
i think your org moved to summer 19, please have look [new changes in summer 19](https://releasenotes.docs.salesforce.com/en-us/summer19/release-notes/rn_aura_components.htm) , your use case you need to give density attribute for `lightning:recordeditform` please try below code ``` <aura:component > <aura:attribute na...
I tried your code in my personal org and its working completely fine. When I dispalyed inputField in large screen, the label is aligned vertically with the label. Try Element inspection by clicking F12, this would help you in finding what is going wrong.
1,804,336
If I have the following differential equation: $\dfrac{dy}{dx} = \dfrac{y}{x} - (\dfrac{y}{x})^2$ And if I make the variable change: $\dfrac{y}{x} \rightarrow z$ I know have $\dfrac{dy}{dx} = z-z^2$ What is $\dfrac{dx}{dy}$ after the variablechange?
2016/05/29
[ "https://math.stackexchange.com/questions/1804336", "https://math.stackexchange.com", "https://math.stackexchange.com/users/332511/" ]
Suppose you have a differential equation that looks like this: $$y'=F\left ( \frac{y}{x}\right )$$ then you can make a substitution $v(x)=\frac{y}{x} \iff y=vx \implies y'=v+xv'$ to transform your ODE into an ODE in $v$ $$\implies v+xv'=F(v) \iff \frac{dv}{F(v)-v}=\frac{dx}{x}$$ This equation is separated and you can...
If you make $y=x z$, $y'=x z'+z$ and the equation becomes $$x z'+z=z-z^2$$ that is to say $$x z'=-z^2$$which is separable.
8,838,212
I'm trying to resize the `<li>`s in my jQuery mobile site (listview) and can't seem to find the right class in CSS to do it. I've basically resized some of the elements (the header and footer, etc.). I have five `<li>` buttons stacked vertically and there is a gap below the buttons and the footer. I just want to set e...
2012/01/12
[ "https://Stackoverflow.com/questions/8838212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/975592/" ]
If you check-out the classes you can make your own decision about how to select the `LI` elements, I would use the `.ui-li` class and if you want to make sure to only get one `listview` element then you can specify a more detailed selector: ``` #my-listview-id > .ui-li { height : 20%; } ``` Here is some sample `...
It is simple as that: ``` .ui-li>.ui-btn-inner { padding-top: 10px padding-bottom: 10px } ```
36,681,463
I have this schema. ``` create table "user" (id serial primary key, name text unique); create table document (owner integer references "user", ...); ``` I want to select all the documents owned by the user named "vortico". Can I do it in one query? The following doesn't seem to work. ``` select * from document wher...
2016/04/17
[ "https://Stackoverflow.com/questions/36681463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/272642/" ]
``` SELECT * FROM document d INNER JOIN "user" u ON d.owner = u.name WHERE u.name = 'vortico' ```
You can use subquery. For your example it can be faster ``` SELECT * FROM document WHERE owner = (SELECT id FROM users WHERE name = 'vortico'); ```
407,771
How can one allow code snippets to be entered into an editor (as stackoverflow does) like FCKeditor or any other editor while preventing XSS, SQL injection, and related attacks.
2009/01/02
[ "https://Stackoverflow.com/questions/407771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40376/" ]
Part of the problem here is that you want to allow certain kinds of HTML, right? Links for example. But you need to sanitize out just those HTML tags that might contain XSS attacks like script tags or for that matter even event handler attributes or an href or other attribute starting with "javascript:". And so a compl...
The same rules apply for protection: **filter input, escape output.** In the case of input containing code, filtering just means that the string must contain printable characters, and maybe you have a length limit. When storing text into the database, either use query parameters, or else escape the string to ensure y...
52,830,733
I am trying to export a websphere profile. Tried various commands under wsadmin ``` $AdminTask exportWasprofile {-archive c:/myCell.car} AdminTask.exportWasprofile('[-archive c:/myCell.car]') AdminTask.exportWasprofile(['-archive', 'c:/myCell.car']) ``` all return a syntax error com.ibm.bsf.BSFException: error while...
2018/10/16
[ "https://Stackoverflow.com/questions/52830733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3249353/" ]
The first example you give is correct for use with wsadmin in jacl language mode, the third is correct for jython lang mode. The error message you posted indicates that wsadmin is operating in jacl language mode.
You're almost right, this one should work. `AdminTask.exportWasprofile(['-archive c:\myCell.car'])`
1,410,211
I'd like to stop immediately a method if I press cancel in the "processing" animation screen. I'm using Async call through delegates. Is it possible to stop immediately the execution of the method through delegates? Thanks :)
2009/09/11
[ "https://Stackoverflow.com/questions/1410211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48834/" ]
You can use [System.ComponentModel.BackgroundWorker](http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx). It supports cancellation so that you don't have to write the boilerplate code. Client code can simply call [CancelAsyn](http://msdn.microsoft.com/en-us/library/system.componentmodel...
As Jon has already stated, you can't tell a thread: "please stop now" and expect the thread to obey. Thread.Abort will not tell it to stop, will simply "unplug" it. :) What I did in the past was add a series of "if (wehavetostop)" within the thread's code and if the user pressed a "cancel" I put wehavetostop == true. ...
25,263
I have had 2 brews and a mate, one brew recently that have turned nuclear. And it has been on or about day 20-21 after bottling in all instances. All brews were a different style but the same manufacturer, namely Mangrove Jack. Were we live is currently getting warm, 33-35C. I’ve saved most of my brews by either puttin...
2020/09/29
[ "https://homebrew.stackexchange.com/questions/25263", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/18577/" ]
OK. You're brewing kit beers, so I'm assuming your wort composition has been more or less consistent (i.e. 1 tin of hopped malt extract, 1 kg of brew blend which is mostly dextrose with some maltodextrin and some dry malt extract blended in, and water up to 23 litres / 6 gallons. That means your bottle bombs could only...
I believe the issue was a combination of post bottling temperature and hop creep. Whilst not excessively hopping(20-30g) dry, it’s hot in the tropics. My shed could get to 32-34C during the day. Backed off the priming sugar bit by bit, nah. Time to keg. Another challenge but not as potential messy. The Kveik yeast work...
2,015,408
> > If the power series $\sum a\_nz^n$ converges at $3+4i$ then find radius of convergence of the series. > > > I can conclude that radius of convergence is either $\ge 5$ or $\le 5$.But how to find it? Please help
2016/11/15
[ "https://math.stackexchange.com/questions/2015408", "https://math.stackexchange.com", "https://math.stackexchange.com/users/294365/" ]
You cannot find the radius of convergence exactly here. The center of expansion is 0, let $\rho$ be the radius of convergence. The relevant theorem says that the series converges (absolutely) for $|z| < \rho$ and diverges for $|z| > \rho$. Therefore you know that the series is only allowed to converge for $|z| \leq \rh...
The series converges at $z$ if $|z|$, which is the distance from $0$ to $z$, is less than the radius of convergence, and diverges if if $|z$ is more than the radius of convergence. If $|z|$ is exactly equal to the radius of convergence, then it may converge or diverge depending on which series you've got and which poin...
3,992,541
There are many, many questions and quality answers on SO regarding how to prevent leading zeroes from getting stripped when importing to or exporting from Excel. However, I already have a spreadsheet that has values in it that were truncated as numbers when, in fact, they should have been handled as strings. I need to ...
2010/10/21
[ "https://Stackoverflow.com/questions/3992541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369601/" ]
I know this was answered a while ago but just chiming with a simple solution here that I am surprised wasn't mentioned. ``` =RIGHT("0000" & A1, 4) ``` Whenever I need to pad I use something like the above. Personally I find it the simplest solution and easier to read.
If you use custom formatting and need to concatenate those values elsewhere, you can copy them and Paste Special --> Values elsewhere in the sheet (or on a different sheet), then concatenate those values.
31,298,960
I have a problem with one of my forms that I've created. It is supposed to be an email sender that allows the user to send an email to a given email in the code from a specified email that they put in `TextBox1`. The problem is that the email, when sent to my Gmail account, does not use this custom 'from' email. Here ...
2015/07/08
[ "https://Stackoverflow.com/questions/31298960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It looks like you are setting the `From` property correctly. That will set the `From` value in the SMTP header. However, not all email clients honor that `From` value in the header. GMail, in particular, ignores the `From` value in the header and always displays the actual email account that originally sent the message...
I don't believe google let's you replace the From: address, it will always use the logged in users SMTP alias as the From: You might be able to use the ReplyTo/ReplyToList properties though, have never tried. EDIT: Did some further searching and found [this](https://stackoverflow.com/questions/5431631/when-using-gmai...
10,740,265
I understand the `-> theading macro in Clojure applies all the provided functions provided to a given argument. However, it doesn't seem to work with anonymous functions. For example: ``` user> (-> 4 inc inc dec) 5 ``` But: ``` user> (-> 4 #(+ % 1) #(- % 1) #(+ % 1)) ``` Returns the error: ``` clojure.lang.Symb...
2012/05/24
[ "https://Stackoverflow.com/questions/10740265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/767760/" ]
You can have anonymous functions in Clojure macros. You are having problems, because you are missing some parentheses. :) Your example is edited below. ``` (-> 4 (#(+ % 1)) (#(- % 1)) (#(+ % 1))) ```
Your specific case could have been solved simply using: ``` (-> 4 (+ 1) (- 1) (+ 1)) ``` where the thread first macro `->` takes care of inserting the result of the previous step as the first argument in the "current" function. The confusion arises from the fact that `->` is not a function but a macro and the argum...
8,929,786
For the past day I have been trying to figure out how to change the min-height styling on a jQuery mobile page when viewing in mobile safari. I have tried, inline styles, overriding ui-page styles and have yet to find a way to override the height of data-role="page". Ideally if the page "content" is less than the "page...
2012/01/19
[ "https://Stackoverflow.com/questions/8929786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/971677/" ]
The `min-height` of the `data-role="page"` element is set via JavaScript in a `resize` event handler for the `window` object. You can create your own JavaScript that resizes the page differently: ``` $(function () { $(window).bind('resize', function (event) { var content_height = $.mobile.activePage.childr...
I was facing the same issue when showing a popup with an overlay $.mobile.resetActivePageHeight(); did the trick for me. Thanx!
15,745,047
I would like to know whether there is any open free radius server which supports radius fragmentation i.e. radius server which accepts packets greater than 4k size limit from the client and will do reassembly of the packet at server end. And once whole packet is assembled, will do the successful authentication of the p...
2013/04/01
[ "https://Stackoverflow.com/questions/15745047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1053024/" ]
Since you want to run this on some files containing code, here's an example of that full functionality: ``` $ cat file foo() { String1.append("Hello"); if (bar) { s.append("\n\n\n"); } else { s.append("\n\\n\n\\\n"); } } $ $ cat tst.awk match($0,/[[:alnum:]_]+\.append\(".*"\)/) { split(s...
Yay for perl! ``` x='String1.append("Hello");' echo $x | perl -pe 's/(\w*\.append\(\")(.*)(\"\);)/my($len)=length($2); $_="$1$2, ${len}$3";/e' ```
17,562,740
We are attempting to implement simple grouping of items within a ComboBox using the ICollectionView. The grouping and sorting being used in the CollectionView works correctly. But the popup items list created by the ComboBox does not function as intended because the scroll bar scrolls the groups not the items. *eg: If...
2013/07/10
[ "https://Stackoverflow.com/questions/17562740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46654/" ]
Fixed by setting CanContentScroll = false on PART\_Popup template for the child ScrollViewer. ``` <UserControl x:Class="FilterView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:ViewModels"> <UserControl.Re...
``` <Combobox ScrollViewer.CanContentScroll="False"></Combobox> ``` Use above code it will solve problem. Regards, Ratikanta
8,869,131
i want to make action bar top and down in android 4.03 make code but when i run it it doesn't appear , i don't know what is wrong , i search for reson before asking here but i didn't find anything here is menu/style.xml code: ``` <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id=...
2012/01/15
[ "https://Stackoverflow.com/questions/8869131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1081907/" ]
if Object1 , Object2 and Object3 are JSON strings convert it to Javascript objects using `eval` function. Then merge them using `concat` method. <http://www.w3schools.com/jsref/jsref_concat_array.asp> ``` var mergedArray = arr1.concat(arr2, arr3); ``` Then sort using `sort` method in Javascript Array. ref : <http:/...
Convert them to object and [this](https://stackoverflow.com/a/1129270/475726) should do the trick
10,114,355
I've been using mongo and script files like this: ``` $ mongo getSimilar.js ``` I would like to pass an argument to the file: ``` $ mongo getSimilar.js apples ``` And then in the script file pick up the argument passed in. ``` var arg = $1; print(arg); ```
2012/04/11
[ "https://Stackoverflow.com/questions/10114355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367685/" ]
Use `--eval` and use shell scripting to modify the command passed in. `mongo --eval "print('apples');"` Or make global variables (credit to Tad Marshall): ``` $ cat addthem.js printjson( param1 + param2 ); $ ./mongo --nodb --quiet --eval "var param1=7, param2=8" addthem.js 15 ```
I solved this problem, by using the javascript bundler parcel: <https://parceljs.org/> With this, one can use node environment variables in a script like: ``` var collection = process.env.COLLECTION; ``` when building with parcel, the env var gets inlined: ``` parcel build ./src/index.js --no-source-maps ``` The...
9,403,814
Ok, first of; here's what I did: 1. Install AZURE tools 2. Reboot 3. Start Visual Studio - new Azure project 4. Add web role (asp.net MVC 4 beta web role) 5. Hit F5 (debug) It starts up the storage emulator and the compute emulator and starts to load in runtimes, and then I get a popup saying that the debugger couldn...
2012/02/22
[ "https://Stackoverflow.com/questions/9403814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213323/" ]
I got this exact same error and tried a re-install of IIS and the Azure SDK - nothing worked. Eventually tracked it down to the "IIS URL Rewrite Module 2". I went to the Control Panel and chose Repair and it resolved it. If you have a section in your web.config then this might be the cause.
Follow step 11 from <http://www.microsoft.com/en-us/download/details.aspx?id=35448>. Worked for me on Windows 8 with Oct 2012 SDk when upgraded from 2011.
13,575,703
I recently installed IPython after hearing about it on this forum. I am looking for an environment that is similar to what might come with MATLAB or RStudio for R. I was under the impression that IPython would give me that but the version I downloaded for Windows looks very bare. In fact I do not really see a differen...
2012/11/27
[ "https://Stackoverflow.com/questions/13575703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1816858/" ]
For the context, i've been using Eclipse, pycharm, got tired of those, and i started to ask around what people use, and the one i've heard the most about is [sublime text](http://www.sublimetext.com/). You should take a look, maybe it's what you are looking for! I just saw it's not open source though! What i'm using ...
Have you tried the [`qtconsole`](https://ipython.org/ipython-doc/3/interactive/qtconsole.html) backend? It was released after you asked your question. > > This is a very lightweight widget that largely feels like a terminal, > but provides a number of enhancements only possible in a GUI, such as > inline figures, ...
30,145,779
I'm trying to redirect www URLs to non-www for my forum. My forum is installed in a subdirectory called "forum". In my root directory I've got WordPress installed. For the WordPress in my root directory the .htaccess redirection works fine, but I'm having trouble get it working for my forum. I've tried a couple of ru...
2015/05/09
[ "https://Stackoverflow.com/questions/30145779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2511117/" ]
To set up Dark theme as a "global" theme, and the theme you like from Eclipse Color Theme that you installed from Market Place, you can do the following. I used: 1. windows 10 (64 bit, but for 32 bit is probably the same) 2. eclipse oxygen Steps: 1. Set the "global" theme to the dark theme: (`Windows>Preferences>Ge...
Nothing from here works for me. I even deleted the workspace and created new one. The only thing i kept was the git archive containing the eclipse project files and the java stuff. And still after a restart the first 30s it seems as if it works. Then suddently the colors in the editor changes AND the content of the org...
37,048
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only\* way in Silverlight... Or point to a library? I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading. \*There are no GDI+(System.Drawing) or WPF(S...
2008/08/31
[ "https://Stackoverflow.com/questions/37048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/580/" ]
You could easily write crop yourself in fjcore. Start with the code for Resizer <http://web.archive.org/web/20140304090029/http://code.google.com:80/p/fjcore/source/browse/trunk/FJCore/Resize/ImageResizer.cs?> and FilterNNResize -- you can see how the image data is stored -- it's just simple arrays of pixels. The im...
where is silverlight executed? Is there any reason at all to send an complete picture to the client to make the client crop it? Do it on the server... (if you are not creating an image editor that is..)
184,204
I have file like this : ``` other lines . . . blah blah blah (:34) ``` I wish to find the occurrence of numbers in the above file. I came up with: ``` grep [0-9] filename ``` But that is printing the whole: ``` blah blah blah (:34) ``` Rather I want only `34`. Is there any way to do so?
2012/09/05
[ "https://askubuntu.com/questions/184204", "https://askubuntu.com", "https://askubuntu.com/users/12227/" ]
`grep -o` will print only the matching part of the line. Otherwise grep will print any lines with the pattern.
**I would use curl to access your file locally or remotely, then I would grep lines with numbers wrapped in (: ) then cut those pieces off and write to file** the accepted answer ignores there could be numbers in the previous lines of the file, it does work for the example data, but what if the file was remote? **Loc...
2,468,132
I have a script that looks like this ``` #!/bin/bash function something() { echo "hello world!!" } something | tee logfile ``` I have set the execute permission on this file and when I try running the file like this ``` $./script.sh ``` it runs perfectly fine, but when I run it on the command line like this...
2010/03/18
[ "https://Stackoverflow.com/questions/2468132", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18548/" ]
Running it as `./script.sh` will make the kernel read the first line (the shebang), and then invoke bash to interpret the script. Running it as `sh script.sh` uses whatever shell your system defaults `sh` to (on Ubuntu this is Dash, which is sh-compatible, but doesn't support some of the extra features of Bash). You c...
if your script is at your present working directory and you issue `./script.sh`, the kernel will read the shebang (first line) and execute the shell interpreter that is defined. you can also call your `script.sh` by specifying the path of the interpreter eg ``` /bin/bash myscript.sh /bin/sh myscript.sh /bin/ksh mysc...
58,915,047
I want create a rotate icon inside a image: ``` <ImageBackground style={stylesNative2.image} source={{ uri }} > <TouchableOpacity onPress={ () => { alert("handler here") }} tyle={styles.rotateImageIcon}> <Icon name='rotate-ccw' type='Feather' style={styles.rotateImageIcon} /> </TouchableOpacity> </ImageBack...
2019/11/18
[ "https://Stackoverflow.com/questions/58915047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8830231/" ]
following command: ``` find -name '*[0-9][0-9][0-9][0-9]' -type d -exec bash -c 'for dir; do mv "$dir" "${dir%[0-9][0-9][0-9][0-9]}(${dir#${dir%[0-9][0-9][0-9][0-9]}})"; done' - {} + -prune ``` should work. * double quote arround variable expansion * `${dir%[0-9][0-9][0-9][0-9]}` to remove last 4 digits suffix * `$...
I found Bash annoying when it comes to find and rename files for all the escaping one needs to make. This is a cleaner Ruby solution : ``` #!/usr/bin/ruby require 'fileutils' dirs = Dir.glob('./**/*').select {|x| x =~ / [0-9]*/ } dirs.sort().reverse().each do |dir| new_name=dir.gsub(/(.*)( )([0-9]{4})/, '\1\2(...
309,208
...and what should we do with them? I'm starting to see questions on the Python tag like: * "How do you access a value in a list?" (i.e., how do you use a basic data structure) * "How do I call a function?" * "How do I call a method?" These are extremely basic questions about simple language features that should be ...
2015/10/30
[ "https://meta.stackoverflow.com/questions/309208", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/2588818/" ]
> > Are there questions that are too trivial to answer? > > > No. > > Are there questions that are too trivial to answer *by Stack Overflow's standards*? > > > Yes. If I Google your problem and get a large number of hits, and a trivial inspection of one of those hits reveals the solution, then your question ...
The coming-soon documentation feature should cover such simple questions. I hope we'll have a special flag or some other way to mark questions as already explained in the documentation. Then you won't have to search though a lot of questions because there will be a single and obvious place to search.
4,745,994
I just have a List<> and I would like to add an item to this list but at the first position. List.add() add the item at the last.. How can I do that?.. Thanks for help!
2011/01/20
[ "https://Stackoverflow.com/questions/4745994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/142234/" ]
``` List<T>.Insert(0, item); ```
Use `List.Insert(0, ...)`. But are you sure a [`LinkedList`](http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx) isn't a better fit? Each time you insert an item into an array at a position other than the array end, all existing items will have to be copied to make space for the new one.
3,001,026
I have a SQl Server 2005 database backup that I want to transfer to SQL Server 2008 on my server. I spent 3 days transferring the .bak file from my own machine to my server. I then tried to restore the bak file and I got an error. I then read online a completely different method for adding a SQL server 2005 Database to...
2010/06/08
[ "https://Stackoverflow.com/questions/3001026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197032/" ]
I've found the reason. Query string parameter is using in my URL, so it looks like "<http://localhost/Image.ashx?id=49>". I've thought that if VaryByParams is not set explicitly, server will always take value of id param into account, because context.Response.Cache.VaryByParams.IgnoreParams is false by default. But in ...
public cacheability depends on user browser or proxy it specifies that the response is cacheable by clients and shared (proxy) caches. had you tried using `HttpCacheability.Server` <http://msdn.microsoft.com/en-us/library/system.web.httpcacheability(v=VS.71).aspx>
127,704
I want to write a function that takes an array of letters as an argument and a number of those letters to select. Say you provide an array of 8 letters and want to select 3 letters from that. Then you should get: ``` 8! / ((8 - 3)! * 3!) = 56 ``` Arrays (or words) in return consisting of 3 letters each.
2008/09/24
[ "https://Stackoverflow.com/questions/127704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9191/" ]
Here is my proposition in C++ I tried to impose as little restriction on the iterator type as i could so this solution assumes just forward iterator, and it can be a const\_iterator. This should work with any standard container. In cases where arguments don't make sense it throws std::invalid\_argumnent ```cpp #inclu...
Another one solution with C#: ``` static List<List<T>> GetCombinations<T>(List<T> originalItems, int combinationLength) { if (combinationLength < 1) { return null; } return CreateCombinations<T>(new List<T>(), 0, combinationLength, originalItems); } static List<L...
10,914,802
I am aware that this is a very basic question, but an interviewer asked me in a very trick way and I was helpless :( I know only material or theoretical definition for an interface and also implemented it in many projects I worked on. But I really don't understand why and how is this useful. I also don't understand o...
2012/06/06
[ "https://Stackoverflow.com/questions/10914802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183979/" ]
This is an easy example: Both of `Array` and `List` implement the interface `IList`. Below we have a `string[]` and a `List<string>` and manipulate both of them with only one method by using **IList**: ``` string[] myArray = { "zero", "one", "two", "three", "four"}; List<string> myList = new List<string>{ "zero", "on...
You can only inherit from one abstract class. You can inherit from multiple interfaces. This determines what I use for most of the cases. The advantage of abstract class would be that you can have a base implementation. However, in the case of IDisposable, a default implementation is useless, since the base class does...
49,248,195
New to Hugo and css. Trying to change the fonts of the beautifulhugo theme based on these instruction: See Chandra's Nov 17 post: <https://discourse.gohugo.io/t/font-selection-in-theme/8803/8> I have downloaded two fonts and placed them in static/fonts Added the following to config.toml ``` googlefonts = “http://fo...
2018/03/13
[ "https://Stackoverflow.com/questions/49248195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5057346/" ]
In config.toml, add ``` [params] custom_css = ["css/custom_style.css"] ``` Not sure if this works on all themes generally, but it works on [the theme I'm using](https://themes.gohugo.io/hugo-coder/).
You say: > > I have downloaded two fonts and placed them in static/fonts > > > Why would you do that if you are using google fonts? Anyway, did you try removing `http:` form `googlefonts = “http://fonts.googleapis.com/css?family=Itim|Limelight”` You probably have something down the line in your code that is ove...
96,201
I believe there is a single word that represents what I am trying to say, but for the life of me I can’t remember it. I have a line graph of amounts vs. time. The amounts are for different currencies. I then have a derivative graph where all the amounts are in one currency. > > The second graph is [blanked] to the s...
2012/12/31
[ "https://english.stackexchange.com/questions/96201", "https://english.stackexchange.com", "https://english.stackexchange.com/users/33005/" ]
How about *exchanged*? Graph 1 represents each series in the local currency. Graph 2 represents each currency exchanged to [reporting currency here] using the [datasource] rates as of [datestamp].
I am also a fan of **normalized**, but here is another option: When one set of data is translated into coordinate system, we sometimes say the data is *projected*. This is more commonly used when converting from a 3-dimensional system to a 2-dimensional system, such as using a flat map to represent a globe (consider th...
12,571,031
If I have a view and want to see all the set variables for the particular view, how would I do it?
2012/09/24
[ "https://Stackoverflow.com/questions/12571031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/873429/" ]
Variables assigned to a `Zend_View` object simply become public properties of the view object. Here are a couple of ways to get all variables set in a particular view object. **From within a view script:** ``` $viewVars = array(); foreach($this as $name => $value) { if (substr($name, 0, 1) == '_') continue; // ...
``` $this->view->getVars() ``` or from inside the view ``` $this->getVars() ```
19,321,609
I added `vertical-align: middle` for all td with day number: ``` #calendar td { vertical-align: middle !important; } ``` but this don't work for responsive web page for first column:![enter image description here](https://i.stack.imgur.com/HIPC5.png) How I can fix it? I try added margin-top in % and em, its wo...
2013/10/11
[ "https://Stackoverflow.com/questions/19321609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/970863/" ]
This will center the day vertically without JS. Not sure what it'll do to the events though. Added to your demo: <http://jsfiddle.net/8ctRu/10/> ``` .fc-day:first-child > div:first-child { position: relative; } .fc-day:first-child > div:first-child .fc-day-number { position: absolute; top: 50%; left...
`min-height:64px` is throwing you off.. Put the `height:64px` on the container `<td>`
32,497,466
I need to connect two tables by two columns. First table has primary key as integer type id. Second table has varchar2 type column which contains the same primary key but is located in the middle of a string. > > For example in first table I have column called integer ID with ID > like 1234. In the second table I ...
2015/09/10
[ "https://Stackoverflow.com/questions/32497466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
From Oracle 11g you can use a virtual column: [SQL Fiddle](http://sqlfiddle.com/#!4/30645/1) **Oracle 11g R2 Schema Setup**: ``` CREATE TABLE TableA ( id NUMBER(4,0) PRIMARY KEY ); INSERT INTO TableA VALUES ( 1234 ); CREATE TABLE TableB ( data VARCHAR2(25) NOT NULL CHECK ( REGEXP_LIKE( data...
Firstly, the table **design** is bad. You should have the **primary key** column with a **foreign key relationship** in the second table. And have a **supporting index** for the foreign key. Storing **delimited text** in a **single column** is not a good design and violates **normalization**. If the pattern of the str...
855,334
I would like my `Canvas` to automatically resize to the size of its items, so that the `ScrollViewer` scroll bars have the correct range. Can this be done in XAML? ``` <ScrollViewer HorizontalScrollBarVisibility="Auto" x:Name="_scrollViewer"> <Grid x:Name ="_canvasGrid" Background="Yellow"> <Canvas x:Name=...
2009/05/12
[ "https://Stackoverflow.com/questions/855334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22820/" ]
``` void MainWindow_Loaded(object sender, RoutedEventArgs e) { autoSizeCanvas(canvas1); } void autoSizeCanvas(Canvas canv) { int height = canv.Height; int width = canv.Width; foreach (UIElement ctrl in canv.Children) { bool nullTop = ctrl.GetValue(Canvas.TopProperty) == null || Double.IsNaN...
I have also encountered this problem, my issue was that the grid wasn't auto-resizing when the Canvas did resize thanks to the overrided MeasureOverride function. my problem: [WPF MeasureOverride loop](https://stackoverflow.com/questions/30726257/wpf-measureoverride-loop)
41,913,818
let me first start with showing the code: build.gradle (module): ``` android { compileSdkVersion 24 buildToolsVersion "24.0.2" dataBinding { enabled = true } defaultConfig { applicationId "com.example.oryaa.basecalculator" minSdkVersion 15 targetSdkVersion 24 versionCode 1 versionName "1.0" }...
2017/01/28
[ "https://Stackoverflow.com/questions/41913818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I had a similar issue when I needed to refresh the views after an event, with my variable objects not observable, so I added this: ``` binding?.invalidateAll() ``` I hope it helps.
You need to call `executePendingBindings()` for immediately update binding value in view: > > When a variable or observable changes, the binding will be scheduled to change before the next frame. There are times, however, when binding must be executed immediately. To force execution, use the executePendingBindings() ...
10,472
How do I find public Minecraft servers? Is there a directory of them?
2010/11/08
[ "https://gaming.stackexchange.com/questions/10472", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3375/" ]
There is no *official* directory for Minecraft servers, but the most popular places are: [Minecraft Classic Servers](http://www.minecraft.net/servers.jsp) [Minecraft Alpha Servers](http://servers.minecraftforum.net/)
There is also [Abyssal-Legion Minecraft Server Status Page](http://minecraft.abyssal-legion.com/serverstatus/).
1,012,453
Georg Cantor is formally known as the first one who discovered existence of infinities of different sizes. But the history of thinking about the concept of "infinity" in maths and philosophy goes back to ancient era. > > **Question:** Was there anybody (mathematician, philosopher, etc.) *before* Cantor who mentioned...
2014/11/08
[ "https://math.stackexchange.com/questions/1012453", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
See [Galileo's Paradox](http://en.wikipedia.org/wiki/Galileo's_paradox) with the English transaltion of the relevant part of * *Discorsi e dimostrazioni matematiche intorno a due nuove scienze attenenti alla meccanica e i movimenti locali* (Leida, 1638) : > > > > > > *Simpl.* Qui nasce subito il dubbio, che mi pa...
According to [this reference](http://books.google.ca/books?id=hN454jMVmLkC&pg=PA183&lpg=PA183&dq=earliest%20reference%20to%20infinity&source=bl&ots=zLehq-58CB&sig=8IbtwFtlI8X_RV9cm0mwDR516co&hl=en&sa=X&ei=8Y9eVO67IdDtoATulILwBw&ved=0CEgQ6AEwBw#v=onepage&q=earliest%20reference%20to%20infinity&f=false) in 400BC, Jain mat...
51,205,695
I'm implementing an App only for iPad and apparently react native doesn't support numeric keyboard type for iPad. just want to know any idea how to manage keyboard to show only numbers. I tried some regular expression but it doesn't work properly.
2018/07/06
[ "https://Stackoverflow.com/questions/51205695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2083099/" ]
For some reason this is not supported for Ipad. So you will need to either: 1) Show non-numeric characters but only accept numeric characters (via code). 2) Use this library [react-native-custom-keyboard](https://github.com/reactnativecn/react-native-custom-keyboard).
Try ``` keyboardType = 'number-pad' ``` Hope it works Or read some [article](https://facebook.github.io/react-native/docs/textinput#keyboardtype)