qid
int64
1
74.7M
question
stringlengths
0
70k
date
stringlengths
10
10
metadata
list
response
stringlengths
0
115k
31,532,828
``` import java.util.Date; import java.util.Timer; import java.util.TimerTask; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import...
2015/07/21
[ "https://Stackoverflow.com/questions/31532828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4209039/" ]
in requestLocationUpdates method second parameter is minimum time interval between location updates, in milliseconds, So you just need to do this: ``` LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 30 ...
41,614
> > * What does her parents do? > * What do her parents do? > > > Which one is correct? Can you have *does* and *do* in the same sentence like the first one? Would it be incorrect because parents is plural so *do* must be used throughout?
2014/12/10
[ "https://ell.stackexchange.com/questions/41614", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/-1/" ]
> > What do her parents do? > > > Here the subject of the sentence is *her parents*. Because *her parents* is plural the auxiliary verb *DO* must agree with the plural noun phrase, so we need *do* and not *does*. The auxiliary verb *DO* is the first verb in the sentence. This is the verb that moves in front of the...
65,811,090
My code worked fine but I changed some things and now it doesn't... When I type `!ping` in the any channel it doesn't work. * the bot is on the server and an admin. * I changed the token down there * here's the code: Does anyone see something?? ```js const Discord = require(`discord.js`), client = new Discord.Clien...
2021/01/20
[ "https://Stackoverflow.com/questions/65811090", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14081166/" ]
The problem is, you're using commas where you should be using semicolons, so JS will be interepreting this strangely which will give you undefined behaviour. You should also preferably prefix your variables with `let`, `var` or `const` otherwise this could also lead to undefined behaviour. It is recommended to use `let...
45,749,458
I am trying to identify lines in a file that have either 4 integer or 2 double values. My regular expression is as below: ``` var match = new Regex(@"^(?<Values>(((\d+\s*){4})|(\d+\.\d+\s*){2}))$"); ``` Sample of lines in the file getting parsed: ``` element 1 2 8 24 2 1 1 0 1 129 2 2 0 0 30.200001 1000.0000 208 ...
2017/08/18
[ "https://Stackoverflow.com/questions/45749458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1762551/" ]
you directly store result into array. so your code should be like ``` $reader= \Excel::load(Input::file('import_file'))->toArray(); return redirect()->back()->with('reader', $reader); ```
5,706,194
I have inherited a .NET 4 VS2010 solution consisting of a WinForms app and a web service. I don't have access to a server that's running a copy of the web service but I have to run, debug, upgrade and test the project that accesses the web service as well as the web service code. Later, I also want to quickly switch b...
2011/04/18
[ "https://Stackoverflow.com/questions/5706194", "https://Stackoverflow.com", "https://Stackoverflow.com/users/686433/" ]
The easiest is to host the service locally in visual studio and change the service url to switch between the production service and the local one. You can automatically switch between the services by checking for Debug and Release modes using `#if` and `#else` directives. You can also use the interface to provide a st...
54,003,335
I want to implement javascript function to delete confirmation. After clicking `ok` button of confirmation alert table `tr` should be removed from front end. I have used `$("#confirm-btn-alert").click(function()` for confirmation alert which is in `sweet-alert-script.js` and `function SomeDeleteRowFunction(o)` which is...
2019/01/02
[ "https://Stackoverflow.com/questions/54003335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10856425/" ]
Use shared preferences to save the data, then on start up use an if statement to determine whether the user needs to fill it out.
62,653,757
I integrated React Froala Editor to my website. It's a simple project and I want to show paragraph select drop down. But it doesn't work. Is it related to version? ``` this.state = { model: ``, tags: [], config: { theme: 'foobar', heightMax: 800, height: 800, toolbarButtons:...
2020/06/30
[ "https://Stackoverflow.com/questions/62653757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12067813/" ]
It seems that plugins are missing. Try to import plugins in your component: ``` import 'froala-editor/js/plugins.pkgd.min.js'; ```
3,197,523
I have a question about camera calibration. I've followed approach shown in a book Learning OpenCV for camera calibration process. But the calibrated(undistorted) image is worse than the original one. Is it possible that my camera don't need calibration anymore?(means that the calibration is done by some driver or som...
2010/07/07
[ "https://Stackoverflow.com/questions/3197523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385826/" ]
The calibration cannot be done by the driver. If you're planning 3D reconstruction, then you cannot do without a calibration matrix.
3,198,494
I am try in to get the ClientID of one of my server controls to appear in a Javascript in my aspx page. Obviously I am going about it the wrong way, but my intent should be made clear in the following: ``` doSomethingFirst(); var hid = "<% Response.Write(HidingField.ClientID) %>"; doSomethingElse(hid); ``` Any advi...
2010/07/07
[ "https://Stackoverflow.com/questions/3198494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316862/" ]
I'm doing a bit of guessing about your intent, so forgive me if I've guessed wrong, but I think this is what you're looking for: ``` doSomethingFirst(); var hid = document.getElementById('<%= HidingField.ClientID %>'); doSomethingElse(hid); ``` I assuming your intent is to get a reference to the DOM element represen...
28,592,077
> > HTTP/1.1 has served the Web well for more than fifteen years, but its > age is starting to show. > > > Can anybody explain what is the **main difference** between HTTP 1.1 and 2.0? Is there any change in the transport protocol?
2015/02/18
[ "https://Stackoverflow.com/questions/28592077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
HTTP/2 supports queries multiplexing, headers compression, priority and more intelligent packet streaming management. This results in reduced latency and accelerates content download on modern web pages. [More details here.](https://daniel.haxx.se/http2/)
33,910,676
Problem ======= On one Form I have a Multilist where each item has a "name" and an "ID number". I'd like my app to do the following: After I select an item, it will go to the "profile" screen and then it will display all the information about that person, based on the "ID number" that I will get from the Storage. Qu...
2015/11/25
[ "https://Stackoverflow.com/questions/33910676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5602982/" ]
I will suggest you use a MultiButton instead of Multilist, then you can add actionEvent to individual element. You can save individual element into static variables in the actionEvent and use it in the before show of your profile form. For example: Declare this globally: ``` private static String UserName = ""; ```...
50,314
I wanna set 4 different wallpapers in my 4 workspaces by setting in CCMS (wallpaper plugin). It just only work if show\_desktop (gconf-editor->apps/nautilus/preference) is unchecked. But after that I can not right-click on my desktop anymore. Is it possible to make wallpaper-plugin work without "disable" my desktop?
2011/06/24
[ "https://askubuntu.com/questions/50314", "https://askubuntu.com", "https://askubuntu.com/users/20503/" ]
No. And to make it possible to save my answer ("no" is a bit short) this a possible workaround that changes your actions to open a file on the desktop from 1 move with the mouse and 1 click on an icon to 2 clicks on icons and 1 mouse move: You need to use places>desktop to get to your desktop icons. So you can add i...
6,375,516
Ignore the .bat extensions, just a habit from the old dos batch file days. I have 2 simple shell scripts. I want to pass a filename with spaces (some file with spaces.ext) from little.bat to big.bat, as you can see below. It won't let me put the filename in single or double quotes. First one called little.bat: ``` ....
2011/06/16
[ "https://Stackoverflow.com/questions/6375516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/710624/" ]
Escape spaces with another sed command. you can fine details about the idea here: [Escape a string for a sed replace pattern](https://stackoverflow.com/questions/407523/bash-escape-a-string-for-sed-search-pattern)
75,925
I implemented an application run on Raspberry Pi 3 using Android Things. This application will be able to play `rtsp` video and output to screen via HDMI port. But the audio is not working with jack 3.5mm. Below is my code: ``` public class MainActivity extends AppCompatActivity { @Override protected void onC...
2017/12/01
[ "https://raspberrypi.stackexchange.com/questions/75925", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/77116/" ]
The problem is that if you connect the hdmi first, it will use the hdmi as the audio output. Try connecting the audio jack first. This solved it for me.
60,336,447
I have custom hash function for unordered\_set of vectors< int >: ``` struct VectorHash { int operator()(const vector<int> &V) const { int hsh=V[0] + V[1]; return hash<int>()(hsh); }}; ``` And for two such vectors I have the same hash equal 3: ``` vector<int> v1{2,1}; vector<int> v2{1,2}; ``` But when I ...
2020/02/21
[ "https://Stackoverflow.com/questions/60336447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12937832/" ]
Hash isn't everything, what you're seeing here, is a collision. Both `std::vector<int>` have the same hash value here, but after hash is calculated, `std::unordered_map` will actually actually check for equality of elements using `operator==` to check for equality of elements, which fails in this case, and fails to fi...
38,990,345
I hava a javaagent Jar `simpleAgent.jar`. I used it to redifine classes in it and I cached some classes to avoid redifine ``` public class Premain { private static Instrumentation instrumentation; private static final Map<String, Class> allLoadClassesMap = new ConcurrentHashMap<>(); public static void ...
2016/08/17
[ "https://Stackoverflow.com/questions/38990345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6704318/" ]
Each JVM instance is separate and does not "know" about other JVMs unless you do something in application level. So, generally the answer is "yes, you can use the same jar either javaagent or not for as many JVM instances as you want."
71,906,448
I need to hide or to make some field completely hidden in some field in the item class. i have tried using jquery, javascript and html but the result is not too good. ``` <div class="item"> <label for="id_mobile_number">Mobile number:</label>: <input type="text" name="mobile_number" maxlength="12" requ...
2022/04/18
[ "https://Stackoverflow.com/questions/71906448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18375924/" ]
You can hide siblings: ```css [for="id_user"], [for="id_user"] ~ * /* hide siblings */ { position: absolute; display: none } [for="id_idplan"], [for="id_idplan"] ~ * /* hide siblings */ { position: absolute; display: none } ``` ```html <div class="item"> <label for="id_mobile_number">Mobile number:<...
31,451,935
While writing interface in java 8 i noticed behavior that i was able to define method in interface without any compile time error. ``` public interface AdvanceMediaPlayer { public static void playVlc(String fileName) { System.out.println("play VLC"); } public abstract void playMp4(String fileName);...
2015/07/16
[ "https://Stackoverflow.com/questions/31451935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2828006/" ]
Java8 provides the ability to create default method implementations: <https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html>
308,829
I have often heard developers mention that Java can't "*do [Real Time](https://en.wikipedia.org/wiki/Real-time_computing)*", meaning a Java app running on Linux cannot meet the requirements of a deterministic real-time system, such as something running on RIOT-OS, etc. I am trying to understand *why*. My [SWAG](https:...
2016/01/30
[ "https://softwareengineering.stackexchange.com/questions/308829", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/154753/" ]
A software is real time not when it is as fast as possible, but when it is guaranteed that a process completes within some determined time slot. In a soft real time system, it is good but not absolutely necessary that this is guaranteed. E.g. in a game, the calculations necessary for a frame should complete within the ...
25,937,168
I use a `entity` form type to provide a list of `Position` entities in a form. I use it often enough (each with the same "setup" code to customize it) that I've decided to make a custom form type from it for better re-use. Here's the current form type: ``` class PositionType extends AbstractType { private $om; ...
2014/09/19
[ "https://Stackoverflow.com/questions/25937168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/899199/" ]
This is fairly easy to achieve. You can build an option that depends on another option. [OptionResolver Component - Default Values that Depend on another Option](http://symfony.com/doc/current/components/options_resolver.html#default-values-that-depend-on-another-option) Basically you will do: ``` $resolver ->se...
29,456,031
I am running a simple client-server program written in python, on my android phone using QPython and QPython3. I need to pass some commandline parameters. How do I do that?
2015/04/05
[ "https://Stackoverflow.com/questions/29456031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3211321/" ]
I found a couple of way of running a script that I imported from my Linux laptop. If I put `frets.py` in the `script3` directory, and create this script in the same directory: ``` import sys, os dir = '/storage/emulated/0/com.hipipal.qpyplus/scripts3/' os.chdir(dir) def callfrets(val): os.system(sys.execu...
627,158
$$\nabla \times A = B$$ $A$ is vector magnetic potential, $\mathrm{Wb/m}$ $B$ is magnetic field intensity, $\mathrm{Wb/m^2}$ **Where does one more m come from for $B$?** *Is that from the gradient operator so it is in meter or something?*
2021/04/05
[ "https://physics.stackexchange.com/questions/627158", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/271720/" ]
It's kind of a funny misconception that the sun is yellow. I mean, astronomically speaking it is indeed a *yellow star*, more precisely [G-type main sequence / yellow dwarf](https://en.wikipedia.org/wiki/G-type_main-sequence_star)... but don't be fooled by the terminology: astronomically speaking, you'll also find that...
19,249,756
I have the regular wordpress code to display category description: ``` <?php echo category_description( $category_id ); ?> ``` But how can i display Woocommerce category description? @@ After one of the comment suggestion i added: ``` <?php if ( have_posts() ) { while ( have_posts()...
2013/10/08
[ "https://Stackoverflow.com/questions/19249756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/713576/" ]
``` $args = array( 'taxonomy' => 'product_cat' ); $terms = get_terms('product_cat', $args); $count = count($terms); if ($count > 0) { foreach ($terms as $term) { echo $term->description; } } ``` Edit for Last answer: ``` <?php global $post; $args = array( 'taxonomy' => 'product_cat' ); $terms =...
73,573,550
The react docs boldly state that hooks shall only be called inside **"React functions"**: <https://reactjs.org/docs/hooks-rules.html#only-call-hooks-from-react-functions> "Don’t call Hooks from **regular JavaScript** functions." That raises the question what *precisely* distinguishes a React function from a regular ...
2022/09/01
[ "https://Stackoverflow.com/questions/73573550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/857848/" ]
Whether the function is a component or not comes down to how you will use the function. Do you plan to render it as a JSX element, eg: `<f1 />`? If so, it's a react component and it can use hooks (though you will need to rename it to uppercase, as in `<F1 />`). During the render process, react will call your function, ...
42,789,183
I have and angular service that I want to test. In one of his methods I am using $http of angular service. I am simply want to mock that function (to be more specific mock $http.post function) that would return whatever I want and inject this mock to my service test. I am tried to find solution and I found $httpBacken...
2017/03/14
[ "https://Stackoverflow.com/questions/42789183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6848513/" ]
From the docs > > **pluginManagement**: is an element that is seen along side plugins. > Plugin Management contains plugin elements in much the same way, > except that rather than configuring plugin information for this > particular project build, it is intended to configure project builds > that inherit from th...
48,275,998
How C++ handles cout of negative value of signed char? Is the behavour defined in C++11 standard? I am using MinGW C++ 11 compiler. It looks the signed value is converted to unsigned type by adding 256 and then prints extended ASCII characters. ``` signed char a=-35; std::cout<<a; ```
2018/01/16
[ "https://Stackoverflow.com/questions/48275998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6446479/" ]
According to [this](http://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2), the following overload is selected: ``` template< class Traits > basic_ostream<char,Traits>& operator<<( basic_ostream<char,Traits>& os, signed char ch ); ``` And since `signed char` is not ...
22,599,917
I am using jQuery File Upload plugin (<http://blueimp.github.io/jQuery-File-Upload/>) for image upload for my website. I am trying to disable `UploadHandler.php` from generating thumbnail image on the server. After some searching, I found this: <https://github.com/blueimp/jQuery-File-Upload/issues/2223> My Code: ``` ...
2014/03/24
[ "https://Stackoverflow.com/questions/22599917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1995781/" ]
The default `index.php` file should look like following. `error_reporting(E_ALL | E_STRICT); require('UploadHandler.php'); $upload_handler = new UploadHandler();` --- In your **`index.php`** file **before** the following function call `$upload_handler = new UploadHandler();` add the following code... ``` $options...
72,097,711
I searched a lot and there are several questions like this however most of them do not have any answer or are not relevant to me. I'm using TypeORM(v0.2.45) with Postgres driver and my entities/schemas are working fine with `synchronize` mode enabled. My goal is to reverse generate migrations from the existing entiti...
2022/05/03
[ "https://Stackoverflow.com/questions/72097711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8108312/" ]
Late to the party but maybe it will help someone else. TypeOrm compares your entities schema to the database schema for any changes. If not changes between the two are found, it will not create a new migration. Because you are using `sync: true`, you DB is already up to date with your orm code so no migration is gener...
433,009
I can't seem to be able to type in a password so that I may acquire access to #apt-get. I'm looking to update my system via terminal, but typing out my password does no good to get me into su, as the spaces stay blank, and what I know is the password won't go through. Has anyone else had this issue?
2014/03/12
[ "https://askubuntu.com/questions/433009", "https://askubuntu.com", "https://askubuntu.com/users/257348/" ]
This answer has screenshots for Gnome-Shell (Ubuntu Gnome 13.10). I suppose it will be similar for standard Unity, but if not, please chime in. First of all (and this is the most common problem), **to have AltGr working you need a keyboard layout which uses it**. For example, this is my keyboard layout (Settings -> R...
33,610,111
I caņ't seem to get around this error message: ExecuteNonQuery: Connection property has not been initialized It refers to a `cmd.ExecuteNonQuery();` I'm not really sure what is going on, maybe the insert is not correct, but here is my code: ``` using System; using System.Collections.Generic; using System.ComponentMod...
2015/11/09
[ "https://Stackoverflow.com/questions/33610111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3816142/" ]
Using a service can be a good option if you want the downloads to continue even if the user exits. Images that are stored in directories created using `getExternalStorageDirectory()` are automatically deleted when your app is uninstalled. Moreover you can check if the internal memory is large enough to store images. If...
36,252,233
I made One Class for executing hibernate select operations my code is working fine but i just need some help I am passing hibernate select query from some other class to get the result if my select query contains more than one column than I call the method getListbylimit(String query,int limit) its returns List but wh...
2016/03/27
[ "https://Stackoverflow.com/questions/36252233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5194837/" ]
Here is a general implementation using a helper class for finding the lowest X integers. With three columns, three instances of the helper class is created, and the data is then iterated to collect the 3 lowest values for each column. The advantages of this code are: * Only retains the lowest X values * Does not nee...
44,426,498
When i setup static resources like js,css,templates on my web server, i forget to set cache period for them. by default web server set it "cache forever" (this is tomcat server and spring mvc) ``` <mvc:resources mapping="/resources/**" location="/resources/" /> ``` if dont specify `cache-period` then server will sen...
2017/06/08
[ "https://Stackoverflow.com/questions/44426498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4760059/" ]
You can append a version number to the URL ``` http://mydomin.com/resources/file.css?version=1 ``` For example; ``` <html> <head> <link href="resources/file.css?version=1" type="text/css" rel="stylesheet"/> <head> <body></body> </html> ```
35,631,454
I have set up new relic in azure (Web Sites > My App > Configuration > Monitoring Tools > Custom) and I have also installed the NuGet package: **NewRelic.Azure.Websites**. Then I changed my web config app settings to this: ``` <add key="NewRelic.AppName" value="My Website" /> ``` and in the new relic config file, I ...
2016/02/25
[ "https://Stackoverflow.com/questions/35631454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1303170/" ]
Did you add the Application Settings according to the [NewRelic documentation](https://docs.newrelic.com/docs/agents/net-agent/azure-installation/azure-web-apps)? [![enter image description here](https://i.stack.imgur.com/IECCD.png)](https://i.stack.imgur.com/IECCD.png) Remember that if you are using **ASPNet 5 /Core...
27,450,369
I have the following homework assignment: > > Add a new method `retrieveAt` for the class `IntSLList` that takes an integer index position as a parameter. > > > The method returns the info inside the node at the index position. The index of the first node is 0. If the list is empty or the index is invalid, then dis...
2014/12/12
[ "https://Stackoverflow.com/questions/27450369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4238558/" ]
`Received:` headers are timestamped: ``` Received: from lb-ex1.int.icgroup.com (localhost [127.0.0.1]) by lb-ex1.localdomain (Postfix) with ESMTP id D6BDB1E26393 for <hd1@example.com>; Fri, 12 Dec 2014 12:09:24 -0500 (EST) ``` So, do `messageInstance.get_all()` and [sort](https://wiki.python.org/moin/HowTo/Sorting) ...
30,251,819
I am developing a project using primefaces. **Code:** ``` <p:panel id="accountPolicyRichPanel"> <h:panelGrid id="outputPanelGrid"> <h:outputText value=""...../> <p:inputText id="InputTextId"/> <p:selectOneMenu id="suspendTypeId" value="..."> <f:selectItems value="#{Account...
2015/05/15
[ "https://Stackoverflow.com/questions/30251819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4513434/" ]
You have a problem and you want to use multi-threading to solve it. Now you have two problems. :) First of all you have to look at a way to decompose your problem into something that can be done in parallel. The way you have decomposed your problem right now is inherently sequential. There is no advantage to multi-thr...
43,836,829
This sounded simple, but I haven't been able to figure it out. Context: a VC tells a view to animate itself and the VC waits the animation to be completed before. I thought about doing something like this: In ViewController: ``` loadingView.animate() ``` In LoadingView (UIView subclass): ``` animate() -> Bool { ...
2017/05/07
[ "https://Stackoverflow.com/questions/43836829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7698127/" ]
My experience with Selenium is limited to some niche cases where I wanted some automation (for scraping I can normally get by with requests and BeautifulSoup) but I believe the reason you are getting **None** is because `execute_script` doesn't return a value to begin with (your script is basically just being injected ...
32,488,101
I want to do an animation that zooms in from a calendar, specifically with the origin and frame size being that of the button that represent's today's date. Here is the code for determining the todayButton inside CalendarMonthView.m: ``` NSDate *date = (weekdayOffset > 0) ? [_monthStartDate dateByAddingTimeInterval:-...
2015/09/09
[ "https://Stackoverflow.com/questions/32488101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5125365/" ]
Use the `transform` feature. // animate in year calendar \_yearCalendarView.hidden = NO; self.curMonthView.monthLabel.hidden = YES; ``` CalendarMonthView *monthView = [CalendarMonthView new]; monthView.delegate = self; CGRect buttonFrame = _currentDayButtonFrame; _yearCalendarView.frame = CGRectMak...
1,474,968
What is the coefficient of $x^9$ in the expansion of $(1+x)(1+x^2)(1+x^3)\cdots (1+x^{100})?$ --- I manually expanded $(1+x)(1+x^2)(1+x^3)...(1+x^{10})$ and calculated the coefficient of $x^9$ as $8$ but i dont know how to solve it without expanding.Please help me.
2015/10/11
[ "https://math.stackexchange.com/questions/1474968", "https://math.stackexchange.com", "https://math.stackexchange.com/users/262197/" ]
The coefficient of $x^9$ is the number of [partitions](https://en.wikipedia.org/wiki/Partition_%28number_theory%29) of $9$ into distinct parts, i.e., the number of ways of writing $9$ as the sum of distinct positive integers when the order of the summands doesn’t matter. The sequence of these numbers is [OEIS A000009](...
7,623
Helo Guys, I want to know your experience about carbon material and grease Can I use normal grease with carbon ? I want to put grease onto fork and stem.... Or WD-40 or silicone penetrant would be ok ? Thank you.... Can I use this one ? ![http://i129.photobucket.com/albums/p231/picture_77/13012012170.jpg](https://i...
2012/01/11
[ "https://bicycles.stackexchange.com/questions/7623", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/3189/" ]
From [Sheldon Brown](http://sheldonbrown.com/gloss_g.html): > > Grease lubrication is commonly used on all ball bearings. Good mechanics also use grease (or oil) on the threads of most threaded fittings and fasteners, and also inside the steerer (to keep the stem from becoming stuck) and the seat tube (to keep the se...
245,522
I have a field name where all the values are capitalized so I used title('string') to get my desired results: ``` 'OLONGAPO CITY' ``` will result to ``` 'Olongapo City'. ``` However, there are strings such as: ``` CITY OF MAKATI ``` I want it to appear as ``` 'City of Makati' ``` instead of ``` 'Cit...
2017/06/27
[ "https://gis.stackexchange.com/questions/245522", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/35246/" ]
You could try using something like the following expression: ``` replace(title("fieldName"), 'Of', 'of') ```
60,862,825
I find the method `public ValueStateDescriptor(String name,TypeInformation<T> typeInfo,T defaultValue)`is now deprecated and the documentation says to manage the default value by checking whether the contents of the state is null. I wonder what does this suggestion for?
2020/03/26
[ "https://Stackoverflow.com/questions/60862825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13110035/" ]
We have discovered that our own proxy were writing Access-Control-Allow-Origin header as well. That's why together with keycloak we got it twice. Our devops team has fixed the code of our proxy and it works now.
16,877,762
**This is a spoiler to task #3 of Project Euler! Don't continue to read, if you want to solve it by yourself.** I am trying to learn Haskell by writing programs for Project Euler. At the moment I'm trying to solve task #3 which asks for the largest prime factor of the number 600851475143. To do this, I create a list ...
2013/06/01
[ "https://Stackoverflow.com/questions/16877762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2068635/" ]
The Problem is the type declaration `primelist :: Int -> [Int]`. It forces Haskell to use native integers, i.e. 32-Bit integers on a 32-Bit platform. However, if you leave it out, Haskell will infer the function type to be `Integer -> [Integer]`. Integers allow computations with arbitrary precision, but are a little bi...
148,291
I need to implement an audit trail for Add/Edit/Delete on my objects,I'm using an ORM (XPO) for defining my objects etc. I implemented an audit trail object that is triggered on 1. OnSaving 2. OnDeleting Of the base object, and I store the changes in Audit-AuditTrail (Mast-Det) table, for field changes. etc. using s...
2008/09/29
[ "https://Stackoverflow.com/questions/148291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Database triggers are the preferred way to go here, if you can. However, recently I had to do this in client-side code and I ended up writing a class that created a deep (value) copy of the object when it was opened for editing, compared the two objects at save time (using ToString() only) and wrote any changes to an ...
5,526,625
I am trying to start from scratch a website that has similar functionality to grubhub.com. Fundamentally, a website where restaurant owners can come on to the website, post their menu and most importantly customers will be able to order instant delivery online which sends an email or something to the restaurant. The ...
2011/04/02
[ "https://Stackoverflow.com/questions/5526625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/689355/" ]
I would use a premade CMS, unless i had a very solid reason not to (they did not have the functionality that i wanted). This would save you LOTS of time. If you are familiar with PHP, MySQL, CSS and the likes, starting should not be such a problem. You first design how you want your program to work, think of the datab...
3,232,098
I am trying to understand a step in the following proof of completeness of $L^p$ in [Stein-Shakarchi's Functional Analysis](http://assets.press.princeton.edu/chapters/s9627.pdf). (See the proof on page 5 of the link or at the end of this post.) At the beginning of the proof, it is said that > > Let $\{f\_n\}\_{n=1}^...
2019/05/19
[ "https://math.stackexchange.com/questions/3232098", "https://math.stackexchange.com", "https://math.stackexchange.com/users/459663/" ]
The authors mention at the beginning of the proof that > > The argument is essentially the same as for $L^1$ (or $L^2$); see Section 2, Chapter 2 and Section 1, Chapter 4 in [Book III](https://press.princeton.edu/titles/8008.html). > > > It is said clearly there (see also a snapshot at the end) that > > The e...
10,564,722
I'm new to PHP, I started about 3 weeks ago. I have a string, which is used with $\_POST to pass it to another page, the second page uses $\_GET to get these url and split it as desired. My problem is that, in my first page I use a String, and I want to encrypt it, so that I can pass it as a plan text. In the second ...
2012/05/12
[ "https://Stackoverflow.com/questions/10564722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1391170/" ]
You're thinking about this wrong. You NEVER trust information coming from the user's side. For example, if your user sends a form that says what item they want, DO NOT include the price in the form. Instead, get the price from the server (database), where it can be trusted.
12,456,578
Hi I have a table with name **test**. it got 7 columns **id , a , b , c , d , e , f.** All this columns contains either 1 or 0. Now i want make a query where i can choose only those columns whose value is 1. Something like this: ``` select (condition) from test where id = 5; ``` because i have a hotel table with ...
2012/09/17
[ "https://Stackoverflow.com/questions/12456578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1529342/" ]
Something like this perhaps? You may want to customize the behavior of the dropdown, but this shows the basic logic of handling the click events and preventing default behaviour (i.e. following links) if the menu isn't open: ``` $(function() { $('#main-menu a').click(function(e) { var listItem = $(this).cl...
34,019,675
As in earlier version of symfony we user to generate a CRUD with the following command ``` $ php app/console generate:doctrine:crud ``` But in symfony 3.0.0 i could not find the app/console, even I tried checking the documentation for the same but was not able to find anything. Link to document <http://symfony.com/...
2015/12/01
[ "https://Stackoverflow.com/questions/34019675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278758/" ]
Use bin/console instead of app/console. However, Symfony 3.0 was just released yesterday. <http://symfony.com/blog/symfony-3-0-0-released>. Most of the core concepts between S2 and S3 are the same but the implementations have changed significantly. For example, the form components work differently. Most of the current...
28,430,749
I have a C++ classe in a .h file like this: ``` #ifndef __GLWidget_h__ #define __GLWidget_h__ class PivotShape { // This is allowed void do_something() { std::cout << "Doing something\n"; } // This is not allowed void do_something_else(); } // This is not allowed void PivotShape::do_something_else()...
2015/02/10
[ "https://Stackoverflow.com/questions/28430749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1993403/" ]
You're breaking the One Definition Rule; defining the function in the header means there's a definition in every translation unit that includes the header, and you're usually only allowed a single definition in the program. Options: * Move the function definition into a source file, so there's just one definition; or...
5,939,578
I would like to use shared memory between several processes, and would like to be able to keep using raw pointers (and stl containers). For this purpose, I am using shared memory mapped at a *fixed address*: ``` segment = new boost::interprocess::managed_shared_memory( boost::interprocess::open_or_create, "M...
2011/05/09
[ "https://Stackoverflow.com/questions/5939578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680410/" ]
This is a hard problem. If you are forking a single program to create children, and only the parent and the children will use the memory segment, just be sure to map it before you fork. The children will automatically inherit the mapping from their parent and there's no need to use a fixed address. If you aren't, then...
49,007,767
I'm trying to exchange messages using multiple covert channels. So, basically, first i need to select the channel that i want to use for communication and then select the "destination\_ip" of the user that i want to chat with and after that the > > processMessage() > > > is called. Now, to move from one channel ...
2018/02/27
[ "https://Stackoverflow.com/questions/49007767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5467365/" ]
Memory access violation happen when you are trying to access to an unitialized variable, in this case the `channelmanager`. I can only see that you initialize `channelmanager` in the `processMessage()` method and you are closing the connection before initializing the `channelmanager` as it happen in: ``` close(destin...
38,262,422
I was learning about constructors, and I came across the `new` keyword. `var obj = new myContructor();` I learnt that it created a new object, set its prototype as `constructor.prototype`, set its properties as according with the `this` keyword, and finally returns that object. Now, I am confused as to where exact...
2016/07/08
[ "https://Stackoverflow.com/questions/38262422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6324230/" ]
> > inside memory or somewhere where it is volatile > > > Yes, of course. Just like any other piece of data in the program. > > do we mean when saying it RETURNS that object > > > You are making a function call. Function calls have return values. The object is the return value of that function call. > > it...
7,209,731
I am writing a program that does some batch processing. The batch elements can be processed independently of each other and we want to minimize overall processing time. So, instead of looping through each element in the batch one at a time, I am using an ExecutorService and submitting Callable objects to it: ``` p...
2011/08/26
[ "https://Stackoverflow.com/questions/7209731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/332893/" ]
I don't think you can do much better than what you are currently doing, but here is an alternative: ``` public BatchElementStatus call() { return callMethod(1); } private callMethod(int methodCounter) { if (cancelled) { doRollback(); return new BatchElementStatus("FAIL"); } switch (metho...
31,111,914
When we use GET method we use ambersand(`&`) sign to send the data to a particular script. I'm sending data to a php script called `myscript.php` by the GET method from a javascript like the following : ``` http.open('GET', 'Myscript.php'+ '?d=' + value1 + '&c=' + value2 + '&f=' + value3); ``` But if the value1 or v...
2015/06/29
[ "https://Stackoverflow.com/questions/31111914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2884663/" ]
You need to encode it properly before putting it into url to turn ampersand to `%26`: * in PHP: `urlencode()` * in javascript: `encodeURIComponent()` You don't need to decode it in PHP, it will decode it for you to `&` character.
69,544,118
I'm working on a solution where I have a SQS queue with Lambda trigger. My understanding is Lambda will receive messages in batches to be processed, and once Lambda function is successful, the messages in the SQS queue is automatically deleted. However, how do I only allow some of those messages to be deleted? Let's a...
2021/10/12
[ "https://Stackoverflow.com/questions/69544118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5186759/" ]
Yes, by default, the Lambda function deletes all the messages upon success. You would need to handle this in your code, but not by changing the visibility timeout of the messages. Add DLQ (dead-letter queue) that will actually handle the failed messages (messages go to DLQ after a certain number of failed attempts to ...
1,542
I have a problem similar in formulation to this post, with a few notable differences: [What simple methods are there for adaptively sampling a 2D function?](https://scicomp.stackexchange.com/questions/923/what-simple-methods-are-there-for-adaptively-sampling-a-2d-function) Like in that post: * I have a $f(x,y)$ and ...
2012/03/06
[ "https://scicomp.stackexchange.com/questions/1542", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/53/" ]
There is a paper in computer graphics called [Provably Good Sampling and Meshing of Surfaces](http://geometrica.saclay.inria.fr/team/Steve.Oudot/papers/bo-pgsms-05/bo-pgsms-05.pdf), which relies on you providing an oracle that determines all the intersections of an isoline with a given line segment. With that, it sampl...
66,659,701
I am trying to create a function compare(lst1,lst2) which compares the each element in a list and returns every common element in a new list and shows percentage of how common it is. All the elements in the list are going to be strings. For example the function should return: ``` lst1 = AAAAABBBBBCCCCCDDDD lst2 = ABCA...
2021/03/16
[ "https://Stackoverflow.com/questions/66659701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15292030/" ]
Your undefined label is because of the `...filtersApplied` ``` if (me.prop('checked') === true) { filtersApplied.push([ //this ...filtersApplied { id: me.attr('id'), data: me.attr('data-filter-label') } ]); ``` Note that filtersApplied is an array and you're making a `push()`, this method inser...
17,416,488
What I want to implement is something like: ``` switch(flag) { case 1: var query=from w in db.someTable select w; break; case 2: query=from w in db.someTable where w.id==someID select w; break; case default:...
2013/07/02
[ "https://Stackoverflow.com/questions/17416488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1526662/" ]
Declaring with `var` lets you shorten the code, but the variable that you declare remains statically typed, and the scope of that variable does not change. If you need to use a variable outside `switch`, declare it before the `switch` statement, like this: ``` IQueryable<SomeType> query = null; switch (...) { cas...
22,544
With the equipment development timelines we know about, what is the soonest date a manned lunar landing could take place?
2017/08/05
[ "https://space.stackexchange.com/questions/22544", "https://space.stackexchange.com", "https://space.stackexchange.com/users/19834/" ]
Elon Musk has stated that it is highly unlikely that the Falcon Heavy will actually make it to orbit on the maiden flight. This is due to the fact that it will be the first time that they can test out how the fuel pumps between the boosters work and also the separation and stage strengthening. Due to this, it is highly...
12,332
Почему в первом случае "к" будет приставкой,а во втором - "-юч" будет суффиксом? **Ключ воды и ключ дверной**
2012/11/15
[ "https://rus.stackexchange.com/questions/12332", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/1038/" ]
Это по каким же эврикам? Ключ - корень в обоих случаях. Фасмер даже допускает общность происхождения. I род. п. -а́ I., сюда же заключи́ть, укр. ключ, ст.-слав. ключь, болг. клю́чът, сербохорв. кљу̑ч, род. п. кљу́ча " крюк, ключ", словен. kljúč, чеш. klíč, слвц. kl᾽úč, польск. klucz, в.-луж. kluč, н.-луж. kluc. Ро...
20,279
Suppose that a Tor client wants to access a certain hidden service. According to the protocol, instead of submitting a request directly to the server IP (which is hidden[1][2]), this client submit a request via a series of relays. However, at some point, there will be a final relay in charge of delivering the client'...
2019/09/12
[ "https://tor.stackexchange.com/questions/20279", "https://tor.stackexchange.com", "https://tor.stackexchange.com/users/27707/" ]
Tor uses TCP tunnels, so - regardless of the previous answer - no need to use it. The hidden service is reached from the Tor node that is hosting it, usually through a localhost. The scenario you've described about IP revealing - yes, it *can* be a privacy problem. The design doc states clear - the system is anonymizin...
16,417,449
I create my own class and I want to use it in my new component but I am getting an error... The code is the following: ``` type TMyClass = class Name: string; Number: double; end; TMyComponent = class(TCustomPanel) private FMyClass: TMyClass; public procedure SetMyClass(aName: string; aNumbe...
2013/05/07
[ "https://Stackoverflow.com/questions/16417449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2338944/" ]
The things that I can see wrong with your code at present are: 1. The property setter must receive a single parameter of the same type as the property, namely `TMyClass`. 2. The property setter must be a member of the class, but you've implemented it as a standalone procedure. 3. A published property needs to have a g...
43,016
I use VMware Fusion created a VM(Linux) in my Mac, but I don't know how to delivery the data from my Mac to the VM. If the VM is on the Windows I can use the WinSCP to load data to it, but how can I load data to VM from Mac? Some friend can recommend me a software to load data to Linux?
2017/06/16
[ "https://softwarerecs.stackexchange.com/questions/43016", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/28348/" ]
I have been using something called [Alpha VNC Lite](https://play.google.com/store/apps/details?id=de.abr.android.avnc). Alpha VNC lite doesn't seem to work on the home screen but most other apps seem to work fine. The device doesn't need to be rooted but you do not to enable a special keyboard and accessibility options...
339,902
Suppose you are implementing a publication database and creating migrations to represent different publications. Each publication has a "year" associated with it. `t.column :year, ???` Would this year be best represented as an integer, date, or datetime?
2008/12/04
[ "https://Stackoverflow.com/questions/339902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39584/" ]
I would recommend just going with Rails conventions and doing a `Date` data type. This way, if you ever *do* need the month and day, you can retrieve it. Plus, it's simple to do: ``` YourModel.date.year # => "1999" ```
11,441,468
New to Eclipse and Solr, I imported apache-solr-3.6.0.war into Eclipse and run Solr with tomcat plugin. Now i want to debug some existing code, however how do i import the Solr source code?
2012/07/11
[ "https://Stackoverflow.com/questions/11441468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962382/" ]
Without knowing how you imported it exactly: sounds like you are looking for [Source attachment](https://stackoverflow.com/questions/122160/is-there-an-easy-way-to-attach-source-in-eclipse). It might be better if you use the [Solr source code](http://apache.mirror.clusters.cc/lucene/solr/3.6.0/) directly. Check the RE...
10,323,548
I am not using a coding language. This has to be straight regex. I need to add a variable length of whitespace between two strings. The string I am passing to the regex has the number of whitespaces in the string itself and will need to be replaced: ``` string1 *27* string2 ``` so I need to insert 27 whitespaces i...
2012/04/25
[ "https://Stackoverflow.com/questions/10323548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/183408/" ]
This is not possible with straight regex. Regex would need some sort of parsing capabilities to use the captured variable and translate it into repeating spaces. The way you want replace to work is not possible, also. As the replace portion of a regex is a straight text replace, and not another regex evaluator....it w...
239,405
As stated from the questions title: **What does 'beta' state of a SE site actually imply?** Could someone elaborate, which restrictions or drawbacks we should expect from a *'beta'* SE site? I could have well been missing something, that's already been answered, or is an easy to find policies concept.
2014/09/15
[ "https://meta.stackexchange.com/questions/239405", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/186472/" ]
Beta sites aren't full sites. They're sites in a "trial" period, to see if they have the potential to become successful sites, or if interest in them wanes and the community dies out. From time to time, the site's community will be asked to [evaluate their site to ensure it is fulfilling its goal](https://meta.stackexc...
47,374,425
On my app, I'm trying to make it so that if a user has a certain condition, he will ALWAYS be redirected to a certain page, no matter which route he tries to access. In this case, it's if he doesn't have a username (long story). **ComposerServiceProvider.php** : ``` public function boot() { View::composer('templa...
2017/11/19
[ "https://Stackoverflow.com/questions/47374425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2280332/" ]
Try this steps: You can use middleware for this scenario like below: 1. Create middleware `php artisan make:middleware CheckPoint` Inside `App\Http\Middleware\CheckPoint.php` File ``` use Closure; class CheckPoint { /** * Handle an incoming request. * * @param \Illu...
44,027,873
Here is my problem: I have a task running a Docker image on Amazon ECS but I would like to make a new Docker image from the running instance of the container. I see the id of the instance on Amazon ECS; I have made an AMI but I would like to make a new docker image that I can pull from Amazon. Any ideas? Regards an...
2017/05/17
[ "https://Stackoverflow.com/questions/44027873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462794/" ]
To create a image from container execute the command below: > > `docker commit container_id imagename` > > >
12,550,086
I came across some threads on StackOverflow but none of them quite cleared my doubts. So the problem is simple. I need to iteratively insert elements into a binary tree. And this is my code. ``` BST newNode(int x) { BSTNodePtr node = (BSTNodePtr) malloc(sizeof(struct TreeNode)); node->Element = x; node->L...
2012/09/23
[ "https://Stackoverflow.com/questions/12550086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1123924/" ]
Couldn't solve the problem that way. This code, however, seems to work. ``` BST Insert(int x, BST T) { BST temp=T; BST node=(BST)malloc(sizeof(struct TreeNode)); node->Element=x; node->Left=NULL; node->Right=NULL; if (T==NULL) { T=node; return(...
2,289,518
> > How to calculate $5^{2003}$ mod $13$ > > > using fermats little theorem 5^13-1 1 mod 13 (5^12)^166+11 mod 13 a+b modn=(a modn + b modn) modn (1+11mod13)mod13 12 mod 13 = 12 why answer is 8 ? how do we calculate this thanks
2017/05/20
[ "https://math.stackexchange.com/questions/2289518", "https://math.stackexchange.com", "https://math.stackexchange.com/users/437586/" ]
All modulo 13, $$5^{2003} \equiv (5^{2})^{1001} (5)$$ $$\equiv (-1)^{1001}(5)$$ $$\equiv -5$$ $$\equiv 8$$
54,736,145
-How can I scale the Y- and X- axis to 0,30 and 0,50 respectively and plot the data point according to the scale? -How do I change the color of groups 1, 2 and 3 to purple, orange and yellow? ``` library(ggplot2) library(plotly) ID <- c("Group 1", "Group 1", "Group 1", "Group 2", "Group 2", "Group 2", "Group 3", "...
2019/02/17
[ "https://Stackoverflow.com/questions/54736145", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9710121/" ]
First, convert the x and y columns to number (they are factors in the data). Then, set the scale limits using scale\_x\_continuous and scale\_y\_continuous. Finally, use scale\_fill\_manual to change the colors (since you have a fourth group, I gave it another color). ``` library(tidyverse) df <- df %>% mutate(x = par...
29,226,198
I'm looking for function that **Open window explorer in C language**. I have found this [answer]**([How can I open Windows Explorer to a certain directory from within a WPF app?](https://stackoverflow.com/questions/1746079/how-can-i-open-windows-explorer-to-a-certain-directory-from-within-a-wpf-app))**, but this is C# ...
2015/03/24
[ "https://Stackoverflow.com/questions/29226198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4427613/" ]
The simplest way to open a certain directory in an explorer (here c:\program files) may be: ``` system("start \"\" \"c:\\program files\""); ```
155,822
I'm having some problems getting my table and caption formatting to look right. Below is a sample of the code from my thesis. I've included all the packages that I'm using in my thesis, so that you can get an idea of what else might be affecting the look of the table. I've also attached a picture of my output. The mai...
2014/01/24
[ "https://tex.stackexchange.com/questions/155822", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/44564/" ]
1. It's enough to load the [`caption`](http://www.ctan.org/pkg/caption) package (you could even set a bigger `skip`, if needed). 2. Redefine `\arraystretch` locally. 3. Build your table and its footnote using the [`ctable`](http://www.ctan.org/pkg/ctable) package. The code: ``` \documentclass[12pt,a4paper]{report} \u...
801,940
I have a parameterized hibernate dao that performs basic crud operations, and when parameterized is used as a delegate to fulfil basic crud operations for a given dao. ``` public class HibernateDao <T, ID extends Serializable> implements GenericDao<T, ID> ``` I want to be able to derive Class from T at runtime to cr...
2009/04/29
[ "https://Stackoverflow.com/questions/801940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49854/" ]
You could have the Class passed as a constructor argument. ``` public class HibernateDao <T, ID extends Serializable> implements GenericDao<T, ID> { private final Class<? extends T> type; public HibernateDao(Class<? extends T> type) { this.type = type; } // .... } ```
58,576,631
I want to learn to create a wrapper around a program in linux. How does one do this? A tutorial reference web-page/link or example will do. To clarify what I want to learn, I will explain with an example. I use **vim** for editing text files. And use **rcs** as my simple revision control system. **rcs** allows you to ...
2019/10/27
[ "https://Stackoverflow.com/questions/58576631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4567351/" ]
There are a few missing dependencies in your `create-react-app` project. This probably happened because you tried to export the project from codesandbox (I'm not sure though) You have to fix those first. **Dependency 1** (`react-scripts`): ``` npm install react-scripts --save-dev ``` **Dependency 2** (`node-sass` ...
63,452,974
I am trying to install Pylucene on my WSL Ubuntu 20.04 clean installation. I tried to follow tutorial on [the official page but it looks outdated](https://lucene.apache.org/pylucene/install.html). So I was wondering if anyone here managed to make it work on Ubuntu 20.04 and python 3.8.2 The commands I run: ``` sudo a...
2020/08/17
[ "https://Stackoverflow.com/questions/63452974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5594539/" ]
Here are the steps that lead to the successful installation of pylucene on Ubuntu 18.04 - this may work for you: 1. Install openjdk-8: `apt install openjdk-8-jre openjdk-8-jdk openjdk-8-doc` Ensure that you have ant installed, if you don't run `apt install ant`. Note that if you had a different version of openjdk inst...
61,559,348
I am integrating JWT authorization from Cognito into my Nestjs application and I am running into a sort of a chicken vs egg situation. If a generate clientSecret for my Cognito client, I will get the following error: > > "Unable to verify secret hash for client {Client\_Id}" > > > If I uncheck clientScret genera...
2020/05/02
[ "https://Stackoverflow.com/questions/61559348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10603880/" ]
The tutorial you shared let the back-end side handle the user register, sign in, and sign out. I want to delegate the access token getting to AWS Cognito. For a user to request protected resources, the backend side validates the access token passed as a bearer token in two ways: * Use middleware: <https://github.com/...
24,491,420
Is there any difference between these 2 quesries? This is from test and one asnwer is right and accordingly another wrong. For me, both are valid and similar. ``` B. SELECT Cust_No, Cust_Name, Emp_Name, Emp_Loc FROM Customers, Employees WHERE Customers.Sales_Rep_No = Employees.Sales_Rep_No; C. SELECT Cust_No, Cust_Na...
2014/06/30
[ "https://Stackoverflow.com/questions/24491420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2705336/" ]
Yes, they differ in their `WHERE`-clauses, but everything else (the Tables joined, the columns retrieved, is the same, and they also should really produce the same result): `WHERE Customers.Sales_Rep_No = Employees.Sales_Rep_No;` `WHERE Employees.Sales_Rep_No = Customers.Sales_Rep_No;`
18,753
My attendant and I met a year ago and had intercourse back then, we recently picked back up where we left off, but want to go about it the right way and get married. Is there a time frame that we have to be apart from each other sexually and not sexual before marriage? What is needed to be done for our marriage to be...
2014/11/25
[ "https://islam.stackexchange.com/questions/18753", "https://islam.stackexchange.com", "https://islam.stackexchange.com/users/9208/" ]
There's no time frame, but both of you must repent to Allah(SWT) and never commit that sin again. You and your potential cannot be alone together privately anywhere and at anytime. You must restrain your looks at each other. You must have a **Wali** involved to go about your business with him. You must be covered ...
102,339
I want to buy the full version of Minecraft, but I'm one of those creative types. What are some of the differences in Creative mode in the full version of Minecraft?
2013/01/22
[ "https://gaming.stackexchange.com/questions/102339", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/41294/" ]
From [the wiki](http://www.minecraftwiki.net/wiki/Classic#Advantages_of_purchasing) about the classic version: > > Advantages of purchasing > > > Although this mode is free to the public, there are several advantages > made available to those who have purchased the game. Some of them are > the ability to: > > ...
9,119,233
How can I initialize a val that is to be used in another scope? In the example below, I am forced to make `myOptimizedList` as a var, since it is initialized in the `if (iteration == 5){}` scope and used in the `if (iteration > 5){}` scope. ``` val myList:A = List(...) var myOptimizedList:A = null for (iteration <- ...
2012/02/02
[ "https://Stackoverflow.com/questions/9119233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/750995/" ]
Seems that you have taken this code example out of the context, so this solution can be not very suitable for your real context, but you can use `foldLeft` in order to simplify it: ``` val myOptimizedList = (1 to 100).foldLeft (myList) { case (list, 5) => optimize(list) case (list, _) => process(list); list } ...
1,320,991
My textbook says: Suppose that $E$ is a convex region in the plane bounded by a curve $C$. [Where a convex region is defined as for all $x, y \in E, sx + ty \in E$ where $0 \le s, t \le 1$ and $s + t = 1$.] Show that $C$ has a tangent line except at a countable number of points. So my thinking is roughly that points w...
2015/06/11
[ "https://math.stackexchange.com/questions/1320991", "https://math.stackexchange.com", "https://math.stackexchange.com/users/204420/" ]
Line segments from $(n,n^2)$ to $((n+1),(n+1)^2)$ for each integer $n$ you should draw. A nice and simple convex region you will get.
70,811,590
Let's say we have the following table: ``` city gender abc m abc f def m ``` Required output: --- ``` city f_count m_count abc 1 1 def 0 1 ``` Please help me in writing a query either in Hive or MySQL or SQL Server syntax. Hive syntax is needed for me. Thank You:)
2022/01/22
[ "https://Stackoverflow.com/questions/70811590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13345717/" ]
Try: ``` select city,sum(gender='f') as f_count,sum(gender='m') as m_count from my_table group by city; ``` > > Result: > > > > ``` > city f_count m_count > abc 1 1 > def 0 1 > > ``` > > [Demo](https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=e9e64e17c116766877f1ba802492fac3)
57,887,300
My Github repo won't update after `git push -u origin master` command! It says: ``` Branch 'master' set up to track remote branch 'master' from 'origin'. Everything up-to-date ``` The result for `git remote show origin` is: ``` * remote origin Fetch URL: git@github.com:MyGithubID/RepoName.git Push URL: git@git...
2019/09/11
[ "https://Stackoverflow.com/questions/57887300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522214/" ]
You have only staged the file for commit, but not actually committed the change. You have to commit the change to get a commit-id which is then used during the push/pull phase. ``` git commit ``` With `git`, committing a change is a two step process. The first step is to add your change(s) to a so called staging ar...
37,711
Comme l'on lit dans cette **excellente réponse** [Quand peut-on mettre un adjectif avant ou après un nom ? — When do adjectives go before or after a noun?](https://french.stackexchange.com/questions/319/quand-peut-on-mettre-un-adjectif-avant-ou-apr%c3%a8s-un-nom-when-do-adjectives-go/323#323) > > La place de l'épithè...
2019/08/01
[ "https://french.stackexchange.com/questions/37711", "https://french.stackexchange.com", "https://french.stackexchange.com/users/16020/" ]
Si on trouve ***excellent*** plutôt avant le nom ça tient au sens même de cet adjectif. L'adjectif exprimant un jugement, un réaction subjective, affective se place avant le nom. (Grevisse §398 10e édition, qui renvoie à l'article de Marouzeau « Encore la place de l'adjectif » dans *Le Français Moderne*, oct. 1953, [p....
69,299,965
I don't know how to describe them, so here is a screenshot [![enter image description here](https://i.stack.imgur.com/BZKHP.png)](https://i.stack.imgur.com/BZKHP.png)
2021/09/23
[ "https://Stackoverflow.com/questions/69299965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This is one method using css pseudo elements `:before` and `:after`. I used the Horizontal bar Unicode character ― in the css `content:` declaration. ```css div:before { content: "― "; } div:after { content: " ―"; } ``` ```html <div>TEST</div> ```
69,938,288
I have a Vuetify treeview setup in a NuxtJS app like so: ```html <v-treeview open-all color="white" class="info-pool" :load-children="loadChildren" :search="search" :filter="filter" :items="items"> <template slot="label" slot-scope="{ item }"> <a @click="CHANGE_INFO_TOPIC(item)" style="text-...
2021/11/12
[ "https://Stackoverflow.com/questions/69938288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10029354/" ]
try this Navigator.popUntil(context, ModalRoute.withName('/c')); or you can simply pop 3 times like Navigator.of(context)..pop()..pop()..pop();
27,871,573
Im developing a WCF web service with receives always and only XML. So i need to validate that input XML using their XSD. The question is, can i save them inside web service? Locally i can access XSD files via relative path into IIS Express root folder which i created manually. I tried add the XSD files in VS project b...
2015/01/10
[ "https://Stackoverflow.com/questions/27871573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3542287/" ]
Files that belong to your solution should be **physically** part of it. Once that is the case you can use for instance [`HostingEnvironment.MapPath`](http://msdn.microsoft.com/en-us/library/system.web.hosting.hostingenvironment.mappath%28v=vs.110%29.aspx); or look at the answers to [this question](https://stackoverflow...
9,709,688
Heya I get this error message. I've been looking everywhere but I dont know how to fix it? Im a beginner so I'm really confued. Thanks in advance Notice: Undefined index: cart in /nas/students/j/j39-green/unix/public\_html/ISD5/inc/functions.inc.php on line 3 You have no items in your shopping cart ``` <?php functio...
2012/03/14
[ "https://Stackoverflow.com/questions/9709688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269822/" ]
If `$_SESSION['cart']` isn't set, it throws that warning. Try: ``` $cart = isset($_SESSION['cart'])?$_SESSION['cart']:false; ```
200,627
I'm using `standalone` document class and trying to draw a TikZ picture. The picture have border which is the border of the page. I do it [like this](http://papeeria.com/p/c6949888bcd012d5fcc4ca5bd8ba79a9#/without-fontspec.tex): ``` \documentclass{standalone} \usepackage{tikz} \def\W{220} \def\H{250} \begin{document...
2014/09/11
[ "https://tex.stackexchange.com/questions/200627", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/27682/" ]
I see the effect with TexLive 2013, but not with 2014 and miktex. So you will probably have to update something (fontspec?). The effect disappears if I add `\unskip` after `\begin{document}`. So it looks like an spurious space somewhere.
39,065,933
First and foremost, this is my 1st time writing PHP code, so please forgive my newbie'isms. I have a login form with 3 submit buttons (post method) named login, register and forgot. If I select login button, the login function in the PHP code gets called, however, the same is not true for the register and forgot butt...
2016/08/21
[ "https://Stackoverflow.com/questions/39065933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3254596/" ]
HTML forms can not contain more than one input of type "submit" (which means others would not be functioning) **register** and **forgot** are links rather than buttons. Instead you could use: ``` <a href="/register.php">Register</a> ``` Another alternative is to use javascript to make these buttons act as links.
7,873,972
I'm rewriting/converting some VB-Code: ``` Dim dt As New System.Data.DataTable() Dim dr As System.Data.DataRow = dt.NewRow() Dim item = dr.Item("myItem") ``` C#: ``` System.Data.DataTable dt = new System.Data.DataTable(); System.Data.DataRow dr = dt.NewRow(); var item = dr.Item["myItem"]; ``` I can't make it run ...
2011/10/24
[ "https://Stackoverflow.com/questions/7873972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/598516/" ]
Try like this: ``` var item = dr["myItem"]; ``` In C# you can access the [indexer property](http://msdn.microsoft.com/en-us/library/2549tw02.aspx) directly. And the [DataRow.Item](http://msdn.microsoft.com/en-us/library/system.data.datarow.item.aspx) property is defined as indexer.
29,014
There is an existing light fixture and switch for the light fixture. I want to add a bath fan with its own switch. What is the easiest way?
2013/06/24
[ "https://diy.stackexchange.com/questions/29014", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/13644/" ]
If you're not comfortable working with electricity then hire a professional. Improper wiring and the resulting fire isn't worth saving a few bucks. That said: Your existing fan/light combo is likely connected using a 2-conductor cable (like 14-2)... but for two separately switched circuits you'll need three conductor...
10,373,163
There a search service (PHP) which sends search query via POST. I would like to use that search engine in my app. The PHP service does not have a public API. Is there a way to enter search query and to fetch a POST request to see the name of parameters? I would use then later to send a POST requests from my app and to...
2012/04/29
[ "https://Stackoverflow.com/questions/10373163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/437039/" ]
Have you tried viewing the source on the search form to get the POST parameters? i.e. the name of the input box **Edit** take for example the php form on tizag site ``` <html><body> <h4>Tizag Art Supply Order Form</h4> <form action="process.php" method="post"> <select name="item"> <option>Paint</option> <option>Bru...
1,520,525
I tried to answer the following question: Let $G$ be a finite Abelian group and $a,b \in G$. Let $$ \langle a,b \rangle = \{a^i b^j \mid i,j \in \mathbb Z \}$$ What can we say about $|\langle a,b \rangle|$ in terms of $|a|,|b|$? My answer: $|\langle a,b \rangle| = lcm(|a|,|b|)$. But it's not so clear to me how t...
2015/11/09
[ "https://math.stackexchange.com/questions/1520525", "https://math.stackexchange.com", "https://math.stackexchange.com/users/180995/" ]
We can say $|\langle a,b\rangle|$ is a divisor of $|a|.|b|$ and divisible by $|a|$ and $|b|$. Consider the group $\mathbb{Z}\_4\times \mathbb{Z}\_2.$ Consider $a=(1,0)$ and $b=(1,1)$. Then $|\langle a,b\rangle|=|G|=8$ and is not the lcm of the orders of $a$ and $b$ (which are $4$ for both). We can say this: since $G...
377,443
I was adventuring, and reset my spawn by accident, by interacting with a bed in a random village. I never wrote down the coordinates or followed a compass so I’m completely lost. I worked really hard, and since I’m on a Nintendo switch it’s confusing with what everyone’s saying? How do I get back home? Is there any co...
2020/11/02
[ "https://gaming.stackexchange.com/questions/377443", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/260711/" ]
There are a few ways you may be able to get back home. The simplest is to craft a compass which will point you to the world spawn. It's unclear from your post whether you used commands to change the spawn point to a village, or used a bed, but assuming you just used a bed then the compass would point you towards 0,0 w...
42,638,440
I am having a hard time getting javascript to work without reloading a page. I believe the problem has to do with turbo links. I am setting an onsubmit listener to a form like this ``` <%= form_for @cart, url: cart_path, html: {onsubmit: "addCart(event, #{@product.id})"} do |c| %> ``` I am then submitting the form...
2017/03/07
[ "https://Stackoverflow.com/questions/42638440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599104/" ]
This could be a turbolinks issue. In your javascript file, surround your javascript code with ``` $(document).on('turbolinks:load', function() { // your code }); ```
30,191,851
I am trying to figure out if Python/Numpy is a viable alternative to develop my numerical software which is already available in C++. In order to get performance in Python/Numpy, one need to "vectorize" the code. But it turns out that as soon as I move away from very simple examples, I struggle to vectorize the code (I...
2015/05/12
[ "https://Stackoverflow.com/questions/30191851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3763545/" ]
You can do step 1. with numpy efficiently: ``` 1.0 + np.arange(n + 1) / n ``` however I think you would need the np.vectorize() method to feed back x into your calculated values and it's not an efficient function (basically a wrapper for a python loop). If you can use scipy then there are built in methods that might...
40,381,697
Suppose that we perform DFS on this graph by obeying the following rules: • Start from vertex 1. • At every vertex, process its out-neighbors in ascending order of id. • Whenever we need to restart, do it from the white vertex with the smallest id Show the resulting DFS forest. Furthermore, for every vertex, indica...
2016/11/02
[ "https://Stackoverflow.com/questions/40381697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6821180/" ]
You need an `except` clause to use `else`: > > The `try ... except` statement has an optional `else` clause, which, when > present, must **follow** all `except` clauses > [*Emphasis mine*] > > >