qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
556,662
We know that black holes are actually "black" because no light can escape them due to their gravity and that's why they appear black. That means the mass of the black hole most be extremely large even in a cosmological scale. If light cannot escape black holes due to the their gravity, and the more massive an object ...
2020/06/02
[ "https://physics.stackexchange.com/questions/556662", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/266351/" ]
The intuition that a black hole must have a very large mass is not true. The relevant parameter is how much mass is there within a (volume of some characteristic) radius. In the case of simple spherical objects, if a mass $M$ is concentrated within a radius $2GM/c^2$ then light (or anything else for that matter) cannot...
what makes a black hole is how much mass is squeezed down into *how much space*, which establishes how strong the force of gravity is *at its surface*. That in turn determines its *escape velocity*; once the escape velocity equals the speed of light, a black hole forms. If you squeezed the earth down to the size of a...
21,036,530
How to prevent duplication in dropdownlist using JSTL . ``` <select class="abc" name="folder" > <c:forEach items="${model.abc}" var="folder" varStatus="status"> <option value="${folder}">${folder}</option> </c:forEach> </select> ``` Suppose my model object abc is having some data like : Folder :"abc" , "bcd", "abc"...
2014/01/10
[ "https://Stackoverflow.com/questions/21036530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2439770/" ]
Yes,if you need to use BackgroungAudioPlayer, it is necessary to create another project for AudioPlayer and add reference of it to your project. Through MediaPlayer you can play files from medialibrary or IsolatedStorage. So,for you it is necessary to follow those steps.Hope this helps.
Use the media element tag from the Windows Phone 8 Toolbox: You should be able to achieve this without any difficulty, But it will not run in the background.
43,204,496
We are trying to SET pickled object of size 2.3GB into redis through redis-py package. Encountered the following error. > > BrokenPipeError: [Errno 32] Broken pipe > > > redis.exceptions.ConnectionError: Error 104 while writing to socket. Connection reset by peer. > > > I would like to understand the root cause...
2017/04/04
[ "https://Stackoverflow.com/questions/43204496", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2621477/" ]
Redis' String data type can be at most 512MB.
The issue is with the data size being passed to Redis. The command is sent to Redis as two items follows the RESP Standards item #1 ``` b'*3\r\n$3\r\nSET\r\n$8\r\nsome_key\r\n$2460086692\r\n' Where *3 - indicates RESP array of three elements \r\n - indicates the RESP Carriage return Line F...
57,352,744
Suppose i have a code that validates the username ``` oValidationManager.sUsername = document.getElementById('username'); validateUsername: function () { oValidationManager.sUsername.addEventListener('focus', function(event){ oValidationManager.sUsername.style.borderColor = '#FF0...
2019/08/05
[ "https://Stackoverflow.com/questions/57352744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9934276/" ]
Try doing this without event listeners. Rather than changing the css properties directly try adding and removing classes. Do your error check and if there is one add a class like `.invalid` to the input. Then just have a different style for that class. CSS: ```css .input-field{ border: 2px solid transparent; } .i...
```css input:invalid { background-color: red; } ``` ```html <input type="email"> ```
206,471
We have mocap animations and when adding those animations to characters in unity their lower bodies get twisted like that. But when I import those animatinos to Blender to inspect they don't have such problem. Also I remember, we asked another person to look at these animatinos in another 3D software and he said, he sa...
2020/12/29
[ "https://blender.stackexchange.com/questions/206471", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/113674/" ]
You need to override the context. Context properties are described [here](https://docs.blender.org/api/current/bpy.context.html). And more specifically, for particle settings, [here](https://docs.blender.org/api/current/bpy.context.html#bpy.context.particle_settings). To make it work, just add the following to your co...
**Some further notes on this.** AFAIC @lemon has provided the answer re which member is required to override. This is a little TL;DR ...looked at this prior to answer having tried "particle\_system"., didn't work, put in the look at later. The properties panel has what is known as 'BUTTONS' context which contains `pa...
37,160,808
I have Websphere Portal 8.5.5.2 Cluster of 2 Windows Server Nodes. I have a separate Jenkins Build Server (also windows), I configured the plugin correctly and click test connection returns connection successful. when running build now to deploy the ear file it returns an error: ``` 13:51:31 Started by user Jenkins 13...
2016/05/11
[ "https://Stackoverflow.com/questions/37160808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6319840/" ]
Try This: ``` .card.noradius { border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.1); -webkit-background-clip: padding-box; background-clip: padding-box; } ```
i think you need like this ```css body { background : #0c1013; font-family : arial; } .card { margin: 0 auto 2em; padding: 2em; width: 80%; border-radius:10px; background-color: #f2f2f2; word-wrap: break-word; box-shadow: 0 0.0625em 0.1875em 0 rgba(0, 0, 0, 0.1), 0 0.5em 0 -0.25em #6C7071...
37,160,808
I have Websphere Portal 8.5.5.2 Cluster of 2 Windows Server Nodes. I have a separate Jenkins Build Server (also windows), I configured the plugin correctly and click test connection returns connection successful. when running build now to deploy the ear file it returns an error: ``` 13:51:31 Started by user Jenkins 13...
2016/05/11
[ "https://Stackoverflow.com/questions/37160808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6319840/" ]
If you don't need to use box shadow for the card effect, you can use the after and before pseudo elements to gain more control of the lower cards border radii: ```css body { background: #0c1013; font-family: arial; } .card { position: relative; margin: 0 auto 2em; width: 80%; } .card .inner { pad...
Try This: ``` .card.noradius { border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.1); -webkit-background-clip: padding-box; background-clip: padding-box; } ```
37,160,808
I have Websphere Portal 8.5.5.2 Cluster of 2 Windows Server Nodes. I have a separate Jenkins Build Server (also windows), I configured the plugin correctly and click test connection returns connection successful. when running build now to deploy the ear file it returns an error: ``` 13:51:31 Started by user Jenkins 13...
2016/05/11
[ "https://Stackoverflow.com/questions/37160808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6319840/" ]
If you don't need to use box shadow for the card effect, you can use the after and before pseudo elements to gain more control of the lower cards border radii: ```css body { background: #0c1013; font-family: arial; } .card { position: relative; margin: 0 auto 2em; width: 80%; } .card .inner { pad...
i think you need like this ```css body { background : #0c1013; font-family : arial; } .card { margin: 0 auto 2em; padding: 2em; width: 80%; border-radius:10px; background-color: #f2f2f2; word-wrap: break-word; box-shadow: 0 0.0625em 0.1875em 0 rgba(0, 0, 0, 0.1), 0 0.5em 0 -0.25em #6C7071...
917,355
I'm hosting a webpage with Apache on a Raspberry Pi (Debian), and can't seem to get the server to issue the current certificate. I generated a self-signed SSL certificate in `/home/pi/ssl/` with: ``` openssl req -new -sha256 -x509 -nodes -days 365 -out example.com.pem -keyout example.com.key ``` Apache looks up the ...
2015/05/20
[ "https://superuser.com/questions/917355", "https://superuser.com", "https://superuser.com/users/210314/" ]
It turns out the certificate being issued was for some reason the default Apache "snakeoil" certificate. I established this by: ``` grep -i -r "SSLCertificateChainFile" /etc/apache2/ ``` .. which returned 2 lines from file `/etc/apache2/sites-available/default-ssl` that referenced the snakeoil certificate. I comment...
A common source of such problems is multiple running instances of Apache. The config changes are picked up by a process that you (re)start but the request is served by an old process which is running with old configuration. Stop the service: ``` service apache2 stop ``` Check if the site is still accessible. If yes...
7,870
I am currently enrolled in a circuit training gym and just 'leveled up' to level 3 last month (after about half a year of being in level 1-2 sporadically). I have been more consistent now (2-3 times a week) but now I also attend some yoga and body balance classes to accompany my wife. The current workout consists of 2...
2012/08/29
[ "https://fitness.stackexchange.com/questions/7870", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/4147/" ]
Over emphasis on any one macro nutrient is going to work against you, and it appears you have a big emphasis on carbohydrates. So my answer is not against carbs, but more in keeping everything balanced. **Bottom Line** You have to eat fewer Calories than you burn to lose weight. No amount of carb cycling, ketosis, pa...
Here's something I wrote up for myself a while back...maybe it can help you: CUTTING: - increase water intake - macronutrients become key - increase protein intake - figure out strategy, low carb or carb cycling - more bites per calorie - check progress every 2 weeks - eat the same thing every day if the body can take...
131,002
This may sound a little bit very basic but I would like to know what Sharepoint Provider app is? Is it a component that resides in any server and gets its data from SharePoint? or is it a component that do not use SharePoint at all or if it uses what and how? EDIT:- Wanted to check if a SharePoint app can work without...
2015/02/06
[ "https://sharepoint.stackexchange.com/questions/131002", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/9972/" ]
Here's some links that might help you understand better and get started: <https://msdn.microsoft.com/en-us/library/office/fp142381.aspx> and <https://msdn.microsoft.com/EN-US/library/office/fp179923.aspx> And to better answer the question, provider hosted apps are applications that run in a server that is external to ...
Provider-hosted apps Provider-hosted apps for SharePoint include components that are deployed and hosted outside the SharePoint farm. They are installed to the host web, but their remote components are hosted on another server. ![Provider-hosted app architecture](https://i.stack.imgur.com/NVjkQ.gif) [Choose pattern...
46,022,293
I'm receiving and http post request, with raw body, and I'm trying to read the http body Stream into a String. I'm using the basic Hello World web project generated by the *dotnet web* command. According to the [documentation](http://In%20the%20.NET%20Framework%204%20and%20earlier%20versions,%20you%20have%20to%20use%2...
2017/09/03
[ "https://Stackoverflow.com/questions/46022293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47633/" ]
I found [this question](https://stackoverflow.com/questions/43403941/how-to-read-asp-net-core-response-body) at SO that helped my find the following solution: ``` app.Run(async (context) => { string body = new StreamReader(context.Request.Body).ReadToEnd(); _log.LogInformation($"Body: {body}"); _log.LogIn...
I, too, had issues with ReadAsync stopping short of the full content. My solution is similar to the one offered by [opensas](https://stackoverflow.com/users/47633/opensas), however, I did it with a "using" so the StreamReader's dispose method would be called automatically. I also added the UTF8 encoding option to the S...
44,967,011
I normally work as a Java programmer and I love the fact that with Java alot of the code design is standardized. For example you read Java example about Spring or Hibernate the code structurally looks the same for the whole world. I am now working on ReactJS with redux and I just can't seem to understand it. Every exa...
2017/07/07
[ "https://Stackoverflow.com/questions/44967011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4614579/" ]
Just use `browserHistory.push("page-url");` method to change your route, after success promise
For the error "action needs to be a plain object or something like that" I believe your Redux-thunk is set up incorrectly. `dispatch(performLogin(username, password))` `export function performLogin( username, password ) { return function (dispatch) { return login(username, password) .then(function (response) { dis...
28,933,409
I am new to C#... I am attempting to pass objects between forms using the 'Constructor Method' Here is the constructor for the called/invoked class: ``` public frmPeripheralOptions(List<PeriphItem> PeriphSelect) { // code... } ``` Here is the invoking code: ``` frmPeripheralOptions PeriphForm = new frmPeriphe...
2015/03/09
[ "https://Stackoverflow.com/questions/28933409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4647907/" ]
Just `#include` everywhere you want. If the library is not horribly broken, it will work fine. The library itself is responsible for having mechanisms that make it usable, in case of a header only library that means making it usable by including the header(s). Nothing would make this bad practice, simply using by incl...
Header files will use **include guards** ([Include Guard wiki](http://en.wikipedia.org/wiki/Include_guard)) that keep library functions from being defined twice. Basically, a header file will use a conditional statement that is evaluated during compilation that checks for an existing library definition. If it is define...
32,136,491
I know how to use custom button as Facebook login. Now I'd like to **bind `onlogin` event to customized button**, but I don't know how to do. *Original code* ``` <fb:login-button scope="public_profile,email" onlogin="afterLogin();"> </fb:login-button> <script> /* Assume that Facebook SDK loaded asyncronously an...
2015/08/21
[ "https://Stackoverflow.com/questions/32136491", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3126753/" ]
Assuming you use version 2.4 of the Graph API, you are able to subscribe to an event called [`auth.login`](https://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/v2.4) which is fired whenever the login status changes. So, if you want to react to when the user logs in, you can do this and your fun...
Here's an alternative using `onlogin()` in the way you originally wanted. There's a subtle reason why you may need this: * You are using Facebook login just as a way to login to your own website * User is already connected (has previously connected to your FB) * User is NOT logged into your website. * You don't want ...
2,273,079
If a sequence $\{a\_n\}$ converges to $1$, can you prove that $\{a\_n\}^2$ converges as well? If possible, how? I know the definition of convergence but I am stuck. Thank you.
2017/05/09
[ "https://math.stackexchange.com/questions/2273079", "https://math.stackexchange.com", "https://math.stackexchange.com/users/437446/" ]
We have that $$ |a\_n^2-1|=|a\_n-1||a\_n+1|\to0 $$ since $|a\_n-1|\to0$ and $|a\_n+1|\to2$ as $n\to\infty$. Hence, $a\_n^2\to1$ as $n\to\infty$. Actually, much more is true. If $f$ is a continuous function and $a\_n\to a$ as $n\to\infty$, then $f(a\_n)\to f(a)$ as $n\to\infty$.
The product of two convergent sequences is convergent. So it is true.
6,155,681
In Flex, lets say I have a super-class... something like: ``` class SuperComponent extends DragStack { private var _childReference:UIComponent; public function SuperComponent() { // ??? addEventListener(FlexEvent.CREATION_COMPLETE, onCreationComplete); } private function onCreationComplete(e...
2011/05/27
[ "https://Stackoverflow.com/questions/6155681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/468206/" ]
I'm not sure what type of component DragStack is. Does it extend Container (Flex 3) or Group (Flex4)? If so, then the component will go through it's [lifecycle process](http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_2.html), and myButton should be accessible after createChildren method is...
You can't use `this["myButton"]` from within containers even if `myButton` is a child of that container added in MXML. `myButton` is still not a class property but element of container's children. You'd better [use `getChildByName()`](http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/Container...
8,798
I have a power adapter that works for Great Britain. Can I use the same adapter in Canada and/or the USA too?
2012/08/07
[ "https://travel.stackexchange.com/questions/8798", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
No, you can't. They're different types of adapters. What I do when I need confirmation is to check this website: <http://www.worldstandards.eu/electricity.htm> It has an EXHAUSTIVE list of each and every type, the voltage and the countries that use them. It's been handy for some of the stranger countries I've been t...
No, they are different types of plugs. People in the UK need to buy an adapter to get US or other plugs to work in the UK.
8,798
I have a power adapter that works for Great Britain. Can I use the same adapter in Canada and/or the USA too?
2012/08/07
[ "https://travel.stackexchange.com/questions/8798", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
No, you can't. They're different types of adapters. What I do when I need confirmation is to check this website: <http://www.worldstandards.eu/electricity.htm> It has an EXHAUSTIVE list of each and every type, the voltage and the countries that use them. It's been handy for some of the stranger countries I've been t...
It is not the current that is different between the UK and North America, it is the voltage rating and frequency as expressed in Hertz or Hz. Many devices can handle a range of voltages from 110 volt through to 250 volt and also varying frequencies. However, you need to look at the supply label on each device you are w...
8,798
I have a power adapter that works for Great Britain. Can I use the same adapter in Canada and/or the USA too?
2012/08/07
[ "https://travel.stackexchange.com/questions/8798", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
No, they are different types of plugs. People in the UK need to buy an adapter to get US or other plugs to work in the UK.
It is not the current that is different between the UK and North America, it is the voltage rating and frequency as expressed in Hertz or Hz. Many devices can handle a range of voltages from 110 volt through to 250 volt and also varying frequencies. However, you need to look at the supply label on each device you are w...
8,709,019
I have to develop a Java EE project. I am confused after reading different tutorials on JDBC and Hibernate. After reading those tutorials, I found out both have some pros and cons. Now the problem is how I can decide which one is best? Additionally I'd like to know for which type of project in general I would use JDBC...
2012/01/03
[ "https://Stackoverflow.com/questions/8709019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am not an expert in hibernate though i am just pointing out few points why i prefer hibernate over simple jdbc on my experience. I have used hibernate with JPA annotations in a maven project 1. You can create all your model and define relationships using annotations.Then running one maven command created the entire...
Well Irrespective what type of project you are into, Hibernate will always make your life easier. This brings database operations closer to your domain model. You query database using the convention of java classes, just how you would access fields in java same why you can specify fields in your query (rather than typi...
8,709,019
I have to develop a Java EE project. I am confused after reading different tutorials on JDBC and Hibernate. After reading those tutorials, I found out both have some pros and cons. Now the problem is how I can decide which one is best? Additionally I'd like to know for which type of project in general I would use JDBC...
2012/01/03
[ "https://Stackoverflow.com/questions/8709019", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am not an expert in hibernate though i am just pointing out few points why i prefer hibernate over simple jdbc on my experience. I have used hibernate with JPA annotations in a maven project 1. You can create all your model and define relationships using annotations.Then running one maven command created the entire...
It is not an "either or" situation. There are lots of interesting [ORM solutions](http://sourceforge.net/search/?q=&fq%5B%5D=trove:45&fq%5B%5D=trove:809&fq%5B%5D=trove:198) in addition to Hibernate. I would be less concerned about performance unless you have a particularly db-intensive algorithm. You should consider le...
37,120,615
I'm creating a reaction time game and I've been seeing quite the diversity in results, based on which device I'm using and how many FPS it's running (e.g. PC 60 FPS 0.25 average reaction, Smartphone 30 FPS 0.5 average reaction). I'm working in a 2D environment as shown: [![enter image description here](https://i.stac...
2016/05/09
[ "https://Stackoverflow.com/questions/37120615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6188567/" ]
First of all, try installing the package without using the `-g` flag: ``` npm install jasmine-expect ``` Also, move the `require('jasmine-expect');` from under the `describe` into the `onPrepare()` in your Protractor configuration file: ``` onPrepare: function () { require("jasmine-expect"); }, ```
Ensure the dependency is being added to your package.json file. ``` npm install jasmine-expect --save-dev ```
320,882
Yesterday I posted a question and, between the comments, I noted this: > > I wrote: ok, but for example can a blue laser and a violet laser interfere? I think that there isn't much different between their wavelenghts > > > The answer: Yes, in theory, there can be an interference pattern between them, but this is hi...
2017/03/23
[ "https://physics.stackexchange.com/questions/320882", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/149531/" ]
A key feature of waves is that they move in both space and time. The reason destructive interference is so interesting is that, at certain points in space, the equation for amplitude is 0, independent of time. For those points of destructive interference, it doesn't matter what phase one beam is in, the other beam is a...
I think the point you're missing here at the moment is that these waves are both sinusoidal waves, and their interference pattern will simply be the algebraic sum of both waves. On the second sketch you posted, it's not that the two waves only meet up at two points during any given period and cancel the whole wave out....
48,186,050
I'm trying to run a function within my Sub but am getting a compile error on the line `x = NINOFunction()` and am not sure how to get it working. ``` Sub CheckNINO() Dim NINumber As Range, NINumbers As Range Dim Usdrws As Long, x As Boolean Usdrws = Worksheets("EeeDetails").Range("C" & Rows.Count).End(xlU...
2018/01/10
[ "https://Stackoverflow.com/questions/48186050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8591599/" ]
Your compilation error is "Argument is not optional". This is quite good error message. Thus write `x = NINOFunction(arg)` and put an argument `sInp`. Something like `x = NINOFunction ("something")` or probably you need: `x = NINOFunction (NINumber)` Furthermore, your function always returns `False`, because this i...
`NINOFunction` takes 1 argument, which is a string, but you didn't pass any. Try `x = NINOFunction("something")`
1,449,618
need a simply preg\_match, which will find "c.aspx" (without quotes) in the content if it finds, it will return the whole url. As a example ``` $content = '<div>[4]<a href="/m/c.aspx?mt=01_9310ba801f1255e02e411d8a7ed53ef95235165ee4fb0226f9644d439c11039f%7c8acc31aea5ad3998&amp;n=783622212">New message</a><br/>'; ``` ...
2009/09/19
[ "https://Stackoverflow.com/questions/1449618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/172285/" ]
You use DOM to parse HTML, not regex. You can use regex to parse the attribute value though. Edit: updated example so it checks for c.aspx. ``` $content = '<div>[4]<a href="/m/c.aspx?mt=01_9310ba801f1255e02e411d8a7ed53ef95235165ee4fb0226f9644d439c11039f%7c8acc31aea5ad3998&amp;n=783622212">New message</a> <a href="#b...
If you want to find any quoted string with c.aspx in it: ``` /"[^"]*c\.aspx[^"]*"|'[^']*c\.aspx[^']*'/ ``` But really, for parsing most HTML you'd be better off with some sort of DOM parser so that you can be sure what you're matching is really an href.
23,393,620
Making updates on my website, there are a lot of pages that I don't use left. So I delete them. Unfortunately some slight idexing has been made by search engine so when u type the name of website of mine it appears non more existent pages too in browser results. I need to create a custum 404 page not found that appear...
2014/04/30
[ "https://Stackoverflow.com/questions/23393620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3323340/" ]
Make a .html document in your webserver or website's directory in the htdocs then make a new folder that is called "err", then upload all your Error pages like 404, The page cannot be found or 403, Forbidden. Then place those files in the err folder and re-name them to the error codes. If you are using cPanel then sear...
Create a static page containing your custom message and anything else you want (eg. site layout etc.) and save it somewhere appropriate within your site (eg. from the root: /errors/404.asp). Within that page make sure you write a 404 response header (eg. Response.Status = "404 Page Not found") In IIS (the option will ...
5,731
I'm trying to cut down on the number of profiles in one of my Orgs. One way we're using profiles is to enforce business rules, like "Only a ZZZ user may close opportunities as won," which we do by checking the Profile ID: ``` <validationRules> <fullName>Changing_an_Opp_to_Closed_Won</fullName> <active>true</ac...
2012/12/26
[ "https://salesforce.stackexchange.com/questions/5731", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/63/" ]
I believe such a problem can be solved at the profile level using the new custom Permissions feature and $Permission global variable that is available in Validation Rules/ VF Pages. ``` AND( AND(ISCHANGED(StageName), IsClosed=True, IsWon=True), NOT($Permission.nameofyourperm) ) ``` For more information on...
There is an open Idea to allow the usage of [Users Permission Sets in Formulas, Validation Rules and Lookup Filters](http://success.salesforce.com/ideaView?id=08730000000DcgfAAC). Alternatively, you could create a Field on the User object to store the permission set name. It could be comma separated for multiple permi...
5,731
I'm trying to cut down on the number of profiles in one of my Orgs. One way we're using profiles is to enforce business rules, like "Only a ZZZ user may close opportunities as won," which we do by checking the Profile ID: ``` <validationRules> <fullName>Changing_an_Opp_to_Closed_Won</fullName> <active>true</ac...
2012/12/26
[ "https://salesforce.stackexchange.com/questions/5731", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/63/" ]
There is an open Idea to allow the usage of [Users Permission Sets in Formulas, Validation Rules and Lookup Filters](http://success.salesforce.com/ideaView?id=08730000000DcgfAAC). Alternatively, you could create a Field on the User object to store the permission set name. It could be comma separated for multiple permi...
Found this article - hope it helps. <https://help.salesforce.com/apex/HTViewSolution?id=000221057&language=en_US>
5,731
I'm trying to cut down on the number of profiles in one of my Orgs. One way we're using profiles is to enforce business rules, like "Only a ZZZ user may close opportunities as won," which we do by checking the Profile ID: ``` <validationRules> <fullName>Changing_an_Opp_to_Closed_Won</fullName> <active>true</ac...
2012/12/26
[ "https://salesforce.stackexchange.com/questions/5731", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/63/" ]
I believe such a problem can be solved at the profile level using the new custom Permissions feature and $Permission global variable that is available in Validation Rules/ VF Pages. ``` AND( AND(ISCHANGED(StageName), IsClosed=True, IsWon=True), NOT($Permission.nameofyourperm) ) ``` For more information on...
Found this article - hope it helps. <https://help.salesforce.com/apex/HTViewSolution?id=000221057&language=en_US>
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
Add a check to the top of your Entrypoint script ================================================ Docker really needs to implement this as a new feature, but here's another workaround option for situations in which you have an Entrypoint that terminates after success or failure, which can make it difficult to debug. ...
This is not exactly what you're asking for, but you can use `docker export` on a stopped container if all you want is to inspect the files. ``` mkdir $TARGET_DIR docker export $CONTAINER_ID | tar -x -C $TARGET_DIR ```
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
Add a check to the top of your Entrypoint script ================================================ Docker really needs to implement this as a new feature, but here's another workaround option for situations in which you have an Entrypoint that terminates after success or failure, which can make it difficult to debug. ...
To me Docker always leaves the impression that it was created for a hobby system, it works well for that. If something fails or doesn't work, don't expect to have a professional solution. That said: Docker does not only NOT support such basic administrative tasks, it tries to prevent them. Solution: 1. ``` cd /va...
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
**My Problem:** * I started a container with `docker run <IMAGE_NAME>` * And then added some files to this container * Then I closed the container and tried to start it again withe same command as above. * But when I checked the new files, they were missing * when I run `docker ps -a` I could see two containers. * Th...
To me Docker always leaves the impression that it was created for a hobby system, it works well for that. If something fails or doesn't work, don't expect to have a professional solution. That said: Docker does not only NOT support such basic administrative tasks, it tries to prevent them. Solution: 1. ``` cd /va...
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
Find your stopped container id ============================== ``` docker ps -a ``` Commit the stopped container: ============================= This command saves modified container state into a new image `user/test_image` ``` docker commit $CONTAINER_ID user/test_image ``` Start/run with a different entry point:...
I have found a simple command ``` docker start -a [container_name] ``` This will do the trick Or ``` docker start [container_name] ``` then ``` docker exec -it [container_name] bash ```
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
It seems docker can't change entry point after a container started. But you can set a custom entry point and change the code of the entry point next time you restart it. For example you run a container like this: ``` docker run --name c --entrypoint "/boot" -v "./boot":/boot $image ``` Here is the boot entry point:...
It seems like most of the time people are running into this while modifying a config file, which is what I did. I was trying to bypass CORS for a PHP/Apache server with a Vue SPA as my entry point. Anyway, if you know the file you horked, a simple solution that worked for me was 1. Copy the file you horked out of the ...
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
I took @Dmitriusan's answer and made it into an alias: > > alias docker-run-prev-container='prev\_container\_id="$(docker ps -aq | head -n1)" && docker commit "$prev\_container\_id" "prev\_container/$prev\_container\_id" && docker run -it --entrypoint=bash "prev\_container/$prev\_container\_id"' > > > Add this in...
It seems like most of the time people are running into this while modifying a config file, which is what I did. I was trying to bypass CORS for a PHP/Apache server with a Vue SPA as my entry point. Anyway, if you know the file you horked, a simple solution that worked for me was 1. Copy the file you horked out of the ...
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
Find your stopped container id ============================== ``` docker ps -a ``` Commit the stopped container: ============================= This command saves modified container state into a new image `user/test_image` ``` docker commit $CONTAINER_ID user/test_image ``` Start/run with a different entry point:...
It seems docker can't change entry point after a container started. But you can set a custom entry point and change the code of the entry point next time you restart it. For example you run a container like this: ``` docker run --name c --entrypoint "/boot" -v "./boot":/boot $image ``` Here is the boot entry point:...
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
This is not exactly what you're asking for, but you can use `docker export` on a stopped container if all you want is to inspect the files. ``` mkdir $TARGET_DIR docker export $CONTAINER_ID | tar -x -C $TARGET_DIR ```
To me Docker always leaves the impression that it was created for a hobby system, it works well for that. If something fails or doesn't work, don't expect to have a professional solution. That said: Docker does not only NOT support such basic administrative tasks, it tries to prevent them. Solution: 1. ``` cd /va...
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
I took @Dmitriusan's answer and made it into an alias: > > alias docker-run-prev-container='prev\_container\_id="$(docker ps -aq | head -n1)" && docker commit "$prev\_container\_id" "prev\_container/$prev\_container\_id" && docker run -it --entrypoint=bash "prev\_container/$prev\_container\_id"' > > > Add this in...
I have found a simple command ``` docker start -a [container_name] ``` This will do the trick Or ``` docker start [container_name] ``` then ``` docker exec -it [container_name] bash ```
32,353,055
I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to start a shell so I can inspect the contents of the container. Luckily I created the container with the -it option!
2015/09/02
[ "https://Stackoverflow.com/questions/32353055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150050/" ]
This is not exactly what you're asking for, but you can use `docker export` on a stopped container if all you want is to inspect the files. ``` mkdir $TARGET_DIR docker export $CONTAINER_ID | tar -x -C $TARGET_DIR ```
**My Problem:** * I started a container with `docker run <IMAGE_NAME>` * And then added some files to this container * Then I closed the container and tried to start it again withe same command as above. * But when I checked the new files, they were missing * when I run `docker ps -a` I could see two containers. * Th...
37,707,897
Can help me please to optimize this query in database (access 2010), this query to work very slowly (if use it in a big table): ``` SELECT П1.Code, П1.Field, П1.Number, П1.Data, [П1].[Number]-(select П3.Number from [Table] as П3 where П3.Field = П1.Field ...
2016/06/08
[ "https://Stackoverflow.com/questions/37707897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6290311/" ]
You must use one of this methods to have a secure API * JWT TOKEN <https://github.com/tymondesigns/jwt-auth> * OAUTH2 <https://github.com/lucadegasperi/oauth2-server-laravel> With this methods you only send once username and password and you obtain a token that is valid for a time you can decide. But as bigger is the...
Yes this approach is safe. Additionally you also need to secure your connection to server by using HTTPS with a SSL certificate.
66,011,386
Spending a huge time on this. I have a `tuple` of non-callable `classes`, all named `SymbolInfo`, with same `attribute` labels. Lets say: ``` In: print(my_tuple) Out: (SymbolInfo(att_1=False, att_2=0, att_3=1.0),SymbolInfo(att_1=True, att_2=0, att_3=1.5)) ``` My objective is to create a dataframe from this `tuple`. ...
2021/02/02
[ "https://Stackoverflow.com/questions/66011386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7669782/" ]
Got this solution: ``` my_dict = my_tuple[0]._asdict() my_col_list = list(my_dict.keys()) ```
You can access the attributes (in the order they were added) with the `__dict__` method, like so: ``` class thing(): def __init__(self, att_1, att_2, att_3): self.z_att_1 = att_1 self.att_2 = att_2 self.att_3 = att_3 a = thing('bob', 'eve', 'alice') b = thing('john', 'jack', 'dan') c = (a,...
66,011,386
Spending a huge time on this. I have a `tuple` of non-callable `classes`, all named `SymbolInfo`, with same `attribute` labels. Lets say: ``` In: print(my_tuple) Out: (SymbolInfo(att_1=False, att_2=0, att_3=1.0),SymbolInfo(att_1=True, att_2=0, att_3=1.5)) ``` My objective is to create a dataframe from this `tuple`. ...
2021/02/02
[ "https://Stackoverflow.com/questions/66011386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7669782/" ]
Got this solution: ``` my_dict = my_tuple[0]._asdict() my_col_list = list(my_dict.keys()) ```
Just create a dict from class and then create dataframe: ``` pd.DataFrame(list(map(lambda x: x.__dict__, my_tuple))) ``` And I recommend using `attrs` library for OOP in python.
41,726,072
I have below 2 classes: ``` public class Counter{ private int a; public Counter(String id){ a=0; } public void increment(){ a++; } public int tally(){ return a; } public String toString(){ return "Counter is - " + a; } } ``` ..and ``` /***********...
2017/01/18
[ "https://Stackoverflow.com/questions/41726072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3493490/" ]
I just got six of these in a row. All within a space of ten minutes, and each one was canceled within one minute of the order being received. And all, apparently, from the same user. Google's new interface removes some information that used to be provided to developers in its older interface. We no longer receive a zi...
I think the buyer can cancel/revert the payment fox x minutes after buying something in the Google play store. I have also some cancellations in my payments. But not many.
41,726,072
I have below 2 classes: ``` public class Counter{ private int a; public Counter(String id){ a=0; } public void increment(){ a++; } public int tally(){ return a; } public String toString(){ return "Counter is - " + a; } } ``` ..and ``` /***********...
2017/01/18
[ "https://Stackoverflow.com/questions/41726072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3493490/" ]
This means that "Payment was cancelled during processing by the user or due to a payment issue". You can check more information in [official documents](https://support.google.com/googleplay/android-developer/answer/2741495?hl=en).
I think the buyer can cancel/revert the payment fox x minutes after buying something in the Google play store. I have also some cancellations in my payments. But not many.
41,726,072
I have below 2 classes: ``` public class Counter{ private int a; public Counter(String id){ a=0; } public void increment(){ a++; } public int tally(){ return a; } public String toString(){ return "Counter is - " + a; } } ``` ..and ``` /***********...
2017/01/18
[ "https://Stackoverflow.com/questions/41726072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3493490/" ]
I just got six of these in a row. All within a space of ten minutes, and each one was canceled within one minute of the order being received. And all, apparently, from the same user. Google's new interface removes some information that used to be provided to developers in its older interface. We no longer receive a zi...
Google is currently having issues with In-app purchases: <https://productforums.google.com/forum/#!topic/play/JhGtK_pqKdA> They're charging the user but not giving the money to the developer.
41,726,072
I have below 2 classes: ``` public class Counter{ private int a; public Counter(String id){ a=0; } public void increment(){ a++; } public int tally(){ return a; } public String toString(){ return "Counter is - " + a; } } ``` ..and ``` /***********...
2017/01/18
[ "https://Stackoverflow.com/questions/41726072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3493490/" ]
This means that "Payment was cancelled during processing by the user or due to a payment issue". You can check more information in [official documents](https://support.google.com/googleplay/android-developer/answer/2741495?hl=en).
Google is currently having issues with In-app purchases: <https://productforums.google.com/forum/#!topic/play/JhGtK_pqKdA> They're charging the user but not giving the money to the developer.
41,726,072
I have below 2 classes: ``` public class Counter{ private int a; public Counter(String id){ a=0; } public void increment(){ a++; } public int tally(){ return a; } public String toString(){ return "Counter is - " + a; } } ``` ..and ``` /***********...
2017/01/18
[ "https://Stackoverflow.com/questions/41726072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3493490/" ]
I just got six of these in a row. All within a space of ten minutes, and each one was canceled within one minute of the order being received. And all, apparently, from the same user. Google's new interface removes some information that used to be provided to developers in its older interface. We no longer receive a zi...
Maybe [this article](https://support.google.com/store/answer/2423477?hl=en) will help you. It says: > > It usually takes about an hour for your order to start getting prepared for shipment. During this time the order will be listed as Pending on your order history page. If it is listed as Pending, you can cancel. Yo...
41,726,072
I have below 2 classes: ``` public class Counter{ private int a; public Counter(String id){ a=0; } public void increment(){ a++; } public int tally(){ return a; } public String toString(){ return "Counter is - " + a; } } ``` ..and ``` /***********...
2017/01/18
[ "https://Stackoverflow.com/questions/41726072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3493490/" ]
I just got six of these in a row. All within a space of ten minutes, and each one was canceled within one minute of the order being received. And all, apparently, from the same user. Google's new interface removes some information that used to be provided to developers in its older interface. We no longer receive a zi...
This means that "Payment was cancelled during processing by the user or due to a payment issue". You can check more information in [official documents](https://support.google.com/googleplay/android-developer/answer/2741495?hl=en).
41,726,072
I have below 2 classes: ``` public class Counter{ private int a; public Counter(String id){ a=0; } public void increment(){ a++; } public int tally(){ return a; } public String toString(){ return "Counter is - " + a; } } ``` ..and ``` /***********...
2017/01/18
[ "https://Stackoverflow.com/questions/41726072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3493490/" ]
This means that "Payment was cancelled during processing by the user or due to a payment issue". You can check more information in [official documents](https://support.google.com/googleplay/android-developer/answer/2741495?hl=en).
Maybe [this article](https://support.google.com/store/answer/2423477?hl=en) will help you. It says: > > It usually takes about an hour for your order to start getting prepared for shipment. During this time the order will be listed as Pending on your order history page. If it is listed as Pending, you can cancel. Yo...
10,857,947
I am new at making regular expressions, and so this might just be a stupid oversight, but my regex (that aims to match URL's) is not working. My goal was to have it match any urls like: ``` http://www.somewhere.com somewhere.com https://ww3.some_where-hi.com www.goop.go/herp/derp.lol ``` The regex i built is below, ...
2012/06/01
[ "https://Stackoverflow.com/questions/10857947", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798173/" ]
Validate if a string holds a URL as specified in RFC 3986. Both absolute and relative URLs are supported. This matches your provide sample and more. It also lets you extract the different parts of the url ``` ^ (# Scheme [a-z][a-z0-9+\-.]*: (# Authority & path // ([a-z0-9\-._~%!$&'()*+,;=]+@)? # Us...
use a `[A-z]` instead of `[a-z]` your little `a-z` is only matching lowercase letters.
19,276
I am playing around with Ettercap and [ARP spoofing](http://en.wikipedia.org/wiki/ARP_spoofing) attacks. I have noticed that the computers that are involved in my attack not are displaying any messages telling that an IP conflict has occured. Isn't that the case when ARP spoofing? Then two (or more) computers will sha...
2012/08/25
[ "https://security.stackexchange.com/questions/19276", "https://security.stackexchange.com", "https://security.stackexchange.com/users/7066/" ]
**When ARP Poisoning** You are poisoning the ARP tables. If computer 10.1.1.1 needs to get to computer 10.1.1.2, it keeps the MAC address in its ARP tables. ARP is a *trusting* protocol, which means when a computer responds to a ARP request, there is nothing requiring its response to be correct and no mechanism for ver...
ARP Spoofing is NOT the same as IP address spoofing. What ARP spoofing does is associate a MAC Address with an existing IP Address. The exploit involves sending fake ARP reply packets that will associate the attackers MAC address with a legitimate IP address. This involves making use of the fact that the ARP protocol...
19,276
I am playing around with Ettercap and [ARP spoofing](http://en.wikipedia.org/wiki/ARP_spoofing) attacks. I have noticed that the computers that are involved in my attack not are displaying any messages telling that an IP conflict has occured. Isn't that the case when ARP spoofing? Then two (or more) computers will sha...
2012/08/25
[ "https://security.stackexchange.com/questions/19276", "https://security.stackexchange.com", "https://security.stackexchange.com/users/7066/" ]
Get to the roots ! If you know what [ARP](http://en.wikipedia.org/wiki/Address_Resolution_Protocol) does, things will be clearer. On a subnet (machines plugged into the same set of hubs and switches), the machines talk to each other with MAC addresses: the MAC address uniquely identifies each ethernet/WiFi card. Machi...
ARP Spoofing is NOT the same as IP address spoofing. What ARP spoofing does is associate a MAC Address with an existing IP Address. The exploit involves sending fake ARP reply packets that will associate the attackers MAC address with a legitimate IP address. This involves making use of the fact that the ARP protocol...
19,276
I am playing around with Ettercap and [ARP spoofing](http://en.wikipedia.org/wiki/ARP_spoofing) attacks. I have noticed that the computers that are involved in my attack not are displaying any messages telling that an IP conflict has occured. Isn't that the case when ARP spoofing? Then two (or more) computers will sha...
2012/08/25
[ "https://security.stackexchange.com/questions/19276", "https://security.stackexchange.com", "https://security.stackexchange.com/users/7066/" ]
Get to the roots ! If you know what [ARP](http://en.wikipedia.org/wiki/Address_Resolution_Protocol) does, things will be clearer. On a subnet (machines plugged into the same set of hubs and switches), the machines talk to each other with MAC addresses: the MAC address uniquely identifies each ethernet/WiFi card. Machi...
**When ARP Poisoning** You are poisoning the ARP tables. If computer 10.1.1.1 needs to get to computer 10.1.1.2, it keeps the MAC address in its ARP tables. ARP is a *trusting* protocol, which means when a computer responds to a ARP request, there is nothing requiring its response to be correct and no mechanism for ver...
54,418,479
I have facing this issue when I was changing project name and copying my project from one mac to another. There are some red texts indicate the missing files from the project source codes(But I have all files in Project folder) I have used cocoapods in this project. How to avoid these? Here I have shown my project scr...
2019/01/29
[ "https://Stackoverflow.com/questions/54418479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4062704/" ]
Computed properties are cached based on their dependencies (data, props and other computed properties). If I've understood correctly, your computed property won't be reactive cause the only dependency is myHandle, and I assume that will never change. Look at it this way, Vue can only check that getName is returning a d...
I hope this example will help you ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Page Title</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="app"> <my-component :myhan...
54,418,479
I have facing this issue when I was changing project name and copying my project from one mac to another. There are some red texts indicate the missing files from the project source codes(But I have all files in Project folder) I have used cocoapods in this project. How to avoid these? Here I have shown my project scr...
2019/01/29
[ "https://Stackoverflow.com/questions/54418479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4062704/" ]
I don't know how your implementation of setName() is, but if it is `setName(newName) { this.name = newName; }` you might have run into the problem described here: <https://v2.vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats> I would like to add that it is probably not a good idea to mutate myHandle as a p...
I hope this example will help you ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Page Title</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="app"> <my-component :myhan...
54,418,479
I have facing this issue when I was changing project name and copying my project from one mac to another. There are some red texts indicate the missing files from the project source codes(But I have all files in Project folder) I have used cocoapods in this project. How to avoid these? Here I have shown my project scr...
2019/01/29
[ "https://Stackoverflow.com/questions/54418479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4062704/" ]
Computed properties are cached based on their dependencies (data, props and other computed properties). If I've understood correctly, your computed property won't be reactive cause the only dependency is myHandle, and I assume that will never change. Look at it this way, Vue can only check that getName is returning a d...
I don't know how your implementation of setName() is, but if it is `setName(newName) { this.name = newName; }` you might have run into the problem described here: <https://v2.vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats> I would like to add that it is probably not a good idea to mutate myHandle as a p...
54,418,479
I have facing this issue when I was changing project name and copying my project from one mac to another. There are some red texts indicate the missing files from the project source codes(But I have all files in Project folder) I have used cocoapods in this project. How to avoid these? Here I have shown my project scr...
2019/01/29
[ "https://Stackoverflow.com/questions/54418479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4062704/" ]
Computed properties are cached based on their dependencies (data, props and other computed properties). If I've understood correctly, your computed property won't be reactive cause the only dependency is myHandle, and I assume that will never change. Look at it this way, Vue can only check that getName is returning a d...
There is a simple trick - dummy\_toogle - just place it in your component data: {toggle:false} and in your getter/setter: get: function(){this.toggle; ... } set:function(name){...; this.toggle=!this.toggle;} Now vue will think that computed property is dependent on the toggle and recompute it if toggle is changed + y...
54,418,479
I have facing this issue when I was changing project name and copying my project from one mac to another. There are some red texts indicate the missing files from the project source codes(But I have all files in Project folder) I have used cocoapods in this project. How to avoid these? Here I have shown my project scr...
2019/01/29
[ "https://Stackoverflow.com/questions/54418479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4062704/" ]
I don't know how your implementation of setName() is, but if it is `setName(newName) { this.name = newName; }` you might have run into the problem described here: <https://v2.vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats> I would like to add that it is probably not a good idea to mutate myHandle as a p...
There is a simple trick - dummy\_toogle - just place it in your component data: {toggle:false} and in your getter/setter: get: function(){this.toggle; ... } set:function(name){...; this.toggle=!this.toggle;} Now vue will think that computed property is dependent on the toggle and recompute it if toggle is changed + y...
54,280,712
I'm making an LED control program (using FastLED, of course) and using Serial (with the Serial monitor) to control it. I just connected it via USB and for the most part it works just fine. However, I noticed with the long, flashing routines that I couldn't stop them and make the LEDs do something else. The flash routin...
2019/01/20
[ "https://Stackoverflow.com/questions/54280712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5255218/" ]
You don't send `$_POST['req_new_pw']` and you are asking if it's set. You can use `serialize()` to send all form element by post: ``` <script type='text/javascript'> $("#formoid").submit(function(event) { event.preventDefault(); var $form = $( this ), url = $form.attr( 'action' ); $.aja...
This works like a charm: ``` $("#formoid").submit(function(event) { event.preventDefault(); var form_data = $(this).serialize(); //Encode form elements for submission $.ajax({ type: "POST", url : "data/newpass.php/", data : form_data }); }); ```
27,719
I normally create plan guides by first constructing a query that uses the correct plan, and copying it across to the similar query that doesn't. However, that is sometimes tricky, especially if the query is not exactly the same. What is the right way of creating plan guides from scratch? SQLKiwi has mentioned drawing ...
2012/10/27
[ "https://dba.stackexchange.com/questions/27719", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13073/" ]
In all seriousness you can't cut up xml execution plans from scratch. Creating them using SSIS is science fiction. Yes it's all XML, but they are from different universes. Looking at Paul's blog on that [topic](http://web.archive.org/web/20180404164406/http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-pa...
I found traceflag 8649 (force parallel plan) induced this behaviour for the left-hand guid column on my 2008, R2 and 2012 instances. I didn't need to use the flag on SQL 2005 where the CTE behaved correctly. I tried using the plan generated in SQL 2005 in the higher instances but it wouldn't validate. ``` with cte(gui...
27,719
I normally create plan guides by first constructing a query that uses the correct plan, and copying it across to the similar query that doesn't. However, that is sometimes tricky, especially if the query is not exactly the same. What is the right way of creating plan guides from scratch? SQLKiwi has mentioned drawing ...
2012/10/27
[ "https://dba.stackexchange.com/questions/27719", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13073/" ]
> > *Is there ANY way to make the result come up with exactly 3 distinct guids and no more? I'm hoping to be able to better answer questions in > future by including plan guides with CTE-type queries that are > referenced multiple times to overcome some SQL Server CTE quirks.* > > > Not today. Non-recursive comm...
In all seriousness you can't cut up xml execution plans from scratch. Creating them using SSIS is science fiction. Yes it's all XML, but they are from different universes. Looking at Paul's blog on that [topic](http://web.archive.org/web/20180404164406/http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-pa...
27,719
I normally create plan guides by first constructing a query that uses the correct plan, and copying it across to the similar query that doesn't. However, that is sometimes tricky, especially if the query is not exactly the same. What is the right way of creating plan guides from scratch? SQLKiwi has mentioned drawing ...
2012/10/27
[ "https://dba.stackexchange.com/questions/27719", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13073/" ]
There is no way (SQL Server versions up to 2012) to re-use a single spool for both occurences of the CTE. Details can be found in SQLKiwi's answer. **Further below** are two ways to materialize the CTE twice, which is unavoidable for the nature of the query. Both options result in a net distinct guid count of 6. The l...
I found traceflag 8649 (force parallel plan) induced this behaviour for the left-hand guid column on my 2008, R2 and 2012 instances. I didn't need to use the flag on SQL 2005 where the CTE behaved correctly. I tried using the plan generated in SQL 2005 in the higher instances but it wouldn't validate. ``` with cte(gui...
27,719
I normally create plan guides by first constructing a query that uses the correct plan, and copying it across to the similar query that doesn't. However, that is sometimes tricky, especially if the query is not exactly the same. What is the right way of creating plan guides from scratch? SQLKiwi has mentioned drawing ...
2012/10/27
[ "https://dba.stackexchange.com/questions/27719", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13073/" ]
> > *Is there ANY way to make the result come up with exactly 3 distinct guids and no more? I'm hoping to be able to better answer questions in > future by including plan guides with CTE-type queries that are > referenced multiple times to overcome some SQL Server CTE quirks.* > > > Not today. Non-recursive comm...
There is no way (SQL Server versions up to 2012) to re-use a single spool for both occurences of the CTE. Details can be found in SQLKiwi's answer. **Further below** are two ways to materialize the CTE twice, which is unavoidable for the nature of the query. Both options result in a net distinct guid count of 6. The l...
27,719
I normally create plan guides by first constructing a query that uses the correct plan, and copying it across to the similar query that doesn't. However, that is sometimes tricky, especially if the query is not exactly the same. What is the right way of creating plan guides from scratch? SQLKiwi has mentioned drawing ...
2012/10/27
[ "https://dba.stackexchange.com/questions/27719", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13073/" ]
> > *Is there ANY way to make the result come up with exactly 3 distinct guids and no more? I'm hoping to be able to better answer questions in > future by including plan guides with CTE-type queries that are > referenced multiple times to overcome some SQL Server CTE quirks.* > > > Not today. Non-recursive comm...
I found traceflag 8649 (force parallel plan) induced this behaviour for the left-hand guid column on my 2008, R2 and 2012 instances. I didn't need to use the flag on SQL 2005 where the CTE behaved correctly. I tried using the plan generated in SQL 2005 in the higher instances but it wouldn't validate. ``` with cte(gui...
27,719
I normally create plan guides by first constructing a query that uses the correct plan, and copying it across to the similar query that doesn't. However, that is sometimes tricky, especially if the query is not exactly the same. What is the right way of creating plan guides from scratch? SQLKiwi has mentioned drawing ...
2012/10/27
[ "https://dba.stackexchange.com/questions/27719", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13073/" ]
> > Is there *ANY* way ... > > > Finally in SQL 2016 CTP 3.0 there is a way, kind of : ) Using the trace flag and Extended Events as detailed by Dmitry Pilugin [here](http://www.queryprocessor.com/query-trace-column-values/), you can (somewhat arbitrarily) fish out three unique guids from the intermediate stages...
I found traceflag 8649 (force parallel plan) induced this behaviour for the left-hand guid column on my 2008, R2 and 2012 instances. I didn't need to use the flag on SQL 2005 where the CTE behaved correctly. I tried using the plan generated in SQL 2005 in the higher instances but it wouldn't validate. ``` with cte(gui...
27,719
I normally create plan guides by first constructing a query that uses the correct plan, and copying it across to the similar query that doesn't. However, that is sometimes tricky, especially if the query is not exactly the same. What is the right way of creating plan guides from scratch? SQLKiwi has mentioned drawing ...
2012/10/27
[ "https://dba.stackexchange.com/questions/27719", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/13073/" ]
> > *Is there ANY way to make the result come up with exactly 3 distinct guids and no more? I'm hoping to be able to better answer questions in > future by including plan guides with CTE-type queries that are > referenced multiple times to overcome some SQL Server CTE quirks.* > > > Not today. Non-recursive comm...
> > Is there *ANY* way ... > > > Finally in SQL 2016 CTP 3.0 there is a way, kind of : ) Using the trace flag and Extended Events as detailed by Dmitry Pilugin [here](http://www.queryprocessor.com/query-trace-column-values/), you can (somewhat arbitrarily) fish out three unique guids from the intermediate stages...
13,550,821
I'm making a method that take a list of arrays and finds the average of the numbers. I know that my method works since I just moved it from my main method to the "average" method. I'm just having problems getting the array to work with the method. I'm not sure if I'm wrong by calling the method by `average(a);`, or i...
2012/11/25
[ "https://Stackoverflow.com/questions/13550821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1730056/" ]
From AutoSlugField documentation: > > always\_update – boolean: if True, the slug is updated each time the model instance is saved. Use with care because cool URIs don’t change (and the slug is usually a part of object’s URI). Note that even if the field is editable, any manual changes will be lost when this option i...
The Better documentation is the own code: [http://django-command-extensions.googlecode.com/svn/trunk/django\_extensions/db/fields/**init**.py](http://django-command-extensions.googlecode.com/svn/trunk/django_extensions/db/fields/__init__.py) > > slug = AutoSlugField(populate\_from='title', overwrite=True, > unique=...
13,550,821
I'm making a method that take a list of arrays and finds the average of the numbers. I know that my method works since I just moved it from my main method to the "average" method. I'm just having problems getting the array to work with the method. I'm not sure if I'm wrong by calling the method by `average(a);`, or i...
2012/11/25
[ "https://Stackoverflow.com/questions/13550821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1730056/" ]
From AutoSlugField documentation: > > always\_update – boolean: if True, the slug is updated each time the model instance is saved. Use with care because cool URIs don’t change (and the slug is usually a part of object’s URI). Note that even if the field is editable, any manual changes will be lost when this option i...
use this code : ``` slug = AutoSlugField(max_length=500, populate_from='name', null=True, blank=True, always_update=True, unique=True) ```
613,808
Consider the simplest case in quantum statistical mechanics, where we find the density of states in the case of a cuboidal 3 dimensional box. In the derivation we take only those states which are product seperable into wavefunctions along the three directions i.e. can be denoted by three quantum numbers $(n\_1, n\_2, n...
2021/02/11
[ "https://physics.stackexchange.com/questions/613808", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/287440/" ]
The point is not that there's a priori something special about separable states compared to non-separable states, the point is that you'd like to sum over a complete set of states -- that is, a basis for the Hilbert space. The separable states you describe happen to be particularly convenient states, because they are e...
The question that we are concerned with is the following, given a point in the $k$ space $(k\_{1},k\_{2},k\_{3})$ and an infinitesimal volume centred at this point, how many states can be found within this volume? The superposed state $$\frac{1}{\sqrt{2}}\left(|1,0,0 \rangle + |0,1,0\rangle\right)$$ is found in two dif...
613,808
Consider the simplest case in quantum statistical mechanics, where we find the density of states in the case of a cuboidal 3 dimensional box. In the derivation we take only those states which are product seperable into wavefunctions along the three directions i.e. can be denoted by three quantum numbers $(n\_1, n\_2, n...
2021/02/11
[ "https://physics.stackexchange.com/questions/613808", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/287440/" ]
The point is not that there's a priori something special about separable states compared to non-separable states, the point is that you'd like to sum over a complete set of states -- that is, a basis for the Hilbert space. The separable states you describe happen to be particularly convenient states, because they are e...
It's essentially because you're counting dimensions or degrees of freedom, and not every possible state. Just to give a different style of answer, when we get into the canonical ensemble, say, we will find that the system is described by a state matrix $$ \rho \propto \exp(-\beta \hat H) $$ which will contain, as you ...
30,523,977
I have two SQL Server tables below: **Invoice** ``` InvoiceId Amount [Date] 1 10 2015-05-28 21:47:50.000 2 20 2015-05-28 21:47:50.000 3 25 2015-05-28 23:25:50.000 ``` **InvoiceItem** ``` Id InvoiceId Cost 1 1 8 2 1 ...
2015/05/29
[ "https://Stackoverflow.com/questions/30523977", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1878010/" ]
one approach is to use a derived table: ``` SELECT CAST([Date] AS DATE) AS [Date], DATEPART(HOUR,i.[Date]) AS HourOfDay, COUNT(i.InvoiceId) AS NumberOfInvoices, SUM(i.Amount) AS Amount, SUM(it.Cost) AS Cost FROM invoice i INNER JOIN ...
``` SELECT COUNT (DISTINCT inv.InvoiceId) [Count], SUM (Amount) Amount, SUM (Cost) Cost, datepart(HOUR, inv.[Date]) HourOfDay FROM Invoice inv INNER JOIN InvoiceItem itm ON inv.InvoiceId = itm.InvoiceId GROUP BY datepart(HOUR, ...
179,602
[![Table and image of single feature composed of two parts](https://i.stack.imgur.com/Fp1Lm.jpg)](https://i.stack.imgur.com/Fp1Lm.jpg) This is a repost of my unsolved QGIS dilema. The image shows a single selected feature that consists of two polygons and the corresponding attribute table. Some nodes of the left poly ...
2016/02/05
[ "https://gis.stackexchange.com/questions/179602", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/39243/" ]
As I understand your issue, you currently have a multipolygon feature which has an invalid geometry since one part of it overlaps another part. There is a 2-step procedure that should help you to merge your multipolygon into one simple polygon: First, run the `v.clean` method which is located in the processing toolbox...
I've just whiled away a few hours wrangling with just such a problem and couldn't solve it using any of the `v.clean` options using 2.18.2 for Mac. I got lucky however, with trying the Multipart to singleparts geometry tool by choosing the attribute known to be unique resulting in a new temporary vector layer with th...
11,103,274
I am trying to extract the below query: ``` select '<tr><td>'||column1||'</td>', '<td>'||column2||'</td>', '<td>'||column3||'</td></tr>' from table ``` In the above, column3 is a date field. When the output is printed, it is ignoring the time part. For example: ``` If columns 3 output is : 5/25/2011 3:03:17 AM The ...
2012/06/19
[ "https://Stackoverflow.com/questions/11103274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1070422/" ]
Don't rely on implicit conversions, use [`TO_CHAR`](http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions200.htm#i1009324) to display a date [to your liking](http://docs.oracle.com/cd/E11882_01/server.112/e26088/sql_elements004.htm#i34924): ``` select '<tr><td>'||column1||'</td>', '<td>'||column2||'<...
[TO\_DATE](http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions183.htm) does exactly what it's supposed to do, format mask supplies it with the format it's primary input is in so it can transform it into a date. The format mask is not used to define output but input. What you need to use instead is [TO\_CHAR...
6,399,255
I'm pretty good with MySQL, but this is something I have never done. What I want to do is make an SQL code to select 6 rows, each with their own WHERE clause. What I am trying to do is get 6 rows, and each will be the most recent "video" that was posted. there are 6 categories, so that's why I have 6 rows. I want it t...
2011/06/18
[ "https://Stackoverflow.com/questions/6399255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/118342/" ]
something like ``` select distinct category, video_id from table_name order by id DESC ``` If you have 6 categories in the db, you would get 6 rows, all having highest id in their category
You have two options: 1. Determine common WHERE clause that will result in what you need. 2. (probably preferred one) Make some query involving UNION (`SELECT ... FROM ... WHERE ... UNION SELECT ... FROM ... WHERE ...` etc.) Let me know if you have any questions. I believe without your database structure it would be ...
6,399,255
I'm pretty good with MySQL, but this is something I have never done. What I want to do is make an SQL code to select 6 rows, each with their own WHERE clause. What I am trying to do is get 6 rows, and each will be the most recent "video" that was posted. there are 6 categories, so that's why I have 6 rows. I want it t...
2011/06/18
[ "https://Stackoverflow.com/questions/6399255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/118342/" ]
Please share your table structure. Nevertheless, i think the following query should do the trick: ``` SELECT category_id, MAX(movie_id) most_recent_movie_for_category FROM movies GROUP BY category_id ```
You have two options: 1. Determine common WHERE clause that will result in what you need. 2. (probably preferred one) Make some query involving UNION (`SELECT ... FROM ... WHERE ... UNION SELECT ... FROM ... WHERE ...` etc.) Let me know if you have any questions. I believe without your database structure it would be ...
6,399,255
I'm pretty good with MySQL, but this is something I have never done. What I want to do is make an SQL code to select 6 rows, each with their own WHERE clause. What I am trying to do is get 6 rows, and each will be the most recent "video" that was posted. there are 6 categories, so that's why I have 6 rows. I want it t...
2011/06/18
[ "https://Stackoverflow.com/questions/6399255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/118342/" ]
Thanks for posting the table structure. This is just a simple `GROUP BY` with a `MAX` aggregate on video\_id. ``` SELECT video_category, MAX(video_id) AS video_id FROM videos GROUP BY video_category; ```
You have two options: 1. Determine common WHERE clause that will result in what you need. 2. (probably preferred one) Make some query involving UNION (`SELECT ... FROM ... WHERE ... UNION SELECT ... FROM ... WHERE ...` etc.) Let me know if you have any questions. I believe without your database structure it would be ...
541,374
How can I align my text in the table center then align it with the letter "M" ? Like the below it is right aligned but I want it center-right aligned. How ? [![enter image description here](https://i.stack.imgur.com/NSOzD.png)](https://i.stack.imgur.com/NSOzD.png) Like below, the text is center aligned with M. [![en...
2020/04/29
[ "https://tex.stackexchange.com/questions/541374", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/109408/" ]
Assuming that is the first image the one you want to replicate, here's a MWE. You can override the column alignment for a given cell by using `\multicolumn` for a single column (see also the last line - I added it to make it more clear). In the first image you posted, the first cell from the top seems to be centered. ...
I'm not sure that I've understood your objective correctly, as the layouts in the two screenshots you've posted seem to be in direct conflict with each other. I've interpreted it as follows: (a) the numbers should be aligned on their decimal markers, (b) the `M` letters should be aligned, and (c) the number/`M` combina...
17,574,559
Is there a way to trigger an Error Event when HtmlLoader.load() fails? When there is no internet connection, the COMPLETE Event never gets triggered. I want to be able to tell the user "there is no connection, close the current window and do someting else."
2013/07/10
[ "https://Stackoverflow.com/questions/17574559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1697071/" ]
Sure, but you have to listen instance of URLRequest for some events ``` //your code to load page in to HtmlLoader var html:HTMLLoader = new HTMLLoader(); var urlReq:URLRequest = new URLRequest("http://www.adobe.com/"); configureListeners(urlReq); html.width = stage.stageWidth; ...
This code is working fine For Flex 4 ``` <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="creationCom...
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
``` strcpy( x, (a == MACRO1)? "S" : (a == MACRO2)? "K" : "error" ); ``` Like your original code, this will copy either `"S"` or `"K"` to variable `x`. If `a` is ***neither*** `MACRO1` nor `MACRO2`, it will copy `"error"` to buffer `x` with an assumption that `x` is large enough to hold `"error"` string. ...
it can be also ``` { char *dummy; dummy = a == MACRO1 ? strcpy(x, "TextA") : a == MACRO2 ? strcpy(x, "TextB") : strcpy(x, "error"); } ```
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
Setting aside this [beautiful answer](https://stackoverflow.com/questions/54443105/how-this-if-else-condition-can-be-replaced-by-ternary-operator/54443661#54443661), this cannot be written as a two "nested" ternary conditional operators since there is nothing to do for any value of `a` other than `MACRO1` and `MACRO2`,...
``` strcpy( x, (a == MACRO1)? "S" : (a == MACRO2)? "K" : "error" ); ``` Like your original code, this will copy either `"S"` or `"K"` to variable `x`. If `a` is ***neither*** `MACRO1` nor `MACRO2`, it will copy `"error"` to buffer `x` with an assumption that `x` is large enough to hold `"error"` string. ...
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
``` strcpy( x, (a == MACRO1)? "S" : (a == MACRO2)? "K" : "error" ); ``` Like your original code, this will copy either `"S"` or `"K"` to variable `x`. If `a` is ***neither*** `MACRO1` nor `MACRO2`, it will copy `"error"` to buffer `x` with an assumption that `x` is large enough to hold `"error"` string. ...
Simplest way, behaving like original, appending nothing if a doesn't match either MACRO1 or MACRO2: ``` strcpy(x, (a == MACRO1)?"S":(a == MACRO2)?"K":x); ```
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
Formally, it can be rewritten as equivalent ``` a == MACRO1 ? strcpy(x, "S") : a == MACRO2 ? strcpy(x, "K") : 0; ``` but there's no meaningful reason to do so, unless it is just a puzzle (or unless there's a credible reason to [maintain expression semantics](https://stackoverflow.com/questions/1613230/uses-of-c-com...
it can be also ``` { char *dummy; dummy = a == MACRO1 ? strcpy(x, "TextA") : a == MACRO2 ? strcpy(x, "TextB") : strcpy(x, "error"); } ```
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
Formally, it can be rewritten as equivalent ``` a == MACRO1 ? strcpy(x, "S") : a == MACRO2 ? strcpy(x, "K") : 0; ``` but there's no meaningful reason to do so, unless it is just a puzzle (or unless there's a credible reason to [maintain expression semantics](https://stackoverflow.com/questions/1613230/uses-of-c-com...
Simplest way, behaving like original, appending nothing if a doesn't match either MACRO1 or MACRO2: ``` strcpy(x, (a == MACRO1)?"S":(a == MACRO2)?"K":x); ```
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
``` if(a == MACRO1) strcpy(x,"S") else strcpy(x,"K"); ``` can be : ``` strcpy(x, (a == MACRO1) ? "S" : "K"); ``` but ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ``` has a missing else and to do ``` strcpy(x, (a == MACRO1) ? "S" : ((a == MACRO2) ? "K" : x)); ``` is **not** corr...
``` strcpy( x, (a == MACRO1)? "S" : (a == MACRO2)? "K" : "error" ); ``` Like your original code, this will copy either `"S"` or `"K"` to variable `x`. If `a` is ***neither*** `MACRO1` nor `MACRO2`, it will copy `"error"` to buffer `x` with an assumption that `x` is large enough to hold `"error"` string. ...
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
Setting aside this [beautiful answer](https://stackoverflow.com/questions/54443105/how-this-if-else-condition-can-be-replaced-by-ternary-operator/54443661#54443661), this cannot be written as a two "nested" ternary conditional operators since there is nothing to do for any value of `a` other than `MACRO1` and `MACRO2`,...
Simplest way, behaving like original, appending nothing if a doesn't match either MACRO1 or MACRO2: ``` strcpy(x, (a == MACRO1)?"S":(a == MACRO2)?"K":x); ```
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
Setting aside this [beautiful answer](https://stackoverflow.com/questions/54443105/how-this-if-else-condition-can-be-replaced-by-ternary-operator/54443661#54443661), this cannot be written as a two "nested" ternary conditional operators since there is nothing to do for any value of `a` other than `MACRO1` and `MACRO2`,...
it can be also ``` { char *dummy; dummy = a == MACRO1 ? strcpy(x, "TextA") : a == MACRO2 ? strcpy(x, "TextB") : strcpy(x, "error"); } ```
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
``` if(a == MACRO1) strcpy(x,"S") else strcpy(x,"K"); ``` can be : ``` strcpy(x, (a == MACRO1) ? "S" : "K"); ``` but ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ``` has a missing else and to do ``` strcpy(x, (a == MACRO1) ? "S" : ((a == MACRO2) ? "K" : x)); ``` is **not** corr...
Simplest way, behaving like original, appending nothing if a doesn't match either MACRO1 or MACRO2: ``` strcpy(x, (a == MACRO1)?"S":(a == MACRO2)?"K":x); ```
54,443,105
Please help me to rewrite the below condition in a better way This is a c code ``` if(a == MACRO1) strcpy(x,"S") else if (a == MACRO2) strcpy(x,"K"); ```
2019/01/30
[ "https://Stackoverflow.com/questions/54443105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9697921/" ]
Formally, it can be rewritten as equivalent ``` a == MACRO1 ? strcpy(x, "S") : a == MACRO2 ? strcpy(x, "K") : 0; ``` but there's no meaningful reason to do so, unless it is just a puzzle (or unless there's a credible reason to [maintain expression semantics](https://stackoverflow.com/questions/1613230/uses-of-c-com...
``` strcpy( x, (a == MACRO1)? "S" : (a == MACRO2)? "K" : "error" ); ``` Like your original code, this will copy either `"S"` or `"K"` to variable `x`. If `a` is ***neither*** `MACRO1` nor `MACRO2`, it will copy `"error"` to buffer `x` with an assumption that `x` is large enough to hold `"error"` string. ...
65,015,110
I have a table: ``` a b c 1 11 21 2 12 22 3 3 3 NaN 14 24 NaN 15 NaN 4 4 4 5 15 25 6 6 6 7 17 27 ``` I want to remove all the rows in column `a` before the last row with the null value. The output that I wa...
2020/11/26
[ "https://Stackoverflow.com/questions/65015110", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2798218/" ]
you also know about comment like this "/\* ... bla bla ... */". That must do not work on your mind, but it works. Thus, I recommend you that change the comment from "/*... \*/" to "-- bla bla". start of "--" comment can ignore that line without run. ex> /\*!40101 SET @OLD\_CHARACTER\_SET\_CLIENT=@@CHARAC...
Oh, found a solution... ```java scriptRunner.setEscapeProcessing(false); ```
11,108
$g(x) =\frac{3-5x}{5-x}$ I know that I am retarded for not being able to do this on my own. Algebraically you just have to solve for x. Even so, I can't do it.
2010/11/20
[ "https://math.stackexchange.com/questions/11108", "https://math.stackexchange.com", "https://math.stackexchange.com/users/2230/" ]
Hint: $y=\frac{3-5x}{5-x}$ so $y(5-x)=3-5x$. Now collect terms involving $x$ on one side and those not involving $x$ on the other and solve for $x$.
Maybe you could start with a less complicated example and build up from there. Why don't you try finding the inverse function of $f(x) = x + 3$ using the idea that Timothy gave you of putting $y = x + 3$ and then solving for $x$. Then you can try $f(x) = 7x - 2$ for instance. Now you could also try $f(x) = \frac{3}{x}$...
120,040
I read the [r](/questions/tagged/r "show questions tagged 'r'") questions and answers. I am trying to learn R and SO is a good source. I would find it useful, to find all the [gem](/questions/tagged/gem "show questions tagged 'gem'") topics which were favourited by a lot of users. Is there a way to search > > [r] i...
2012/01/23
[ "https://meta.stackexchange.com/questions/120040", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/177436/" ]
Although the data does get stale you can use a Data.SE query for this Here's one I wrote for you [GEM Questions by FavoriteCount](https://data.stackexchange.com/stackoverflow/query/59982/gem-questions-by-favoritecountt) Here's the SQL code for it ``` SELECT p.id [Post Link], p.favoritecount FROM posts p ...
[Here's the query](https://data.stackexchange.com/stackoverflow/query/59981/favourite-by-tag) - insert any tag (for example, [r](/questions/tagged/r "show questions tagged 'r'")) and enjoy! ``` -- Get the ID of the tag: DECLARE @tagName NVARCHAR(25) = '##Tag##' DECLARE @tagId INT = (SELECT TOP(1) Id From Tags WHERE Ta...
7,949,818
In Rails 3, when I write: `@users = User.limit(10).sort_by(&:name)` it is giving me 10 users in name order, but not the first 10 alphabetically like I want. What am I doing wrong? Thanks!
2011/10/31
[ "https://Stackoverflow.com/questions/7949818", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1021325/" ]
Try: `@users = User.limit(10).order('name ASC')`
The [`sort_by`](https://ruby-doc.org/core/Enumerable.html#method-i-sort_by) method is from Enumerable. So, in order to call `sort_by`, ActiveRecord has to retrieve the records from the database; ActiveRecord will first do this: ``` User.limit(10) ``` to get ten records from the database and then those records will b...
1,719,161
This is the statement that needs to be proved: If $A⊈B∪C$ then $A-B⊈C$. I want to proof using the contrapositive, so: If $A-B⊆C$ then $A⊆B∪C.$ And I don't know what to do from this point on.
2016/03/29
[ "https://math.stackexchange.com/questions/1719161", "https://math.stackexchange.com", "https://math.stackexchange.com/users/294021/" ]
If A-B⊆C, suppose $x \in A$. If $x \in B$, then $x \in B \cup C$. If $x \not\in B$, then $x \in A-B$, so $x \in C$, so $x \in B \cup C$. Therefore $x \in A \implies x \in B \cup C$, so $A \subseteq B \cup C $.
$A \not \subseteq B \cup C$ means there is an $x\_0 \in A$ where $x\_0 \not \in B \cup C$. That means $x\_0 \not \in B$ and $x\_0 \not \in C$. But $x\_0 \in A$ and $x\_0 \not \in B$ means $x\_0 \in A - B$. But $x\_0 \not \in C$. So $A - B \not \subseteq C$. ==== Furthermore, FWIW, this proves $A - (B \cup C) \sub...
61,922,428
I am generating arrays (technically they are row vectors) with a for-loop. a, b, c ... are the outputs. Can I add the new array to the old ones together to form a matrix? ``` import numpy as np # just for example: a = np.asarray([2,5,8,10]) b = np.asarray([1,2,3,4]) c = np.asarray([2,3,4,5]) ... ... ... ... ... ``` ...
2020/05/20
[ "https://Stackoverflow.com/questions/61922428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13100062/" ]
Based on some weird values, like `14:10 pm`, try this code: ``` from datetime import datetime as dt def robust_strptime(txt): try: return dt.strptime(txt, '%H:%M') except ValueError: try: return dt.strptime(txt, '%I:%M %p') except ValueError: return dt.strptime(...
``` %H - Hour (24-hour clock) as a decimal number [00,23]. ``` find below link for more detail, [enter link description here](https://docs.python.org/3/library/time.html#module-time)
33,638
I refer to "Sheaves in Geometry and Logic", by S. MacLane. Let **C** be a category. Dealing with a *subobject* of an object $D \in \text{Ob}\_{\mathbf C}$, one defines an equivalence relation between morphisms towards *D*: > > Two monomorphisms $f:A\to D$, $g:B\to D$ with a common codomain *D* are called *equivalent...
2010/07/28
[ "https://mathoverflow.net/questions/33638", "https://mathoverflow.net", "https://mathoverflow.net/users/7952/" ]
For a general category the subobjects do indeed not have to form a set. In the context of MacLane/Moerdijk you only look at toposes and there one has a natural isomorphism $Sub\_{\mathbf{C}}(D) \cong Hom\_{\mathbf{C}}(D,\Omega)$, where $\Omega$ is the subobject classifier. So it follows from the axioms of a topos, ...
A reasonable reformulation of the question is, if there exists a set of representatives for subobjects; i.e. if there is a set of monomorphisms into our object $D$, such that every other monomorphism into $D$ is isomorphic to one of them. This is, of course, false. Take a preorder $P$, which is a proper class, and has...
1,265,860
This keeps happening to me all the time: 1) I write a script(ruby, shell, etc). 2) run it, it works. 3) put it in crontab so it runs in a few minutes so I know it runs from there. 4) It doesnt, no error trace, back to step 2 or 3 a 1000 times. When I ruby script fails in crontab, I can't really know why it fails cause...
2009/08/12
[ "https://Stackoverflow.com/questions/1265860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96087/" ]
To find out the environment in which cron runs jobs, add this cron job: ``` { echo "\nenv\n" && env|sort ; echo "\nset\n" && set; } | /usr/bin/mailx -s 'my env' you@example.com ``` Or send the output to a file instead of email.
If you really want to run it *as yourself*, you may want to invoke ruby from a shell script that sources your `.profile`/`.bashrc` etc. That way it'll pull in your environment. However, the downside is that it's not isolated from your environment, and if you change that, you may find your cron jobs suddenly stop worki...
1,265,860
This keeps happening to me all the time: 1) I write a script(ruby, shell, etc). 2) run it, it works. 3) put it in crontab so it runs in a few minutes so I know it runs from there. 4) It doesnt, no error trace, back to step 2 or 3 a 1000 times. When I ruby script fails in crontab, I can't really know why it fails cause...
2009/08/12
[ "https://Stackoverflow.com/questions/1265860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96087/" ]
G'day, One of the basic problems with cron is that you get a **minimal** environment being set by cron. In fact, you only get four env. var's set and they are: * SHELL - set to /bin/sh * LOGNAME - set to your userid as found in /etc/passwd * HOME - set to your home dir. as found in /etc/passwd * PATH - set to "/usr/b...
If you really want to run it *as yourself*, you may want to invoke ruby from a shell script that sources your `.profile`/`.bashrc` etc. That way it'll pull in your environment. However, the downside is that it's not isolated from your environment, and if you change that, you may find your cron jobs suddenly stop worki...
1,265,860
This keeps happening to me all the time: 1) I write a script(ruby, shell, etc). 2) run it, it works. 3) put it in crontab so it runs in a few minutes so I know it runs from there. 4) It doesnt, no error trace, back to step 2 or 3 a 1000 times. When I ruby script fails in crontab, I can't really know why it fails cause...
2009/08/12
[ "https://Stackoverflow.com/questions/1265860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96087/" ]
G'day, One of the basic problems with cron is that you get a **minimal** environment being set by cron. In fact, you only get four env. var's set and they are: * SHELL - set to /bin/sh * LOGNAME - set to your userid as found in /etc/passwd * HOME - set to your home dir. as found in /etc/passwd * PATH - set to "/usr/b...
To find out the environment in which cron runs jobs, add this cron job: ``` { echo "\nenv\n" && env|sort ; echo "\nset\n" && set; } | /usr/bin/mailx -s 'my env' you@example.com ``` Or send the output to a file instead of email.
1,265,860
This keeps happening to me all the time: 1) I write a script(ruby, shell, etc). 2) run it, it works. 3) put it in crontab so it runs in a few minutes so I know it runs from there. 4) It doesnt, no error trace, back to step 2 or 3 a 1000 times. When I ruby script fails in crontab, I can't really know why it fails cause...
2009/08/12
[ "https://Stackoverflow.com/questions/1265860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/96087/" ]
> > "Is there a way for me to just have crontab run a script as if I ran it myself from my terminal?" > > > Yes: ``` bash -li -c /path/to/script ``` From the man page: ``` [vindaloo:pgl]:~/p/test $ man bash | grep -A2 -m1 -- -i -i If the -i option is present, the shell is interactive. -l Ma...
If you really want to run it *as yourself*, you may want to invoke ruby from a shell script that sources your `.profile`/`.bashrc` etc. That way it'll pull in your environment. However, the downside is that it's not isolated from your environment, and if you change that, you may find your cron jobs suddenly stop worki...