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
345,274
The main drawback in Rutherford's model of the atom as pointed out by Niels Bohr was that according to Maxwell's equations, a revolving charge experiences a centripetal acceleration hence it must radiate energy continuously as a result of which its kinetic energy is reduced and it eventually should fall into the nucleu...
2017/07/12
[ "https://physics.stackexchange.com/questions/345274", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/78611/" ]
In classical electromagnetism, accelerated charges radiate. But the solar system is not held together by electromagnetic forces: it's held together by gravitation. In Newtonian gravity, accelerated objects do not radiate: indeed there is no wavelike solution in Newtonian gravity at all. So to the extent that Newtonian ...
As you said, charged objects produce electromagnetic radiation as they accelerate, and electrons can't have classical-style orbits for this reason. In contrast, the bodies in the solar system don't have very much net charge, so they don't generate very much electromagnetic radiation as they orbit.
14,385,292
I have the following /etc/hosts file ``` [root@vhost41 tmp]# cat hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 119.13.248.1 ccvcds1.ihost.com vcds1 171.221.160.11 vhost.ihost.com vhost41 [root@vhost41...
2013/01/17
[ "https://Stackoverflow.com/questions/14385292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1988058/" ]
``` sed -i "/$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | cut -d' ' -f1)[ \t]/ s/$/ AWHOST/ " hosts ```
you can use `sed` to to this as such : ``` $ cat /etc/hosts 127.0.0.1 localhost 171.1.1.1 myhost $ sudo sed -i 's/\(171\.1\.1\.1\).*/&\ mynewhost/g' /etc/hosts $ cat /etc/hosts 127.0.0.1 localhost 171.1.1.1 myhost mynewhost ``` The ampersand `&` will be replaced by the caught expression e.g. here `171...
9,943,789
I just want to make a button using a RelativeLayout, so I can have as many drawables or textfields inside, and I want all the children to change color or drawable accordlingly to the RelativeLayout state. If I press the custom button, it must have the correct colors and drawables. Here is some code (only one TextView...
2012/03/30
[ "https://Stackoverflow.com/questions/9943789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1116427/" ]
A little known feature of the `DataGridView` is the ability to programmatically select some or all of the DataGridCells, and send them to a `DataObject` using the method `DataGridView.GetClipboardContent()`. Whats the advantage of this then? A `DataObject` doesn't just store an object, but rather the representation o...
I think this is the correct for your SaveToCSV function : ( otherwise Null ...) ``` for (int i = 0; i < columnCount; i++) ``` Not : ``` for (int i = 1; (i - 1) < DGV.RowCount; i++) ```
8,358,261
I have a set of integration test written in C# and NUnit and I want to run them in parallel on a build-machine. How do I do that? In a similar [question](https://stackoverflow.com/questions/3313163/how-can-i-run-nunit-tests-in-parallel) the accepted solution was: * Create your own test runner * Move to MBUnit There i...
2011/12/02
[ "https://Stackoverflow.com/questions/8358261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706456/" ]
Starting with version 3, the NUnit framework itself supports parallel test execution. You may choose whether you want parallelism to be at test case level or fixture level. More details are on [NUnit3 wiki at GitHub](https://github.com/nunit/docs/wiki/Parallel-Test-Execution)
What had good expieriences with a tool called ALPACA (see [homepage](http://ppcp.codeplex.com)). This analyzes the code and gives hints for data races and deadlocks. It's not perfect, but was very helpful.
56,559
Testing my contract locally with truffle. I have a function with the signature: ``` function purchase(address buyer, address seller, bytes16 bookId, uint tokens) public onlyOwner returns(bool success) ``` In truffle console I call this function as: ``` BookStore.deployed().then(function(instance){return instance....
2018/08/15
[ "https://ethereum.stackexchange.com/questions/56559", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/37258/" ]
OK, so I figured it out. I was misled by Redux DevTools that made me think that the action was not dispatched because when I filtered on the action's name, I didn't see anything. But apparently, the action was dispatched, but not picked up by Saga because there was a mistake in my initialization there: ``` export defa...
Your connect implementation is fine. Drizzle accepts mapDispatchToProps as you've implemented it here. (See the [source here](https://github.com/trufflesuite/drizzle-react/blob/master/src/drizzleConnect.js), if interested.) It looks to me like you've got a simple import error. You're exporting the action creator direct...
13,511,502
This is different from other "can I check the type of a block" posts on SO, as far as I can tell anyway. I want to know if, given a block object of unknown signature, I can learn what arguments it accepts prior to invoking? I have a situation where I have a number of callbacks associated with objects in a dictionary....
2012/11/22
[ "https://Stackoverflow.com/questions/13511502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/244374/" ]
Frankly, if the callbacks have different types, they should be under different keys. Why not use the keys `@"callbackWithOneParam"` and `@"callbackWithTwoParams"`? To me, that's superior to having a generic "callback" key plus a separate "type" key to tell you how to interpret the callback. But what this really calls ...
Personally, I use the ingenious [CTBlockDescription](https://github.com/ebf/CTObjectiveCRuntimeAdditions/blob/master/CTObjectiveCRuntimeAdditions/CTObjectiveCRuntimeAdditions/CTBlockDescription.h)... > > CTBlockDescription lets you inspect blocks including arguments and compile time features at runtime. > > > ```...
21,826,503
**TABLE A** ``` ITEM BASE_WT BASE_AMT AAA 50 500 BBB 100 6000 ``` **TABLE B** ``` ITEM OUTDAY WT AMT AAA 20140105 10 100 BBB 20140106 10 600 AAA 20140107 10 100 ``` **TABLE A RESULT** ``` AAA 30 300 BBB 90 5400 ``` **MSSQL QUERY** ``` UPDATE A SET BASE_WT = BASE_WT - X.WT BASE_AMT = BASE_AMT - X.AMT FROM A,...
2014/02/17
[ "https://Stackoverflow.com/questions/21826503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3318607/" ]
You dont have to do much to make what you want. I made a little js fiddle for you to see. HTML: ``` <div id="div1">1</div> <div id="div2">2</div> ``` CSS#: ``` #div1{ height: 40px; width: 100px; float: left; background: blue; } #div2{ height: 40px; background: red; width: 100%; } ``` [...
Try this. ``` #div1{ width:200px; height: 40px; float: left; border: 1px solid black; } #div2{ clear:left; height: 40px; border: 1px solid black; } ``` [**Demo Fiddle**](http://jsfiddle.net/tZfQL/)
30,461,654
I am learning Spring MVC, and am trying to troubleshoot an issue with an `@Autowired` Service object. I have the following annotation: ``` @Autowired private UserServiceBLInt userService; ``` This is within the context of a `Controller` class, and I get a `NullPointerException` when using the `userService` object. N...
2015/05/26
[ "https://Stackoverflow.com/questions/30461654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1154644/" ]
This [tool](https://github.com/khellang/LangVersionFixer) I wrote might help you if you have many projects that you need to set `LangVersion` for.
Right click on Project in Project Explorer and select Properties. When the Properties tab opens select Build and the click the Advance button in bottom right. There is drop-down box called Language Version. Change the select to "C# 5.0"
822
The following is a "digest" version of the [July 2012 Moderator Election Town Hall Chat](https://webmasters.meta.stackexchange.com/questions/820/july-2012-moderator-town-hall-chat). The format, [as described on Meta Stack Overflow](https://meta.stackexchange.com/questions/77831/how-can-we-improve-the-town-hall-digests)...
2012/07/27
[ "https://webmasters.meta.stackexchange.com/questions/822", "https://webmasters.meta.stackexchange.com", "https://webmasters.meta.stackexchange.com/users/3665/" ]
*[Christofian http://www.gravatar.com/avatar/c35db03c7ecd3c62b6c89be47b60f3fd?s=16&d=identicon&r=PG](http://www.gravatar.com/avatar/c35db03c7ecd3c62b6c89be47b60f3fd?s=16&d=identicon&r=PG) [Christofian](http://chat.stackexchange.com/users/13590/christofian) [asked](http://chat.stackexchange.com/transcript/message/552157...
*Grace Note [Grace Note](http://chat.stackexchange.com/users/757/grace-note) [asked](http://chat.stackexchange.com/transcript/message/5535286#5535286):* We're nearing the close of the thing, so, to that end - **closing thoughts from the candidates**? ---------------------------------------------------------------------...
528,872
I am trying to setup USB communication with an STM32F446RE It is a custom board where: * The clock source is an external 8Mhz quartz * There is a micro USB port with USB+ connected to PA12 and USB- connected to PA11 The external quartz is working (I can load a firmware that just blinks a led) but I fail to enumerate...
2020/10/23
[ "https://electronics.stackexchange.com/questions/528872", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/90164/" ]
Yeah, well, your firmware needs to respond to the USB packets coming from the host. You seem to have enabled the USB hardware peripheral, but not included or at least not started any USB handling code.
Attempted enumeration of a low-speed device comes from a pull-up on D- alone - irrespective of any firmware that might or might not support USB. A pull-up on D+ would indicate a full-speed device (or a high speed one that must initially present as full speed before being stepped up) In your case, what this low speed e...
71,156,992
I have two files. The first file contains, in each line, line number and text. For example: ``` 2 AAAA 4 BBBB 5 nnnn ``` this text should replace the lines in the second file - according to the first column which is the line number on the second file. So if initially the second files was: ``` XXXXX XXXXX XX...
2022/02/17
[ "https://Stackoverflow.com/questions/71156992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18232853/" ]
You can use `sed` to transform the first file into a `sed` script, and then pass that to a second `sed` instance. ``` sed 's%^\([0-9]*\) *\([^ ]*\)$%\1s/XXXXX/\2/' firstfile | sed -f - secondfile ``` Linux `sed` will happily accept `-f -`; on some other platforms, maybe experiment with `-f /dev/stdin` or just save t...
Here is a potential solution that edits the "second.txt" file 'in place' and is along the lines of what you've already tried: ``` cat first.txt 2 AAAA 4 BBBB 5 nnnn cat second.txt XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX # GNU sed while read N A do sed -i "${N}s/XXXXX/${A}/" second.txt done < first.txt cat sec...
38,531,126
Using Google Firebase in my ios swift app, I found the infamous message in my console output: > > App Transport Security has blocked a cleartext HTTP (http://) resource > load since it is insecure. Temporary exceptions can be configured via > your app's Info.plist file. > > > Using the method [here](https://sta...
2016/07/22
[ "https://Stackoverflow.com/questions/38531126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6426003/" ]
I'm using the `firebase/analytics` module (`firebase 7.1.0`) inside a react app using firebase hosting and I was getting an error trying to load the googletagmanager (which I am NOT doing explicitly, it is coming from the module). `Mixed Content: The page at 'https://example.com/' was loaded over HTTPS, but requested...
You do if you wish to use Firebase Analytics. Alternatively, you can disable analytics in the Firebase plist file.
37,794,734
I noticed an interesting problem while trying to debug a VBA routine that sorts the list of worksheets in a range and then redraws the border around that range. The range containing is defined in Name Manager with the formula as shown below ``` =Tables!$L$2:$L$22 ``` The problem that is occurring is that while doin...
2016/06/13
[ "https://Stackoverflow.com/questions/37794734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/959663/" ]
I had a similar problem and it turned out that I archived the containing folder directly in my Archive.zip file, thus giving me this structure in the Archive.zip file: ``` RootFolder - Dockerrun.aws.json - Other files... ``` It turned out that by archiving only the RootFolder's content (and not the folder it...
I got here due to the error. What my issue was is that I was deploying with a label using: ``` eb deploy --label MY_LABEL ``` What you need to do is deploy with `'`: ``` eb deploy --label 'MY_LABEL' ```
31,437,083
I need help with BeautifulSoup, I'm trying to get the data: `<font face="arial" font-size="16px" color="navy">001970000521</font>` They are many and I need to get the value inside "font" ``` <div id="accounts" class="elementoOculto"> <table align="center" border="0" cellspacing=0 width="90%"> <tr...
2015/07/15
[ "https://Stackoverflow.com/questions/31437083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4410003/" ]
how about this? ``` from bs4 import BeautifulSoup str = '''<div id="accounts" class="elementoOculto"> <table align="center" border="0" cellspacing=0 width="90%"> <tr><th align="left" colspan=2> permisos </th></tr><tr> <td colspan=2> <table width=100% align=cen...
How about using a [CSS selector](http://www.crummy.com/software/BeautifulSoup/bs4/doc/#css-selectors) starting from the `div` with `id="accounts"`: ``` soup.select("div#accounts table > tr > font") ```
24,861,695
I want to create a bouncy animation like in the Skitch application - when i press a button, a subview (simple view with several buttons) will appear from the side and will bounce a bit until it stops. I can't find any standard animation that does that, so how i can implement this animation?
2014/07/21
[ "https://Stackoverflow.com/questions/24861695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/243967/" ]
You can try this : ``` // Hide your view by setting its position to outside of the bounds of the screen // Whenever you want, call this : [UIView animateWithDuration:0.5 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:0 options:UIViewAnimationOptionCurveLi...
Use UIView method: ``` + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay usingSpringWithDamping:(CGFloat)dampingRatio initialSpringVelocity:(CGFloat)velocity options:(UIViewAnimationOptions)options animations:(voi...
64,337,292
This is my HTML and CSS code where I want the animation to take place ```css .pig { animaton-name: apple; animation-duration: 3s; } @keyframe apple { from { top: 0px; } to { right: 200px; } } ``` ```html <div class='pig'> <h2> About me </h2> </div> ``` I'm trying to make my header move to the ...
2020/10/13
[ "https://Stackoverflow.com/questions/64337292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9721392/" ]
first add `position : absolute` to .pig class because We need the position to be able to apply top , left , right ,bottom and then edit your `animaton-name` to `animation-name` and the last one is edit your `keyframe` to `keyframes` ```css .pig { animation-name: example; animation-duration: 3s; position...
Try this ```css .pig{ animation: 3s linear 0s apple; } @keyframes apple { from { transform: translateX(0px); } to { transform: translateX(200px); } } ``` ```html <div class = 'pig'> <h2> About me </h2> </div> ```
61,189,996
I would like to align button in order to make responsive my web application. The button are correctly aligned when the screen is large : [Button correctly aligned](https://i.stack.imgur.com/UM1KU.png) Here is a capture when the button are not correctly aligned : [Button not correctly aligned](https://i.stack.imgur.c...
2020/04/13
[ "https://Stackoverflow.com/questions/61189996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Here's a slight improvement: ``` def _if_between(value, arr): if any([borders[0] <= value <= borders[1] for borders in arr]): return True return False ```
Pandas 1.0.3 has an [IntervalArray](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.arrays.IntervalArray.html) type which has a contains method to check if a number exists in any interval in the array: ``` import pandas as pd borders = [ [ 7848, 10705], [10861, 13559], [13747, 16319], ...
34,670
If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?
2013/06/13
[ "https://cooking.stackexchange.com/questions/34670", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/14401/" ]
The question was: "If I left food out of the refrigerator for some period of time, is it still safe? If I left it out too long, can I salvage it by cooking it more?" Answer: It depends ... * How long did you leave it outside the fridge? * What kind of food are we talking about? * What is the moisture content of the f...
(in reply to a closed question: > > I left two bags of groceries in the car overnight. A beef shoulder roast, a pork loin, pack of ground beef and some smoked sausage. They were cold to the touch. That was our food for the week. Not sure what I should do. > > > The rule of thumb (and of the USDA) is: after two h...
11,747,761
The problem is that after I added the new class, the error came up when I did build the solution. What can be wrong? In Form1, I don’t have any code yet. I just added a new class: ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using OpenHardwareMonitor.Hardware; namespace ...
2012/07/31
[ "https://Stackoverflow.com/questions/11747761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1544479/" ]
Having two *Main* methods is just fine. If you receive the error you mentioned then you need only to tell Visual Studio which one you'd like to use. 1. Right-click on your project to view the properties. 2. Go to the *Application* tab and choose the entry point you desire from the *Startup object* dropdown. Here's an...
An entry point may be chosen by add `StartupObject` into your .cspoj ``` <StartupObject>MyApplication.Core.Program</StartupObject> ``` See [-main (C# Compiler Options)](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/main-compiler-option)
4,267,928
Adding indexes is often suggested here as a remedy for performance problems. (I'm talking about reading & querying ONLY, we all know indexes can make writing slower). I have tried this remedy many times, over many years, both on DB2 and MSSQL, and the result were invariably disappointing. My finding has been that n...
2010/11/24
[ "https://Stackoverflow.com/questions/4267928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/338101/" ]
An index that's never used is a waste of disk space, as well as adding to the insert/update/delete time. It's probably best to define the clustering index first, then define additional indexes as you find yourself writing `WHERE` clauses. One common index mistake I see is people wondering why a select on col2 (or col...
You need indexes. Only with indexes you can access data fast enough. To make it as short as possible: * add indexes for columns you are frequently filtering (or grouping) for. (eg. a state or name) * `like` and sql functions could make the DBMS not use indexes. * add indexes only on columns which have many different ...
4,444,710
Is it possible to remove the YouTube logo from a chromeless player?
2010/12/14
[ "https://Stackoverflow.com/questions/4444710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/267945/" ]
You can't and you shouldn't. > > If you use the Embeddable Player on > your website, you may not modify, > build upon, or block any portion or > functionality of the Embeddable > Player, including but not limited to > links back to the YouTube website. > > > www.youtube.com/static?gl=US&template=terms
You can, just add the code `?modestbranding=1` : [check here](http://youtube-global.blogspot.com/2011/06/next-step-in-embedded-videos-hd-preview.html)
243,800
**The Situation** I have an area of the screen that can be shown and hidden via JavaScript (something like "show/hide advanced search options"). Inside this area there are form elements (select, checkbox, etc). For users using assistive technology like a screen-reader (in this case JAWS), we need to link these form el...
2008/10/28
[ "https://Stackoverflow.com/questions/243800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9960/" ]
Give items the aria-hidden="true" attribute, and it should be hidden from the screenreader.
This definitely looks like a bug in JAWS as the spec definitively states that display:none should cause an element and its children not to be displayed in any media. However, playing with the speak: aural property might be useful? I don't know as I don't have JAWS available. [<http://www.w3.org/TR/CSS2/aural.html#spe...
20,091,197
I have a image with noise. i want to remove all background variation from an image and want a plain image .My image is a retinal image and i want only the blood vessel and the retinal ring to remain how do i do it? 1 image is my original image and 2 image is how i want it to be. this is my convoluted image with noise ...
2013/11/20
[ "https://Stackoverflow.com/questions/20091197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2959820/" ]
There are multiple approaches for blood vessel extraction in retina images. You can find a thorough overview of different approaches in [Review of Blood Vessel Extraction Techniques and Algorithms](http://www.siue.edu/~sumbaug/RetinalProjectPapers/Review%20of%20Blood%20Vessel%20Extraction%20Techniques%20and%20Algorith...
This is **not** an easy task. Detecting boundary of blood vessals - try `edge( I, 'canny' )` and play with the threshold parameters to see what you can get. A more advanced option is to use [this method for detecting faint curves in noisy images](http://www.wisdom.weizmann.ac.il/~meirav/Curves_Alpert_Galun_Nadler_B...
60,313,610
I'm trying to share a link which would redirect a user to YouTube link if clicked on a desktop browser and redirect to the app if clicked on Android.The links are working fine but I'm getting the deep link instead of short link ``` Uri uri = getIntent().getData(); String path = uri.getPath(); ``` Is there a way to g...
2020/02/20
[ "https://Stackoverflow.com/questions/60313610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10121512/" ]
the base routing structure in react is like below: ### 1.Root Component: basically you have a Root Component in your application, mainly the `<App />` component ### 2.Inner Components: inside of your `<App />` component you render 2 type of components: 1. components that should render in your routes 2. components ...
This function should be work on your code: ``` changeToggleMenuValue() { this.setState({ toggleValue: this.state.toggleValue ? history.push('') // or history.push('/') : history.push('/videos'); }); } ```
65,308,798
I have a program that prints data into the console like so (separated by space): ``` variable1 value1 variable2 value2 variable3 value3 varialbe4 value4 ``` **EDIT:** Actually the output can look like this: ``` data[variable1]: value1 pre[variable2] value2 variable3: value3 flag[variable4] value4 ``` In the end I...
2020/12/15
[ "https://Stackoverflow.com/questions/65308798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12663842/" ]
I'd suggest to use `awk`: ``` $ cat ip.txt data[variable1]: value1 pre[variable2] value2 variable3: value3 flag[variable4] value4 $ cat var_list variable1 variable3 $ awk 'NR==FNR{a[$1]; next} {for(k in a) if(index($1, k)) print $2}' var_list ip.txt value1 value3 ``` To use output of another command as inp...
This is how to do the job efficiently AND robustly (your approach and all other current answers will result in false matches from some input and some values of the variables you want to search for): ``` $ cat tst.sh #!/usr/bin/env bash vars='variable2 variable3' awk -v vars="$vars" ' BEGIN { split(vars,tmp) f...
1,359,643
I am moving a folder recursively between two filesystems using mv -v. It seems like deletions happen at the end (in order to make mv *transactional* ?). I don't have enough space to hold two copies of the same folder, is there a way to force mv to delete a file as soon as it is done?
2018/09/19
[ "https://superuser.com/questions/1359643", "https://superuser.com", "https://superuser.com/users/220911/" ]
As the other answers and comments note, there is no such functionality in `mv`. But `rsync` has a `--remove-source-files` switch which behaves as you want, removing files from the source continuously as the operation progresses. I'd also recommend the `-a` switch ("archive mode") to preserve (most) file metadata if yo...
No, the [Man pages](https://linux.die.net/man/1/mv) for `mv` do not indicate any switches that change the behavior of the command in the way you describe. You will have to look into other commands or algorithms. > > **Name** > > > mv - move (rename) files Synopsis > > > *mv [OPTION]... [-T] SOURCE DEST* > > ...
52,558,770
I have a table that is presenting a list of items that I got using the following code: ``` interface getResources { title: string; category: string; uri: string; icon: string; } @Component export default class uservalues extends Vue { resources: getResources[] = []; created() { fetch(...
2018/09/28
[ "https://Stackoverflow.com/questions/52558770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3376642/" ]
You can use the `includes()` function of the `array` to search any position in a sentence or phrase. ```js new Vue({ el: '#app', data() { return { searchQuery: null, resources:[ {title:"ABE Attendance",uri:"aaaa.com",category:"a",icon:null}, {title:"Accounting Ser...
**THIS NAVBAR COMPONENTS** ``` <template> <nav class="navbar navbar-expand-lg navbar-light bg-info display-6"> <div class="container"> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <form class="d-flex"> <input v-model="search" class="form-control me-2" id="...
89,566
My question refers to a capital ship. Ideally, the ship wants to stay as low as possible. Does the mass of the ship affect its possible orbits? If so, what is the lowest orbit possible for this ship? I don't have a number for its mass, but imagine something like the farragut: > > Dimensions: Length: 2040m, Width: 806...
2017/08/21
[ "https://worldbuilding.stackexchange.com/questions/89566", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/23503/" ]
Actually, in practice, a very massive object will be able to orbit ad *lower* altitude than a very light one. The orbit mechanics is exactly the same (assuming *big body* mass is still negligible compared with planet). **BUT** It can skim atmosphere fringes and still keep going due to its much larger inertia where a...
As I mentioned initially in the comments: **no.** To the best of my knowledge, the mass of an object only affects how much energy is needed to get that object into a specific orbit. It doesn't affect the actual distance at which that object can orbit. So realistically, the lowest your ship can orbit is just above the e...
35,421,671
I've run into some issue graphically representing some of my data via J Query in my Hangman game- right now I'm working on the last part of my play(space) function to take into account if there is more than one correctly guessed letter in a word & to display all instances of that letter- I've made a function to loop th...
2016/02/16
[ "https://Stackoverflow.com/questions/35421671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5761395/" ]
This could be a problem with the parameter viUserId (value is correct?), try to initialize like this: ``` var paramUserId = new SqlParameter { ParameterName = "viUserId", Value = userId }; ``` in my applications i've call procedures a little bit diferent. Translating to your problems should be like that: ``` var pa...
There is a typo in your parameter code. Your missing `@` in `"viUserId"` ``` UserID = new SqlParameter("@viUserId", userId); ```
15,447,483
I'm on Mac OS X and use the following bash script to run doxygen on around 10 source code libraries. Problem is, doxygen runs the most time-consuming task "dot" (creates class diagrams) on separate threads by itself. This causes the wait command to not wait for the dot threads to finish. It effectively returns me to ...
2013/03/16
[ "https://Stackoverflow.com/questions/15447483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/201863/" ]
Have a look here <https://stackoverflow.com/a/8247993/784672>, where I describe a way to run doxygen in parallel using tag files and the GNU parallel utility.
I think another solution (not tested, as I don't have `doxygen` installed), is to just run `doxygen` as a foreground task in a subshell that is backgrounded. This is pretty much the same as the solution you found, but without the need to create a second script: ``` for config in doxygen*.config; do ( $DOXY $config...
18,219,984
I have the following data: `data LinkedList a = Node a (LinkedList a) | Empty deriving (Show)` And I would like to know how to get a single value out of it, without pattern matching. So in a **C**-based language: `list.value`
2013/08/13
[ "https://Stackoverflow.com/questions/18219984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2175870/" ]
Rather than present a Haskell solution to your question, I will present a more realistic comparison with C and suggest that you don't *really* want what you seem to be asking for: ``` struct list { int value; struct list *next; }; int main(void) { struct list *list = NULL; int val; /* Goodbye, cr...
I'd just pattern match. ``` llHead :: LinkedList a -> a llHead Empty = error "kaboom" llHead (Node x _) = x ``` If you want the element at a specific index, try something like this (which also uses pattern matching): ``` llIdx :: LinkedList a -> Int -> a llIdx l i = go l i where go Empty _ = error "out...
65,855,961
I have an HTML form with a button and some checkboxes. The values of the checkboxes are passed to the next page via GET parameters. The target of the form submission is a blank page. ``` <form id="myForm" method="get" action="launch.php" target="_blank"> <input type="submit">Launch</input> <input type="checkbox" class...
2021/01/23
[ "https://Stackoverflow.com/questions/65855961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17312/" ]
* Right Click on Terminal [Step1](https://i.stack.imgur.com/SErKK.png) * Click on Move Panel To Bottom [Step 2](https://i.stack.imgur.com/DkZkK.png) * Then you can see your terminal at bottom
To make terminal appear at bottom as default, do following: 1. Open settings [`CRTL` + `,`] 2. Type *terminal default location* 3. Find *Terminal>Integrated>Default Location* and change value to **view**
4,562,231
I need to do multiplication on matrices. I'm looking for a library that can do it fast. I'm using the Visual C++ 2008 compiler and I have a core i7 860 so if the library is optimized for my configuration it's perfect.
2010/12/30
[ "https://Stackoverflow.com/questions/4562231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558209/" ]
Look into [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page). It should have all you need.
I have had good experience with Boost's [uBLAS](http://www.boost.org/doc/libs/1_45_0/libs/numeric/ublas/doc/index.htm). It's a nice option if you're already using Boost.
51,260,866
I found this question on an online exam. This is the code: ``` #include <stdio.h> int main(void) { int demo(); demo(); (*demo)(); return 0; } int demo(){ printf("Morning"); } ``` I saw the answer after the test. This is the answer: ``` MorningMorning ``` I read the explanation, but can't und...
2018/07/10
[ "https://Stackoverflow.com/questions/51260866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7544643/" ]
It is not a problem because that `int demo();` is not a function definition, it is just an external declaration, saying (declaring) that a function of such name exists. In C you cannot define a nested function: ``` int main(void) { int demo() {} //Error: nested function!!! } ``` But you can declare a function j...
Other answers didn't explain the ``` (*demo)(); ``` part. Here's a partial explanation: `demo` (without parentheses) is the function *pointer*. So you can first dereference it to get a function *then* call it with parentheses (wrapping the dereferenced object into parentheses else it means that you want to derefere...
12,743,204
Thanks for going through this. I successfully integrated Zebra Printer working in xcode and got the label printer successfully from simulator, but the problem raises the moment i tried to debug it on my device saying "ld: warning: ignoring file /Users/MYSystem/Desktop/MYProject/libZSDK\_API.a, file was built for archi...
2012/10/05
[ "https://Stackoverflow.com/questions/12743204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/758532/" ]
Use the 64-bit version of Java which allows you to use more memory. This is the limit of the 32-bit Java virtual machine.
You are not able to have an allocation of 4096m because. It tries to get a single block of 4096m. Which is not possible at any given point of time. So you can use some smaller values between 3000-4000. or make sure your RAM is not used by any of the processes
2,139,273
I've seen and googled and found many pretty url links. But they all seem to look like <http://example.com/users/username> I want it to be like github style <http://example.com/username> Any directions that I can follow??
2010/01/26
[ "https://Stackoverflow.com/questions/2139273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60072/" ]
A very Basic example could be this: * declare a route with lowest priority pointing to your users controller's show action * modify the show action to find records based on username In `config/routes.rb`: ``` map.username '/:username', :controller => :users, :action => :show ``` In `UsersController`: ``` def show...
Isn't that you just need to drop `users/` in routes? `map.connect '/:username',...` instead of `map.connect '/users/:username',...`
24,394,772
I've seen lots of examples with getting file names from URL or path, but am unable to solve this problem. I have a URL that looks like below: ``` http://www.bob.net/john/john/ken/mary.html ``` I need to get `Mary` if both `/john/john` exist in the URL. Otherwise I need to get `ken` if only `/john` exists in the pa...
2014/06/24
[ "https://Stackoverflow.com/questions/24394772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3772597/" ]
Inline elements are sensitive to white space. Remove the white space and the problem goes away. Ex: ``` <ul> <li><a href="#">list1</a></li><li><a href="#">list2</a></li><li><a href="#">list3</a></li> </ul> ``` **[jsFiddle example](http://jsfiddle.net/j08691/eF83x/1/)** You can remove the spaces between the lis...
What you could also do is make the lis float left and display them as block. This will fix it without messing with the html code. ``` .nav-items ul li { float: left; display: block; border-left: 1px solid #c8c8c8; height: 100%; margin: 0; } ``` [jsFiddle example](http://jsfiddle.net/eF83x/2/)
13,269,600
Is there any easy way to get the keys for which same value exist? Or more importantly, how can i get the number of same-value-more-than-once occurrences? Consider the hashmap: ``` 1->A 2->A 3->A 4->B 5->C 6->D 7->D ``` here same-value-more-than-once occurred 3 times(A two times, D one time).That(3) is what i want ...
2012/11/07
[ "https://Stackoverflow.com/questions/13269600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1805994/" ]
> > I could iterate over the hashmap by the keyset/map.values() list, but it seems quite cumbersome to do that way. > > > Well it's *inefficient*, but there's not a lot you can do about that, without having some sort of multi-map to store reverse mappings of values to keys. It doesn't have to be cumbersome in ter...
How about (expanding on Jon's answer) ``` Multiset<V> counts = HashMultiSet.create(map.values()); Predicate<Map.Entry<K,V>> pred = new Predicate<Map.Entry<K,V>>(){ public boolean apply(Map.Entry<K,V> entry){ return counts.count(entry.getValue()) > 1; } } Map<K,V> result = Maps.filterEntries(map, pred); `...
54,182,039
For closing a modal with the class `submitmodal` i use this code and it works fine. ``` $('.submitmodal').click(function() { window.location.hash='close'; }); ``` For click on the body somewhere i use this: ``` $('body').click(function() { window.location.hash='close'; }); ``` ...
2019/01/14
[ "https://Stackoverflow.com/questions/54182039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6036819/" ]
Try ``` (".submitmodal, body").click(function() { window.location.hash="close"; }); ``` The selectors have to be in the same string, seperated by a comma.
You can specify any number of selectors to combine into a single result. This multiple expression combinator is an efficient way to select disparate elements. The order of the DOM elements in the returned jQuery object may not be identical, as they will be in document order. ``` $("body, .submitmodal").click(function(...
24,054,648
I encountered some encoding problems in learning Spring Boot; I want to add a CharacterEncodingFilter like Spring 3.x. just like this: ``` <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>...
2014/06/05
[ "https://Stackoverflow.com/questions/24054648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1649366/" ]
I also prefer `application.properties` configuration. But `spring.http.encoding` is depracted in the new spring boot versions (>2.3). So new application.setting should look like this: ``` server.servlet.encoding.charset=UTF-8 server.servlet.encoding.enabled=true server.servlet.encoding.force=true ```
I think there is no need to explicity write the following properties in application.properties file: spring.http.encoding.charset=UTF-8 spring.http.encoding.enabled=true spring.http.encoding.force=true Instead if you go to pom.xml in your application and if you have the following, then spring will do the needful. ...
4,401,042
Task in Combinatorics course: > > $1 \leq k < n$. Prove that the number $k$ can be found $(n-k+3)2^{n-k-2}$ times in sums that add up to $n$. > > > Example: $n=4, k=2$. $1+1+2$ $1+2+1$ $2+1+1$ $2+2$ These are the sums that add up to $4$ and the number $2$ can be found $5$ times. Thus far, I have tried makin...
2022/03/11
[ "https://math.stackexchange.com/questions/4401042", "https://math.stackexchange.com", "https://math.stackexchange.com/users/763750/" ]
A [composition](https://en.wikipedia.org/wiki/Composition_(combinatorics)) which sums to $n$ corresponds to the placement of either a comma or an addition sign in each of the $n - 1$ spaces between successive ones in a row of $n$ ones. $$1 \square 1 \square 1 \square \cdots \square 1 \square 1 \square 1$$ Since ther...
Fix $k$ and let $a\_n$ be the number of $k$s that appear among all ($2^{n-1}$) ordered partitions of $n$. Then $a\_n=0$ for $n<k$, $a\_k=1$, and conditioning on the first part $i$ yields recurrence relation $$a\_n = \sum\_{i=1}^n ([i=k]2^{n-i-1} + a\_{n-i}) = 2^{n-k-1} + \sum\_{i=1}^{n-k} a\_{n-i} \quad \text{for $n > ...
348,537
I'm looking for all (or most) theoretical *semi-classical* derivations of the **maximal magnetic field intensity** that there may be in the Universe. As an example, this paper evaluate a maximal field of about $3 \times 10^{12} \, \mathrm{teslas}$ : <https://arxiv.org/abs/1511.06679> but its calculations are buggy, e...
2017/07/25
[ "https://physics.stackexchange.com/questions/348537", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/98263/" ]
**Why do you want to know?** I'm not kidding. That's actually an important question. The answer really depends on what you intend to do with the information you are given. Newton's laws are an empirical model. Newton ran a bunch of studies on how things moved, and found a small set of rules which could be used to pre...
Newton's Third Law is a direct consequence of conservation of momentum, which essentially says that in an isolated system with no net force on it, momentum doesn't change. This means that if you change the momentum of one object, then another object's momentum must change in the opposite direction to preserve the total...
71,211,699
I cannot understand how are box working, why when box is covering some layer of our screen, for example we are three boxes ``` @Composable fun TestScope() { 1 Box(modifier = Modifier .fillMaxSize() .background(color = Color.Black)) { 2 Box( Modifier ...
2022/02/21
[ "https://Stackoverflow.com/questions/71211699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17553375/" ]
Click events in Compose pass from the top composable to the bottom composable. A Surface composable however prevents this and prevents click events from propagating further down. So when you click on Box 3, the click event is sent down to Box 2. If you place Box 3 inside a Surface, the click event on Box 3 will not go ...
This is expected. Any composable that does not handle click events is effectively transparent to those click events and can be captured by composables underneath it. This is no different from the view system where you could have a clickable view behind another opaque view - as long as the opaque view does not handle cl...
5,049
Can the Airbus A380 or Boeing 787 land safely without flaps/slats/spoilers or thrust reversers?
2014/05/23
[ "https://aviation.stackexchange.com/questions/5049", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/2171/" ]
Even the largest commercial airliners are able to land without flaps, since flap failures do happen occasionally. See a report [here](http://avherald.com/h?article=46d6dd03) where an A380 landed with no flaps. This was at the Auckland, New Zealand airport, where the runway is 3,635 m (11,926 ft) long. The pilots have ...
Any aircraft can land without those devices. I would say that the [Gimli Glider](http://aviation-safety.net/database/record.php?id=19830723-0) is a nice example, with no power it could not extend its flaps/slats. They are used, as @ratchetfreak notes in the comments, to reduce the touchdown speed and, as a consequence...
35,120,566
I have two lists in SharePoint 2013 Online. I need to get matching values for a user-entered key (string), sort, and display both lists as one. Easy enough if I were able to use SQL to create a view. Best solution seems to be to just display both lists. I've tried using SPD Linked Sources, but the "linked field" opti...
2016/01/31
[ "https://Stackoverflow.com/questions/35120566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344208/" ]
Seems like you miss API 19. I suggest you go to Tools - Android - SDK Manager or click on the SDK Manager icon and check if API 19 is installed.
I already had API 19 installed even though the error seems to indicate API19 is an issue. I switched to API 17 and that got rid of that error but caused some new ones. These issues are probably related to the Sherlock library that is in my app conflicting with the GooglePlayer libraries. After switching to API 17 I re...
35
These two terms seem to be related, especially in their application in computer science and software engineering. * Is one a subset of another? * Is one a tool used to build a system for the other? * What are their differences and why are they significant?
2016/08/02
[ "https://ai.stackexchange.com/questions/35", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/69/" ]
The machine learning is a sub-set of artificial intelligence which is only a small part of its potential. It's a specific way to implement AI largely focused on statistical/probabilistic techniques and evolutionary techniques.[Q](https://www.quora.com/What-are-the-main-differences-between-artificial-intelligence-and-ma...
Machine learning is a subfield of artificial intelligence, as the following diagram (taken from [this blog post](https://www.linkedin.com/pulse/how-artificial-intelligence-different-from-machine-learning-singh)) illustrates. [![enter image description here](https://i.stack.imgur.com/5i2z7.png)](https://i.stack.imgur.c...
37,618,333
I've this code : ```css div { width: 200px; height: 200px; background-color: #ececec; margin-bottom: 10px; } ``` ```html <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> ``` I want to target the 2nd div, then the 5th div, the 8th div etc...
2016/06/03
[ "https://Stackoverflow.com/questions/37618333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4875059/" ]
Just use the [`nth-child`](https://developer.mozilla.org/en/docs/Web/CSS/:nth-child) pseudo-class with an appropriate parameter: ``` div:nth-child(3n+2){ background-color: blue; } ```
Add this CSS code, ``` div:nth-child(3n+2){ background:#00CC66; } ```
598,552
I visited a university CS department open day today and in the labs tour we sat down to play with a couple of final-year projects from undergraduate students. One was particularly good - a sort of FPS asteroids game. I decided to take a peek in the `src` directory to find it was done in C++ (most of the other projects ...
2009/02/28
[ "https://Stackoverflow.com/questions/598552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2025/" ]
I think you should learn C first, because I learned C first. C gave me a good grasp of the syntax and gotchas with things like pointers, all of which flow into C++. I think C++ makes it easy to wrap up all those gotchas (need an array that won't overflow when you use the [] operator and a dodgy index? Sure, make an ar...
I think learning C first is a good idea. There's a reason comp sci courses still use C. In my opinion its to avoid all the "crowding" of the subject matter the obligation to require OOP carries. I think that procedural programming is the most natural way to first learn programming. I think that's true because at the...
4,029,281
How to determine what is selected in the drop down? In Javascript.
2010/10/27
[ "https://Stackoverflow.com/questions/4029281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/488272/" ]
``` <select onchange = "selectChanged(this.value)"> <item value = "1">one</item> <item value = "2">two</item> </select> ``` and then the javascript... ``` function selectChanged(newvalue) { alert("you chose: " + newvalue); } ```
``` var dd = document.getElementById("dropdownID"); var selectedItem = dd.options[dd.selectedIndex].value; ```
9,252,266
So, I understand what pointers are, what it means to reference something, and have a vague understanding of this 'heap'. Where I begin to lose my grip on things is when we introduce functions and classes with the use of these concepts, e.g. sending pointers, returning pointers, etc. If by reference and passing pointe...
2012/02/12
[ "https://Stackoverflow.com/questions/9252266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1200053/" ]
You're getting confused between two uses of the ampersand (&). In one case it is an operator and in the other case it's part of the type of a declaration. ``` int x = 5; int* y = &x; // (1) Here it's an operator int& z = x; // (2) Here it's part of the type of y ``` In line (1) above, we are declaring and defining ...
When you have `student s;` variable and you want to pass it to function `f` that takes argument of type `student` (passing by value) or `student&` (passing by reference), you just call `f(s)`. If you pass `s` by value, then copy of `s` is created and you work with copy of `s` in the body of function. If you pass it by ...
389,047
> > **Possible Duplicate:** > > [Vista to Windows 7 - Upgrading or clean installation?](https://superuser.com/questions/69662/vista-to-windows-7-upgrading-or-clean-installation) > > > Should I upgrade my Windows Vista to Windows 7 or wipe/format/install Windows 7? I have a Dell Precision T3400 workstation tha...
2012/02/12
[ "https://superuser.com/questions/389047", "https://superuser.com", "https://superuser.com/users/96062/" ]
Well the upgrade would work but it is a better approach do do a reinstall since you get rid of all the unneeded clutter. I would go with a reinstall if I where you but an upgrade would serve you well too. So if it is just a matter of using the free upgrade or buying a new disk for a fresh install then upgrade otherwi...
Do an inplace upgrade. A lot more convenient if you have got data there. If you haven’t, you should do a clean install.
136,278
For example, I rarely need: ``` using System.Text; ``` but it's always there by default. I assume the application will use more memory if your code contains unnecessary [using directives](http://msdn.microsoft.com/en-us/library/aa664764(VS.71).aspx). But is there anything else I should be aware of? Also, does it ma...
2008/09/25
[ "https://Stackoverflow.com/questions/136278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15328/" ]
It won't change anything when your program runs. Everything that's needed is loaded on demand. So even if you have that using statement, unless you actually use a type in that namespace / assembly, the assembly that using statement is correlated to won't be loaded. Mainly, it's just to clean up for personal preference...
They are just used as a shortcut. For example, you'd have to write: System.Int32 each time if you did not have a using System; on top. Removing unused ones just makes your code look cleaner.
31,244,547
In the following code: ``` def main someArray.all? { |item| checkSomething(item) } end private def checkSomething(arg) ... end ``` How do I shorten the `all?` statement in order to ged rid of the redundant `item` variable? I'm looking for something like `someArray.all?(checkSomething)` which gives a "wro...
2015/07/06
[ "https://Stackoverflow.com/questions/31244547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/326370/" ]
You could have a slightly shorter code if `checkSomething` was a method on your object class. Don't know what it is, so, I'm guessing, you're working with primitives (numbers, strings, etc.). So something like this should work: ``` class Object def check_something # check self end end some_array.all?(&:check_...
For block that executes a method with arguments, Checkout this way... ``` def main someArray.all? &checkSomething(arg1, arg2, ...) end private def checkSomething(arg1, arg2, ...) Proc.new { |item| ..... } end ```
32,639,112
So I'm running into some issues that I'm not aware of how to solve when I'm improving my code. Currently in my controller#show I have this ugly piece of code: ``` def show @room = Room.find(params[:id]) if user_signed_in? gon.push( session_id: @room.session_id, api_key: 453, token: current_u...
2015/09/17
[ "https://Stackoverflow.com/questions/32639112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5074646/" ]
I don't see why you would like to move this method to the model. (Are you using it from different places in your code? or just from this specific place?). I would refactor this to the following: ``` def show @room = Room.find(params[:id]) gon_args = { session_id: @room.session_id, api_key: 453, token: nil } if ...
You could always use a [PORO (Plain Old Ruby Object)](http://www.bootyard.com/programming/poro-for-unique-business-logic.html). Not only does it keep stuff clean, it helps a *bunch* in testing your app and keeping single responsibilities across your code. I'm sure you can do much better than below but this is just a st...
18,014,471
I'd like to bind/set some boolean attributes to a directive. But I really don't know how to do this and to achieve the following behaviour. Imagine that I want to set a flag to a structure, let's say that a list is collapsable or not. I have the following HTML code: ``` <list items="list.items" name="My list" collaps...
2013/08/02
[ "https://Stackoverflow.com/questions/18014471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1454404/" ]
You can configure your own 1-way databinding behavior for booleans like this: ``` link: function(scope, element, attrs) { attrs.$observe('collapsable', function() { scope.collapsable = scope.$eval(attrs.collabsable); }); } ``` Using $observe here means that your "watch" is only affected by the att...
Since Angular 1.3 attrs.$observe seems to trigger also for undefined attributes, so if you want to account for an undefined attribute, you need to do something like: ``` link: function(scope, element, attrs) { attrs.$observe('collapsable', function() { scope.collapsable = scope.$eval(attrs.collapsable); ...
20,903,439
How can you set up a `UIScrollView` to be paged and show `UIImages` such as the way app screenshots are presented in the app store (example in the image below). Having the preview either side for the next / previous image is required too (like the old style tabs in Safari (iPhone) for iOS 6 and below). I have found s...
2014/01/03
[ "https://Stackoverflow.com/questions/20903439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/451678/" ]
I've solved it, chaps. The method is as follows: ``` private Drawable invertImage(Drawable inputDrawable){ Bitmap bitmap = ((BitmapDrawable) inputDrawable).getBitmap(); int width = bitmap.getWidth(); int height = bitmap.getHeight(); int[] pixels = new int[width * height]; bitmap.getPixels(pixels,...
You need to make a selector xml file which is described here <http://developer.android.com/guide/topics/resources/drawable-resource.html> Possible implementation would look like this: ``` <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button_focused_pressed...
8,011,216
I need to update status line editor-specific information. I already have my own implementation, but I would like to take a look how is eclipse contribution item, which shows line number/column position in status line is implemented. Can anyone point me, where could I find the source code? Thanks in advance, AlexG.
2011/11/04
[ "https://Stackoverflow.com/questions/8011216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/580147/" ]
I've been looking into it, it's quite involved, and I'm not sure I got the complete picture, but in case this helps someone... The declarative way of binding an Editor with the contributions to the StatusLine (and Menu and Toolbar) is through [IEditorActionBarContributor](http://help.eclipse.org/indigo/topic/org.eclip...
In order to find out how something is implemented in Eclipse, you can also use the so called **Plug-in spy**. The Plug-in spy is included in the **Plug-in Development Environmend (PDE)**. It is executed with **ALT+SHIFT+F1**. For further details look this [Plug-in development FAQ](http://wiki.eclipse.org/Eclipse_Plug-i...
41,852,686
How do i unit test python dataframes? I have functions that have an input and output as dataframes. Almost every function I have does this. Now if i want to unit test this what is the best method of doing it? It seems a bit of an effort to create a new dataframe (with values populated) for every function? Are there...
2017/01/25
[ "https://Stackoverflow.com/questions/41852686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/955237/" ]
I don't think it's hard to create small DataFrames for unit testing? ``` import pandas as pd from nose.tools import assert_dict_equal input_df = pd.DataFrame.from_dict({ 'field_1': [some, values], 'field_2': [other, values] }) expected = { 'result': [...] } assert_dict_equal(expected, my_func(input_df).to...
I would suggest writing the values as CSV in docstrings (or separate files if they're large) and parsing them using `pd.read_csv()`. You can parse the expected output from CSV too, and compare, or else use `df.to_csv()` to write a CSV out and diff it.
951,596
Given the code (which looks like it should be valid): ``` <!--[if lt IE 7]> <style type="text/css" media="screen"> <!-- div.stuff { background-image: none; } --></style><![endif]--> ``` The W3C validator throws a fit: * S separator in comment declaration * invalid comment declaration: found name start character out...
2009/06/04
[ "https://Stackoverflow.com/questions/951596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/95022/" ]
"`-->`" closes any comment, there is no notion of nesting comments inside each other. So in your code, the first "`-->`" closes both of your comments. Then the `<![endif]-->` is completely outside of any comments, so doesn't make any sense.
It is the nested comments. They are not allowed.
37,319,576
Item Position always taken as 0 inside onBindViewHolder and hence i am only getting one list item in recycler view although I have passed huge list in adapter. This issue is occurring in some devices including Nexus 5 while my recycler view is working fine for few other devices like s5. Can any body tell me what may...
2016/05/19
[ "https://Stackoverflow.com/questions/37319576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3492435/" ]
Use a class loader you will get the desired output ``` Class.forName("<package>.Test6"); ```
Test6 is not initialized at all. the foo is static, which means it can be used before class is intitialized and after a class is load.
19,585,672
I am creating a topmenu for a webpage, and with scripting, the sub menus pops up on hover. I have also taken measures to not let the menu grow too far to the right, by if needed let it grow in the other direction. This picture clarifies: ![enter image description here](https://i.stack.imgur.com/FI50s.png) I do this b...
2013/10/25
[ "https://Stackoverflow.com/questions/19585672", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1427758/" ]
The interfaces in Java are born to be implemented. Any class can implement any interface as long as it wants. So, I think there is no way to prevent that case. You probably need reconsider your design.
Not sure if this helps, but if you do not specify that the interface is public, your interface will be accessible only to classes defined in the same package as the interface. So essentially, you could put your interface in one package, and any classes that you don't want to be able to implement it in another..
2,333,103
I'm using Views dropdown filter (with tags) and it works great. However I would like to customize it in this way: 1 - remove button "Apply" and automatically update Views (at the moment I'm updating it with Ajax) 2- allow my customer to change the order of the dropdown items (specifying top items) 3- select multiple...
2010/02/25
[ "https://Stackoverflow.com/questions/2333103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257022/" ]
The other way around is fine, bit I dont think you can run a 64bit app on a 32bit OS, you may be able to using a virtual machine or some kind of virtualisation.
No. [See Microsoft FAQ](http://windows.microsoft.com/en-US/windows-vista/32-bit-and-64-bit-Windows-frequently-asked-questions): > > The terms 32-bit and 64-bit refer to > the way a computer's processor (also > called a CPU), handles information. > The 64-bit version of Windows handles > large amounts of random acces...
14,073,989
My ruby script should handle multiple external processes, so I was wondering how to redirect the output from different process to different log file(s). Also, as the external process takes quite a bit of time to complete, what is the best way of handling them in parallel? As I am new to ruby I can show you an shell eq...
2012/12/28
[ "https://Stackoverflow.com/questions/14073989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1801327/" ]
This happened to me while collaborating with someone over Skype, so closing Skype was not an option. One possible solution is changing the port XAMPP is using for Apache. 1. Change *Apache (httpd.conf)* ------------------------------- Go to the XAMPP Control Panel, click *Config* for the Apache module and then *Apac...
It says that skype is using port 80. I would disable skype and then start your web server.
40,765,877
I'm setting up a Flask/uswgi web server. I'm still wondering about the micro-service architecture: Should I put both nginx and Flask with uwsgi in one container or shall I put them in two different containers and link them? I intend to run these services in a Kubernetes cluster. Thanks
2016/11/23
[ "https://Stackoverflow.com/questions/40765877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3743089/" ]
**Short answer:** I would deploy the nginx and uwsgi/flask application as separate containers. This gives you a more flexible architecture that allows you to link more microservices containers to the nginx instance, as your requirements for more services grow. **Explanation:** With docker the usual strategy is to sp...
If you're using Nginx in front of your Flask/uwsgi server, you're using Nginx as a proxy: it takes care of forwarding traffic to the server, eventually taking care of TLS encryption, maybe authentication etc... The point of using a proxy like Nginx is to be able to load-balance the traffic to the server(s): the Nginx ...
13,276,574
I'd like to get a string from my ArrayList, but it contains lines from my input fole. How do I split them correctly to have all the elements? My program looks like this: ``` private static ArrayList<String> lista; static void fileReading() { inp = new LineNumberReader(new BufferedReader(new InputStreamReader(new...
2012/11/07
[ "https://Stackoverflow.com/questions/13276574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1796823/" ]
The string `"//"` can be used directly as a separator, it doesn't need escaping: ``` String[] data = str.split("//"); ``` A different situation occurs with `"\\"`, the `'\'` character is used as escape character in a regular expression and in turn it needs to be escaped by placing another `'\'` in front of it: ``` ...
``` theString.split( "//" ); ``` <http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String>) since the arg is a regex, it might require some escaping, but that should work.
6,070
I know it is also possible to get a re-entry permit in both int. airports. Is it possible also on land-borders, specifically, Laos via Nong-Khai?
2015/04/28
[ "https://expatriates.stackexchange.com/questions/6070", "https://expatriates.stackexchange.com", "https://expatriates.stackexchange.com/users/6320/" ]
Yes, it is possible. Evidence: 1. It is, as of 1 July 2016, explicty stated on the [Nong Khai Immigration](http://nongkhai.immigration.go.th/index.php) web site that this is possible (see screenshot below) 2. I telephoned Nong Khai immigration to check, to make absolutely sure, and they said that it is. They also sa...
No, you cannot do this on land. In the international airport, they have a special re-entry desk. However, for land border, you should have a origin country. In the case of Laos, you should come from Laos. This means, when you leave Thailand, you should enter Laos and leave Laos to be eligible to enter Thailand again.
68,027,117
I tried this in TypeScript: ```js import events from 'events' import EventEmitter from 'events' class MyEmitter extends EventEmitter { condition: boolean emit() { if (this.condition) { return events.EventEmitter.prototype.emit.apply(this, arguments) } } } const myEmitter = new MyEmitter() myEmitt...
2021/06/17
[ "https://Stackoverflow.com/questions/68027117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90800/" ]
> > I want my program to look inside of this tag and output the text exactly like how they appear on the webpage. > > > The browser does a lot of processing to display a web page. This includes removing extra spaces. Additionally, the browser developer tools show a parsed version of the HTML as well as potential a...
Would something like this work: 1. Strip left and right of the p 2. Indent the paragraph with 1em (so 1 times the font size) 3. Newline each paragraph ``` font_size = 16 # get the font size for para in desiredText.find_all('p'): print(font_size * " " + para.get_text().strip(' \t\n\r') + "\n") ```
43,546,788
our program connects to a db and when you sign into the program, it's throwing this error: "Syntax error or access violation" along with "Cannot insert the value NULL into column 'ID', table 'CADDB.dbo.AuditTrail'; column does not allow nulls. INSERT fails" I've tried Microsoft's Fix to Use ANSI Nulls, Padding and War...
2017/04/21
[ "https://Stackoverflow.com/questions/43546788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7902332/" ]
The exception showed you the root cause that your app is trying to insert NULL value into column ID, a column not allowing NULL. If this is caused by your application's bug and you also want to insert a NULL value into ID column. Then you may change the table to allow NULL for column ID or use a special value represent...
Thank you everybody! The issue was the db was corrupt. I got a working backup of the same db and it works fine without any errors.
18,018,577
``` .newboxes { display: none; } <script language="javascript"> function showonlyone(thechosenone) { $('.newboxes').each(function(index) { if ($(this).attr("id") == thechosenone) { $(this).show(200); } else { $...
2013/08/02
[ "https://Stackoverflow.com/questions/18018577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2448030/" ]
``` var s = document.getElementById('thing').style; s.opacity = 1; (function fade(){(s.opacity-=.1)<0?s.display="none":setTimeout(fade,40)})(); ``` taken from <http://vanilla-js.com/>
CSS ``` .fade{ opacity: 0; } ``` JavaScript ``` var myEle=document.getElementById("myID"); myEle.className += " fade"; //to fadeIn myEle.className.replace( /(?:^|\s)fade(?!\S)/ , '' ) //to fadeOut ```
194,156
*With the popularity of the Apple iPhone, the potential of the Microsoft [Surface](http://www.microsoft.com/surface/index.html), and the sheer fluidity and innovation of the interfaces pioneered by Jeff Han of [Perceptive Pixel](http://link.brightcove.com/services/link/bcpid713271701/bclid713073346/bctid709364416) ...*...
2008/10/11
[ "https://Stackoverflow.com/questions/194156", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4857/" ]
Are you only interested in GUIs? A lot of research has been done and continues to be done on [tangible interfaces](http://en.wikipedia.org/wiki/Tangible_User_Interface) for example, which fall outside of that category (although they can include computer graphics). The [User Interface Wikipedia](http://en.wikipedia.org/...
Technically, the interface you are looking for may be called **Post-WIMP user interfaces**, according to [a paper of the same name](http://portal.acm.org/citation.cfm?id=253708) by Andries van Dam. The reasons why we need other paradigms is that WIMP is not good enough, especially for some specific applications such as...
6,800,631
I want to send the xml file to .net web service but it did not work. In my project i have created xml file by using DOM Object. I want to send that Dom object to the server but It doent work. I also used Ksoap2 jar file in my project. Please help me how to send the xml file to .net server. Here is my code: ``` packag...
2011/07/23
[ "https://Stackoverflow.com/questions/6800631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859255/" ]
Yes. You are using parameterized queries, which are in general considered safe from SQL injection. You may still want to consider filtering your inputs anyway.
Yes, all the non-static data is being fed in via bound parameters.
8,911,684
I want to submit a s:form when page loads. here is my code : ``` <s:form id="login_form" action="" method="post"> <s:textfield label="User name" id="login_form_username" name="username" value="abc.xyz" cssClass="txtbox" required="true" /> <s:password label="Password" id="login_form_pass...
2012/01/18
[ "https://Stackoverflow.com/questions/8911684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130032/" ]
you can use Jquery code: ``` document.ready(function(){ $("#login_form").submit(); }); ``` dont forget to specify action attribute of form. Note: to use jquery you need to add jquery library.
If you want to submit through java script means you have to give code like this eg: If your from name is **\*login\_form\*** in java script then you can give like this ``` function submitform() { document.forms["login_form"].submit(); } <s:form id="login_form" name="login_form" action="your action name" method="...
2,275,876
I need to extract the contents of the title tag from an HTML page displayed in a UIWebView. What is the most robust means of doing so? I know I can do: ``` - (void)webViewDidFinishLoad:(UIWebView *)webView{ NSString *theTitle=[webView stringByEvaluatingJavaScriptFromString:@"document.title"]; } ``` However, tha...
2010/02/16
[ "https://Stackoverflow.com/questions/2275876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/190807/" ]
`WKWebView` has 'title' property, just do it like this, ``` func webView(_ wv: WKWebView, didFinish navigation: WKNavigation!) { title = wv.title } ``` I don't think `UIWebView` is suitable right now.
I dońt have experience with webviews so far but, i believe it sets it´s title to the page title, so, a trick I suggest is to use a category on webview and overwrite the setter for self.title so you add a message to one of you object or modify some property to get the title. Could you try and tell me if it works?
43,991,608
I'm a rookie so forgive me if this is obvious. I'm trying to access class attributes from a separate class file, as you can probably tell from the title. I run into a problem when calling the class. ``` class Example: def __init__(self, test): self.test = test ``` Say test is the attribute I ...
2017/05/16
[ "https://Stackoverflow.com/questions/43991608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7826175/" ]
You need to restore NuGet packages before attempting the build to resolve references to the reference assemblies that provide you the core types. You can do this using `msbuild /t:Restore` (TFS/VSTS: use msbuild task) or `nuget.exe restore` (use a nuget.exe >= 4.0.0).
There must be some issue within the latest Visual Studio 2017. They, the Microsoft, change the project file structure of .Net Core / standard a lot from 2017 RC to current one.
6,659,445
I want to avoid my child form from appearing many times when a user tries to open the child form which is already open in MDIParent. One way to avoid this is by disabling the Controller (in my case BUTTON) but I have given a shortcut key (`Ctrl`+`L`) for this function as well. So if the user types `Ctrl`+`L`, the same ...
2011/07/12
[ "https://Stackoverflow.com/questions/6659445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/818355/" ]
``` frmWebLeads formWeblead; bool isformWebleadOpen =false; private void leadsToolStripMenuItem_Click(object sender, EventArgs e) { if(isformWebleadOpen == false) { formWeblead = new frmWebLeads(); isformWebleadOpen =true; formWeblead.Closed += formWeblead_Closed; ...
The easiest way is to keep a reference to the child form, and only spawn a new one if it doesn't already exist. Something like this: ``` class ParentForm : Form { frmWebLeads formWeblead = null; //... private void leadsToolStripMenuItem_Click(object sender, EventArgs e) { if(formWeblead != n...
3,404,642
I want to have access to the same message that Powershell prints when you send an error record to the output stream Example: > > This is the exception message At > C:\Documents and > Settings\BillBillington\Desktop\psTest\exThrower.ps1:1 > char:6 > + throw <<<< (New-Object ArgumentException("This is the > excep...
2010/08/04
[ "https://Stackoverflow.com/questions/3404642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24773/" ]
I took it a bit further because I didn't like the multilines from $error[0].InvocationInfo.PositionMessage. ``` Function FriendlyErrorString ($thisError) { [string] $Return = $thisError.Exception $Return += "`r`n" $Return += "At line:" + $thisError.InvocationInfo.ScriptLineNumber $Return += " char:" + ...
``` Foreach ($Errors in $Error){ #Log Eintrag wird zusammengesetzt und in errorlog.txt geschrieben "[$Date] $($Errors.CategoryInfo.Category) $($Errors.CategoryInfo.Activity) $($Errors.CategoryInfo.Reason) $($Errors.CategoryInfo.TargetName) $($Errors.CategoryInfo.TargetType) $($Errors.Exception.Message)" |Add-Conten...
25,454,559
Currently I'm using ``` data-parsley-`constraint`-message="English sentence goes here" ``` but now that I'm working to add localization these messages will never be translated using the i18n library because they are custom. Is there a way to add something like ``` data-parsley-`constraint`-message-fr="Francais fra...
2014/08/22
[ "https://Stackoverflow.com/questions/25454559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/923934/" ]
Why don't you use the localization of Parsley instead of defining the messages on the inputs? I suggest you download the localizations that you need [from the source](https://github.com/guillaumepotier/Parsley.js/tree/master/src/i18n). After that, [according to the docs](http://parsleyjs.org/doc/index.html#psly-instal...
You only put -message after your attribute of parsley which is you used for validation. for example, ``` <input type="password" name="cpassword" id="cpassword" class="form-control" placeholder="Enter confirm password" data-parsley-equalto="#password" data-parsle...
118,833
First time player playing as a tempest cleric. As I understand the rules, a cleric of any domain has access to all the general cleric spells (i.e. not the ones that are only accessible to certain domains). However, my DM informed me that my god (custom storm god that he made up) would not allow me to cast Animate Dea...
2018/03/20
[ "https://rpg.stackexchange.com/questions/118833", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/42418/" ]
> > Are there any official sources that these rules are based off? > > > Not that I know of. This does indeed seem to be a homebrew approach. You might want to ask your DM to write down the full Cleric spell list that you are allowed to use; it'll cut down on arguments later if you feel they're just removing spe...
No, all clerics can cast cleric spells regardless of domain. ============================================================ The [Divine Domain](https://www.dndbeyond.com/classes/cleric#DivineDomain-109) feature description reads: > > Choose one domain related to your deity: Knowledge, Life, Light, Nature, Tempest, Tri...
21,366
The Chinese idiom " 不翼而飞" contains the character 翼 meaning wings, but how could one fly without wings? Here 不翼 = 无翼 ? I'm confused. I am aware of the fact that the saying means "vanish into the air or disappear without trace". Thanks.
2016/10/06
[ "https://chinese.stackexchange.com/questions/21366", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/11212/" ]
I don't study language, here is what I think: Idioms, or rather, Classical Chinese is grammatically much different than Modern Chinese. Back then, you can have a greater freedom on how you write and words with similar meanings can be used alternatively but in Modern Chinese, we tend to centralize meanings of character...
翼 = Wing Yes, here, 不翼 = 无翼 It basically means something is gone in a weird way. For example, you could swear you left something at a certain place and you couldn't find it. You would use this phrase.
14,683,963
Each and every time I start Microsoft Office 2010 I get a Security Alert saying that there is a problem with the security certificate for `autodiscover.xxx.xxx`. I have followed the Certificate installation wizard to install the certificate on my machine, but even after a restart of the application I am still being pro...
2013/02/04
[ "https://Stackoverflow.com/questions/14683963", "https://Stackoverflow.com", "https://Stackoverflow.com/users/691505/" ]
Yes, the server certificate needs to be renewed. However, it also looks like that certificate does not have a *Subject Alternative Name* entry for autodiscover.yourdomain.com, which is the second problem shown in the screenshot. The CAS server(s) should have at a minimum the OWA FQDN (e.g. webmail.yourdomain.com) and ...
I encountered this problem and tried to resolve it by importing the valid unexpired self signed certificate into "Trusted Root Certification Authorities" from the Certificate Warning dialogue, but the certificate did not import even though it said "Import Successful". I successfully imported the certificate through "In...
5,283,770
well I have 3 LinkButton ``` <asp:LinkButton ID="lnkEdit" runat="server" Text="Edit Record" OnClientClick='ControlVisible();'/> <asp:LinkButton ID="lnkSave" runat="server" Text="Save" Visible="false" /> <asp:LinkButton ID="lnkCancel" runat="server" Text="Cancel" Visible="false" /> ``` when I'll click to lnkEdit but...
2011/03/12
[ "https://Stackoverflow.com/questions/5283770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/626157/" ]
ASP .NET automatically includes the IDs of the parent elements when generating an ID for an element. The generated HTML will have IDs following this kind of format: `ctl00$MainContent$txtSymbol`. So, the default DOM function `getElementById` won't find an element if you only use the last ID. Source Element: ``` <asp:...
If the controls are inside a container, the id of the container will be prepended to the if of the conbtrol to create a client id that is unique. You can use the `ClientID` property to find out the generated id: ``` var Edit = document.getElementById("<%=lnkEdit.ClientId%>"); var Save = document.getElementById("<%=l...
22,881,934
I'm trying to extract the file extension part in a string value. For example, assuming the string value is "file.cpp", I need to extract the "cpp" or ".cpp" part. I've tried using strtok() but it doesn't return what I am looking for.
2014/04/05
[ "https://Stackoverflow.com/questions/22881934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2357327/" ]
This will work, but you'll have to be sure to give it a valid string with a dot in it. ``` #include <iostream> // std::cout #include <string> // std::string std::string GetExtension (const std::string& str) { unsigned found = str.find_last_of("."); return str.substr( found + 1 ); } int main () { ...
Here is a simple C implementation: ``` void GetFileExt(char* ext, char* filename) { int size = strlen(filename); char* p = filename + size; for(int i=size; i >= 0; i--) { if( *(--p) == '.' ) { strcpy(ext, p+1); break; } } } int main() { char ext[10]; char filename[] = "nome_d...
24,353,736
I have this jquery ``` $(".waitingTime .button").click(function () { alert("Ema"); }); ``` I have a `a` tag like this: ``` <a href="{{ URL::to('restaurants/20') }}"></a> ``` Can I do the same `href` action in the jquery function? Many Thanks
2014/06/22
[ "https://Stackoverflow.com/questions/24353736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3722029/" ]
yes this is possible and has nothing to do with Laravel. There are different possibilities. If your query is embedded within the same laravel view, you put the URL directly in your jQuery code, for example like this: ``` $(".waitingTime .button").click(function () { window.location.href = "{{URL::to('restaurants/20'...
Just output php in your javascript ``` $(".waitingTime .button").click(function () { window.location.href = "<?php echo URL::to('restaurants/20'); ?>"; }); ```
17,463,037
I have an [MSI](http://en.wikipedia.org/wiki/Windows_Installer) file created with [WiX](http://en.wikipedia.org/wiki/WiX), that intalls my executables and copies a configuration file, that placed near the MSI file. I can change configuration file before installation and the changed version will be copied to installatio...
2013/07/04
[ "https://Stackoverflow.com/questions/17463037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/356605/" ]
Ok. With the comments, we might go for something like that (assuming you have a navigation property in `EntityProperties` table, which is a collection of `PropertyValues`, and named `PropertyValueList` (if you don't have, just do a join instead of using `Include`). Here is some sample code, really rustic, **working on...
My answer depends on whether you are happy to alter your access model slightly. I've got a similar situation in an application that I have written and personally I don't like the idea of having to rely on my calling code to correctly filter out the records based on the users authentication. My approach was to use an ...
18,145,360
This is a C program that i am trying to make print a list of ASCII characters. I could make the program print a range of numbers, bit i cannot get it to print the ASCII value of each number in the list. ``` #include <stdio.h> #define N 127 int main(void) { int n; int c; for (n=32; n<=N; n++) { ...
2013/08/09
[ "https://Stackoverflow.com/questions/18145360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300216/" ]
Have a look at [`printf` formats](http://www.cplusplus.com/reference/cstdio/printf/). Indeed, `%d` is used to print signed decimal integers. You want to print the corresponding character, so the format you are looking for is `%c`. So it gives : ``` printf("%d", c); ```
Final solution ============== --- I tried to make it so compact (although not obfuscated) as possible. -------------------------------------------------------------------- --- ``` #include <stdio.h> int main() { // for loop // outputs |data type| // for(int i...
240,571
### Task A *reverse checkers* position is a chess position where every piece for one player is on one colour and every piece for the other player is on the other colour. Your task is to find if the given (valid) position meets these criteria. For example, this position does (click for larger images). Every white piec...
2022/01/04
[ "https://codegolf.stackexchange.com/questions/240571", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/85914/" ]
[Jelly](https://github.com/DennisMitchell/jelly), 9 bytes ========================================================= ``` ŒJ§ḂṬƙFṀḊ ``` [Try it online!](https://tio.run/##y0rNyan8///oJK9Dyx/uaHq4c82xmW4PdzY83NH1/3D70UkPd87QjPz/P5orOtpIR8EAhhDsWB0uhWgDJCmIrCGQBEsZYYoj6TJCEoeqQTIQoR5JF0QlOgnTZYhkHVQWSZcBmmwsUA7oM0znYzoE...
[Pari/GP](http://pari.math.u-bordeaux.fr/), 50 bytes ==================================================== ``` a->sum(n=0,1,!matrix(8,,i,j,(i+j+n+t=a[i,j])%2*t)) ``` [Try it online!](https://tio.run/##lY7BCsMgEER/xQYK2mzAeCosyY8ED15SDE2Q1EL79dZobDW3siw6M@I8o1bd3IwbSedU0z@eM106Di2cZmVX/aJXAA0TUF1P9VLbTg1eSnYWF8uYU8bc3...
35,784,936
I'm trying to write a function that takes an input list and two integers as parameters, the function should then return a two-dimensional list with the rows and columns of the list being specified by the two input integers. e.g. if the input list is `[8, 2, 9, 4, 1, 6, 7, 8, 7, 10]` and the two integers are 2 and 3 the...
2016/03/03
[ "https://Stackoverflow.com/questions/35784936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6009386/" ]
Here's a solution for you: ``` def one_to_2D(some_list, r, c): return [[some_list[j] for j in range(c*i, c*(i+1))] for i in range(r)] ``` Examples: ``` In [3]: one_to_2D([8, 2, 9, 4, 1, 6, 7, 8, 7, 10], 2, 3) Out[3]: [[8, 2, 9], [4, 1, 6]] In [4]: one_to_2D([8, 2, 9, 4, 1, 6, 7, 8, 7, 10], 3, 3) Out[4]: [[8, 2...
``` In [10]: reshaped = [some_list[i:i+c] for i in range(0,r*c, c)] [[8, 2, 9], [4, 1, 6]] ```
54,520,304
here what i am doing is i am creating a "Drag n Drop feature" using ng2 file upload and here my issue is when ever im trying to drop more than one file the select all function will be enabled and it will select all check boxes by default but that is not happening in my scenario after file drop <https://stackblitz.com/...
2019/02/04
[ "https://Stackoverflow.com/questions/54520304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10385262/" ]
This works in your StackBlitz: See: <https://stackblitz.com/edit/angular-rtzkhd> ``` constructor(){ this.uploader.onAfterAddingAll = () => { this.selectedFilesArray = []; this.uploader.queue.forEach(fileItem => { this.fileSelectState[fileItem.file.name] = true; }); } } ```
``` constructor(){ this.uploader.onAfterAddingAll = () => { this.selectedFilesArray = []; this.uploader.queue.forEach(fileItem => { this.fileSelectState[fileItem.file.name] = true; }); } } ```
21,997,587
This is my first work with web scraping. So far I am able to navigate and find the part of the HTML I want. I can print it as well. The problem is printing only the text, which will not work. I get following error, when trying it: `AttributeError: 'ResultSet' object has no attribute 'get_text'` Here my code: ``` fro...
2014/02/24
[ "https://Stackoverflow.com/questions/21997587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2212634/" ]
`find_all()` returns an array of elements. You should go through all of them and select that one you are need. And than call `get_text()` **UPD** For example: ``` for el in soup.find_all('div', attrs={'class': 'fm_linkeSpalte'}): print el.get_text() ``` But note that you may have more than one elemen...
Try `for` inside the list for getting the data, like this: ``` zeug = [x.get_text() for x in soup.find_all('div', attrs={'class': 'fm_linkeSpalte'})] ```
60,970,479
I think I have my head wrapped around the Javascript callback functions when it comes to one on one, i.e. ``` funcA // generates some params needed for funcB funcB ``` Can be implemented as ``` function funcA (Aparams callback) { //some processing using Aparams to generate params callback(par...
2020/04/01
[ "https://Stackoverflow.com/questions/60970479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9543847/" ]
You seem to be looking for ``` funcA(something, function(aResults) { funcB(aResults); funcC(aResults); }); ```
Do you really need a callback to achieve it. you can use. ``` let A_res = funcA(param); funcB(A_res); funcC(A_res); // This is suitable in All when there is no async Process in funcA... ``` Now definitely in case of async process in funcA you need a call back... ``` function funcA(param){ // processing... let...
42,854
Will the voice dictation technology built into iOS 5.1 running on the new iPad be made available on the iPad 2?
2012/03/07
[ "https://apple.stackexchange.com/questions/42854", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/7961/" ]
It's too bad Apple decided not to include this technology in the iPad 2. I'm dictating this response on Dragon and works just fine. The iPad 2 has ample horsepower to support dictation. It's unfortunate that many perceive the dictation function was excluded for obvious marketing reasons, but the iPhone 4S features adv...
Maybe it needs to be enabled in settings? See here: <http://9to5mac.com/2012/01/09/looks-like-apple-is-working-on-siri-dictation-for-the-ipad-ios-5-1-beta-reveals/>
40,762,688
could anyone help me with following problem: I have a tab delimited file that doesn’t have the same number of columns in every row. I need to divide the value in first column subsequently by the values in all other columns. As a result I would like to get the final number to a new file. example\_file.txt > > > ...
2016/11/23
[ "https://Stackoverflow.com/questions/40762688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7199260/" ]
Use a loop to go through the other columns, then divide: ``` awk '{ val = 1; for (i = 2; i <= NF; ++i) val *= $i; print $1 / val }' file ``` Or just do successive divisions, again with a loop: ``` awk '{ for (i = 2; i <= NF; ++i) $1 /= $i; print $1 }' file ``` It's up to you how you want to treat the presence of ...
With `perl` ``` $ cat ip.txt 0.002 0.2 0.2 0.6 0.03 0.3 0.7 0.004 0.1 0.2 0.005 0.3 0.005 $ perl -lane '$a=$F[0]; $a /= $_ foreach (@F[1..$#F]); print $a' ip.txt 0.0833333333333333 0.142857142857143 26666.6666666667 ``` Limiting decimal points: ``` $ perl -lane '$a=$F[0]; $a /=...
17,737,840
I'm trying to edit my gridview header title however, unfortunately it doesn't work ``` SqlConnection conn = new SqlConnection(); conn.ConnectionString = "Data Source = localhost; Initial Catalog = project; Integrated Security= SSPI"; conn.Open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter("SE...
2013/07/19
[ "https://Stackoverflow.com/questions/17737840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2316009/" ]
You can do it by simply using column alias in your select SQL, no need to do it from code. ``` SELECT policeid as [Police ID] , password as [Password] ............... ```
The columns property is a zero based array. Unless there is a hidden first column you are starting at 1. Re-number the indices to 0-7 instead of 1-8. <http://msdn.microsoft.com/en-US/library/system.windows.forms.datagridview.columns(v=vs.80).aspx> ``` GVVerify.Columns[0].HeaderText = "Police ID "; GVVerify.Co...
39,246,308
I'm trying to automate the process of installing some Android SDK tools through a Gradle script. The idea is to run this build.gradle script within a Docker machine which will prepare the environment before issuing the main build itself. The problem I'm having is with automatically accepting the licenses for the rele...
2016/08/31
[ "https://Stackoverflow.com/questions/39246308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1702942/" ]
Your problem is that the exec task in Gradle does not know about pipes, so what you have written is simply passing a number of strings to echo; the "y", the pipe "|", the android path, the update command, etc. One way to do this is to put the command you want to execute that contains pipes or other shell redirections ...
We have this command, which works perfectly for us: ``` ( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) \ | android update sdk --all -u -t ```
14,504,423
I am reading the Modern C++ Design by Andrei, where it is mentioned that ``` "Pointers to allocated objects does not have a value semantics" ``` For Value semantic example, it is mentioned that 'int' is perfect. so ``` int x = 200, y; y = x; ``` **My Question?** 1) What is the parameter to be considered so th...
2013/01/24
[ "https://Stackoverflow.com/questions/14504423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/916439/" ]
The phrase "value semantics" is widely used, but generally rather loosely defined. I think Scott Meyers had about as good of a definition as any: "do as the ints do." In other words, an object with value semantics is one that you can treat pretty much like an int, and if you do so, it generally won't do anything surpr...
SEE [Value-semantics here](http://www.parashift.com/c++-faq/val-vs-ref-semantics.html). In other words, a pointer (or reference) to an object is not a new unique object, but the pointer refers to the original object you made it point to. So as such, you will have to be careful with pointers, so you make sure you know...
112,387
Having screwwed up my permissions by trying to have two users accessing one home folder I'm now going through the process of reseting my main user home permissions via the OSX install disk utilities, which seems to be taking a while. Does this process take a while to do, though I assume it depends on how many files I ...
2010/02/23
[ "https://superuser.com/questions/112387", "https://superuser.com", "https://superuser.com/users/18636/" ]
Depends on how many files you have. If you have a ton of smaller files in your profile folder (bits of source code, multi-part archives) it'll take quite awhile. If you're a normal user, it shouldn't take too long at all. Maybe 15 minutes, at the most.
Am I missing something here, or would `sudo chown [your username] ~/` from your home folder do the job?
37,719,823
We are attempting to modify the default Woocommerce Checkout Shipping City Field using the documented methods on [docs.woothemes](https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/) but have run into an issue. We have replaced the `shipping_city` text field with a `sele...
2016/06/09
[ "https://Stackoverflow.com/questions/37719823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1747169/" ]
This should work with `woocommerce_form_field_args` hook, this way: ``` add_filter( 'woocommerce_form_field_args', 'custom_form_field_args', 10, 3 ); function custom_form_field_args( $args, $key, $value ) { if ( $args['id'] == 'billing_city' ) { $args = array( 'label' => __( 'Suburb/City', 'wooco...
Put this code into your child theme function.php and should do the job ``` $city_args = wp_parse_args( array( 'type' => 'select', 'options' => array( 'city1' => 'Amsterdam', 'city2' => 'Rotterdam', 'city3' => 'Den Haag', ), ), $fields['shipping']['shipping_city'] ); $fields['ship...
538,711
I have a point class like: ``` class Point { public: int x, y; Point(int x1, int y1) { x = x1; y = y1; } }; ``` and a list of points: ``` std::list <Point> pointList; std::list <Point>::iterator iter; ``` I'm pushing points on to my pointList (although the list might contain no Poi...
2009/02/11
[ "https://Stackoverflow.com/questions/538711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/64878/" ]
Use a std::list::iterator variable to keep track of the closest point as you loop through the list. When you get to the end of the list it will contain the closest point and can be used to erase the item. ``` void erase_closest_point(const list<Point>& pointList, const Point& point) { if (!pointList.empty()) {...
You can do this using a combination of the STL and [Boost.Iterators](http://www.boost.org/doc/libs/1_38_0/libs/iterator/doc/index.html) and [Boost.Bind](http://www.boost.org/doc/libs/1_38_0/libs/bind/bind.html) -- I'm pasting the whole source of the solution to your problem here for your convenience: ``` #include <lis...
65,415
This is something I don't understand. Are they trying to hide their identities? How many turtles are there that can stand on their feet? Is it because they are ninjas? Again the shell is a big give away.
2014/08/11
[ "https://scifi.stackexchange.com/questions/65415", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/31522/" ]
The only answer I can give is an out of universe one (I'd love someone to answer in-universe!). The turtles are colour coded: * Leonardo - Blue * Donatello - Purple * Michelangelo - Orange * Raphael - Red In the original comics the characters had no voices (clearly) so their weapons were the only other way to distin...
Ninjas wear masks! Like in the movie *3 ninjas*, they wore masks. Its also so we can identify them.
1,371,261
How could I retrieve the current working directory/folder name in a bash script, or even better, just a terminal command. `pwd` gives the full path of the current working directory, e.g. `/opt/local/bin` but I only want `bin`.
2009/09/03
[ "https://Stackoverflow.com/questions/1371261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86024/" ]
Surprisingly, no one mentioned this alternative that uses only built-in bash commands: ``` i="$IFS";IFS='/';set -f;p=($PWD);set +f;IFS="$i";echo "${p[-1]}" ``` As an **added bonus** you can easily obtain the name of the parent directory with: ``` [ "${#p[@]}" -gt 1 ] && echo "${p[-2]}" ``` These will work on Bash...
Just remove any character until a `/` (or `\`, if you're on Windows). As the match is gonna be made greedy it will remove everything until the last `/`: ``` pwd | sed 's/.*\///g' ``` In your case the result is as expected: ``` λ a='/opt/local/bin' λ echo $a | sed 's/.*\///g' bin ```