INSTRUCTION
stringlengths
25
999
RESPONSE
stringlengths
0
999
SOURCE
stringlengths
16
38
METADATA
dict
Negative pluse generator does not reach 0V I'm using an Arduino board to generate a 125KHz square wave signal to feed into this curcuit: !schematic simulate this circuit - Schematic created using CircuitLab So this is what I'm receiving from my scope. The output was connected to the channel-1 upper, and input is connected to channel-2 lower. Any idea why above channel-1 output does not reach 0V when the pulse happens? How do I make it to hit 0V? ![enter image description here](
You are asking too much of an old, slow, wimpy part. The CD4011 has a propagation time of 60ns, an output impedance of around 1k\$\Omega\$ if you're powering it from 5V (I inferred this number by looking at the current drive capability of the part), and significantly less voltage gain in its linear region than 74HCxx and later CMOS parts. Use a resistor value that the gate can actually pull high when the cap is discharged -- the chip can supply about 500\$\mu\$A at 5V, which translates into a resistance of about 10k\$\Omega\$. Then use a cap that'll give you a time constant that's at least as long as the chip's propagation delay (125-250ns at 5V). Then expect the result to have a slow rise time because of the limited gain of the part in its linear region.
stackexchange-electronics
{ "answer_score": 5, "question_score": 0, "tags": "arduino, oscillator, oscilloscope, nand" }
Spanning div over width remaining next to unordered list? <div class="nav"> <ul class="nav"> <a class="nav" href="#"> <li class="nav">item1</li> </a> <a class="nav" href="#"> <li class="nav">item2</li> </a> <a class="nav" href="#"> <li class="nav">item3</li> </a> </ul> <div class="line"></div> </div> This is my HTML navbar CSS: ul.nav { display: inline-block; font-size: 0; } li.nav { display:inline-block; border-bottom: 2px solid gray; padding: 15px 20px; text-align: center; font-size: 16px; } div.nav { width: 100%; display: inline-block; } How do I style the div.line so it is exactly next to the list (right), fills the rest of the page (width) and has the same height as the ul.nav/div.nav? Thanks,
First of all, sorry about the english level! You can do something like: .line { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: gray; } e.g: < That's basically turn the div.line into an absolute alement behind your navigation. It will have the width of the parent div.nav, it's not a beautiful solution, but is well supported :)
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "css, width, html" }
Opening Creo file in student edition Is it possible to open a part created using Creo commercial edition in the student edition ? I tried this but it doesn’t seem to work. Is there a way to do this ?
The "professional" version has more features, so the parts have extra information that the student version won't be able to read or convert. So, You will need the "professional" version - at least for complicated parts. If it was just a simple bar it would likely open. You can understand them protecting their software...
stackexchange-engineering
{ "answer_score": 1, "question_score": 0, "tags": "mechanical engineering, design, cad" }
Change css class with php multi pages I have a multiple pages website where I wan't to change some css stuffs. So my index.php?p=page points to various pages but on every page I also want to adjust some css like the color of the currently active menu item(li) etc. What is the best way to achieve this? Should i just make a php var on each page?
One way to handle this is to put a class on the BODY tag for each page, then make different subclasses for the stuff that changes. This way you don't need to feed in any variables from PHP. It's all done via CSS. <body class="pageOne"> CSS: .pageOne h1 { color:#ff0000 } .pageTwo h1 { color:#000000 }
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "php, javascript, jquery, html, css" }
How to make Emacs not highlight trailing whitespace in term? I'm using this in my .emacs config '(show-trailing-whitespace t) And I'm generally very happy with it. The only problem is that it highlights whitespace when I'm in 'M-x term' buffer and I have no control over that whitespace. How to prevent this?
Use this: (add-hook 'term-mode-hook (lambda() (setq show-trailing-whitespace nil)))
stackexchange-stackoverflow
{ "answer_score": 7, "question_score": 5, "tags": "emacs" }
Do i have to select a perk in order to level it? As you know, there are some Perks in Killing Floor, and each of them, level by a different mechanism (Headshots, Melee Damage, Shotgun damage etc). The question is, do i have to SELECT a perk in order to level it, or it will level even if not selected ? E.g. With the Demolition Perk Selected, will my headshots count towards leveling Sharpshooter ? With the Sharpshooter perk Selected, will my Heals count towards to level Medic Perk ? Thanks!
No, you do not have to select a perk in order to level it, though it helps tremendously.
stackexchange-gaming
{ "answer_score": 1, "question_score": 0, "tags": "killing floor" }
Add something automatically to the end of bash command I would like to know how to add something to the end of a specific bash command without having to type it out explicitly. For example, I would like to be able to type: $ mycommand argument and the line will be submitted as: $ mycommand argument & I know how to set up an alias in my `.bashrc` (e.g. `alias command="command -i"`) which will let me add non-positional arguments but I can't figure out how add something to the end.
Define a shell function. mycommand () { command mycommand "$@" & }
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 3, "tags": "bash" }
what is correct architecture of my pc AMD or INTEL? i was trying to get the info about my system processor architecture and saw two different answers 1. from windows explorer 2. from cmd prompt using "SET Processor" command and i got intel i7 and amd64 respectively as youcan see here can someone give me clear picture about amd and intel cpu's i have gone through this question but need more information about those 2 commands which i ran, thank you.
Both are correct, but they refer to different kinds of architectures. * "Intel" is the manufacturer of this particular CPU, and "i7-3612QM" is the model. It describes _how_ the hardware was built. * "amd64" (aka "x86_64") is the name for the _instruction set_ that the CPU understands. It describes _what_ the CPU was built to do. Nearly all 64-bit CPUs that you'll find in a PC – whether they're Intel CPUs or AMD CPUs or VIA CPUs – will be made for the "amd64" aka "x86_64" instruction set, because that's what PCs traditionally use.
stackexchange-superuser
{ "answer_score": 2, "question_score": 0, "tags": "cpu, 64 bit, computer building, intel core i7" }
Calculate $\int_0^{5p} f(x) dx$ for period $p$. Let the $p$ be a period of the $f(x) $ $f(x) = |\sin x + \cos x|$ Find the $S = \int_0 ^{5p } f(x) dx$ * * * Here is my attempt. The answer is $10 \sqrt2:$ ![enter image description here]( But whenever I did the answer dosen't come at all. Is the answer not correct, isn't it?
It might be simpler to just write $$\begin{align} S &=\int_0^{5\pi}|\sqrt{2}\sin{(x+\pi/4)}|\mathrm{d}x\\\ &=5\int_0^{\pi}|\sqrt{2}\sin{(x+\pi/4)}|\mathrm{d}x\\\ &=5\left(\int_0^{3\pi/4}\sqrt{2}\sin{(x+\pi/4)}\mathrm{d}x-\int_{3\pi/4}^{\pi}\sqrt{2}\sin{(x+\pi/4)}\mathrm{d}x\right)\\\ &=\cdots\\\ \end{align}$$
stackexchange-math
{ "answer_score": 1, "question_score": 0, "tags": "calculus" }
How to change or customize JBehave step? I have slight issue with step customization. I want to add some specific data from Spring context to JBehave report after successful step executing, e.g. I have step: `When login as random user` I want to see in report if all was good something like `When login as random user (%username%)` I found how to execute any logic before/after story/scenario, but I can't find correct way how to add any logic after step and how can I customize/extend basic JBehave steps. Thank you in advance.
Use `StoryReporter` API: import org.jbehave.core.reporters.NullStoryReporter; public class MyCustomStoryReporter extends NullStoryReporter { @Override public void beforeStep(String step) { // add "before-step" logic here } @Override public void successful(String step) { // add "after-passed-step" logic here } @Override public void failed(String step, Throwable cause) { // add "after-failed-step" logic here } } More information on `StoryReporter` and its configuration can be found in the official documentation: Reporting Stories
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "spring, jbehave" }
how to get .app filename programmatically? i when i compile the project a .app application is created. and it is same name as the project name by default. how to get that name programmaticaly ?
NSDictionary *d = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"]]; NSString *s = [d objectForKey:@"CFBundleExecutable"]; NSLog(@"d: %@", s);
stackexchange-stackoverflow
{ "answer_score": 8, "question_score": 2, "tags": "iphone" }
How do crackers upload php scripts to Wordpress' wp-content directory? I've seen a site that has been attacked by uploading php scripts (presumably some sort of shell, or code that loads a shell) to Wordpress' wp-content/uploads directory. Usually this directory is used for user uploaded content like photos etc. This particular server was configured to then run the malicious scripts for any user on the Internet (with knowledge of the correct URL). How does this work? How would the cracker get wordpress to place the php file in the uploads directory without a user account? I this just the infamous and inspecific "yeah, wordpress is not secure" type of problem?
I wouldn't say that the root cause of the problem is Wordpress, but rather the fact that: * There is so many themes/plugins for Wordpress available from 3rd party developers, and people usually don't audit them before installing them. Since the entry barrier for PHP is very low, a lot of those 3rd party developers have no/poor IT security knowledge I think one of the most possible scenario is where a Wordpress setup is configured with a plugin/theme which allows anonymous uploads. One example is the Clockstone Theme upload.php Arbitrary File Upload Vulnerability. Basicly, you 1. Need to make sure unauthorized/anonymous uploads are not allowed 2. Move uploaded files out of the web root directory 3. Verify the content to make sure only what you expect gets uploaded and saved The page on Unrestricted File Upload on the OWASP web site has some very good explanations on the subject.
stackexchange-security
{ "answer_score": 13, "question_score": 14, "tags": "php, wordpress" }
3 Monitors to a single pc * First of all which graphics cards support 3 monitors? * Is it possible to buy a graphics card which has 2 outputs and use the onboard (motherboard) graphics output for the third monitor? _(as far as I know you have to toggle between onboard or external graphics usage in the BIOS)_
Regarding the second question: Yes. We have a bunch of older Dells (like Dimension 3100) at the office that can run 3 displays with the addition of a video card. 2 from the card and the third from the onboard video.
stackexchange-superuser
{ "answer_score": 2, "question_score": 2, "tags": "windows 7, multiple monitors, graphics card" }
Analogue to Fixed Point Theorem for Compact metric spaces If $\omega:H \rightarrow H$ (into) is continuous and $H$ is compact, does $\omega$ fix any of its subsets other than the empty set?
the proof I learned from Henno Brandsma's answer: Let $X$ be compact Hausdorff (no metric is needed), and define $A_0 = X$, $A_{n+1} = f[A_n]$; then all $A_n$ are compact non-empty, and the $A_n$ are decreasing. Try to show that $A = \cap_n A_n$, which is also compact and non-empty, satisfies $f[A] = A$. Another non-constructive way to show this is to consider the poset $\mathcal{P} = \\{ A \subset X \mid A, \mbox{closed, non-empty and } f[A] \subset A \\}$, ordered under reverse inclusion. Then an upper bound for a chain from $\mathcal{P}$ is the (non-empty) intersection, and a maximal element (by Zorn one exists) is a set $A$ with $f[A] = A$.
stackexchange-math
{ "answer_score": 3, "question_score": 3, "tags": "general topology, analysis, metric spaces, fixed point theorems" }
select * group by distinct columns I have a table data as follows: ` Id c1 c2 8802 1 1 8802 3 1 8802 3 2 8802 4 1 ` How do I write a query to fetch all columns, but have a unique (id,c1). It does not matter what the value in c2 is My final output would look like this ` Id c1 c2 2202 1 1 2202 3 (1 or 2 does not matter) 2202 4 1 ` I have 10+ columns in the table and all the columns need to be displayed. To use the group by clause I need to provide a select clause with those specific column names and I don't get the output I desire `select Id, c1 from table group by (Id, c1)` will give a listing of just `Id,c1`. How do I get all columns? Thanks!
Since you're using a group by, you would want to use aggregration with it. You may not care which value of C2 is returned; but the System needs to know which one you want. So: SELECT ID, C1, max(C2) FROM table GROUP BY ID, C1 OR use a window function such as LISTAGG to combine all values into a comma separated list SELECT ID, C1, LISTAGG(C2, ', ') WITHIN GROUP (ORDER BY C2)` FROM table GROUP BY ID, C1 Or use a CTE and a window function to assign a row number and limit to just the 1st record of each grouping. Given the other columns and a presumed desire for related values to the same C2 value; this seems like the best approach. WITH CTE AS ( SELECT A.*, Row_number() over (partition by ID, C1 ORDER BY C2) RN FROM table A) SELEC * FROM CTE WHERE RN = 1
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "sql, oracle" }
ios - get values from NSDictionary I have JSON on my server, which is parsed into iOS app to NSDictionary. NSDictionary looks like this: ( { text = Aaa; title = 1; }, { text = Bbb; title = 2; } ) My question is - how to get just text from first dimension, so it should be "Aaa". I've tried to use this: [[[json allValues]objectAtIndex:0]objectAtIndex:0]; But it didn't work, it ends with error > > Terminating app due to uncaught exception > 'NSInvalidArgumentException', reason: '-[__NSCFArray allValues]: > unrecognized selector sent to instance 0x714a050' > So can you help me please, how to get just one value from specified index? Thanks!
Your JSON object is an array, containing two dictionaries. That's how to get the values: NSDictionary* dict1= json[0]; NSString* text= dict1[@"text"]; NSString* title= dict1[@"title"];
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 4, "tags": "ios, json, nsdictionary" }
Reactive Extensions Observable from a collection of web queries relevant: async function over a list I Have a function that looks like this: public async Task<decimal> GoToWeb(string Sym){} I want to call it periodically over a list of string once a minute. How can I convert this into a Reactive Extensions Observable?
Since the reactive framework can handle the asynchrony for you you could try this: var syms = new List<string>() { "ANZ", "BHP", }; var query = from i in Observable.Interval(TimeSpan.FromSeconds(1.0)) from sym in syms.ToObservable() from d in GoToWeb(sym).ToObservable() select new { Symbol = sym, Value = d, }; You'll need to add a reference to the namespace `System.Reactive.Threading.Tasks` to get the `ToObservable()` extension for tasks. Does this meet your needs?
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "c#, .net, system.reactive, async await, c# 5.0" }
Disable the dates from current date to one week range in <input type="date"> I have a question to ask. How do you disable all the dates from the current date to 6 days? In short disabling the **one week** including the **present** in the <input type="date"> calendar selection, anyone?
You can set the `min` attribute for date input. Use `date` function to set the min date: <input type="date" name="date" id="date" min="<?=date('Y-m-d', strtotime('+6 days')) ?>"> This disables date less than 6 days: ![enter image description here](
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": -1, "tags": "php, html, input" }
AT Command to change frame size gives ERROR I'm using a SIM900A GSM Shield to communicate between an arduino due and an API. I currently using it's default values in the multiplexer of GSM Shield. But now I'm in need of changing it's frame size to 255. When I check the current frame size, it gives following response which indicates the frame size as 127. CMUX Read:AT+CMUX? +CMUX: 0,0,5,127,10,3,30,10,2 OK Then I used following AT command to change it to 255. But it gives an ERROR. sim900_send_cmd("AT+CMUX=0[,0[,1[,255[,10[,3[,30[,10[,2]]]]]]]]\r\n"); CMUX Read:AT+CMUX=0[,0[,5[,255[,10[,3[,30[,10[,2]]]]]]]] ERROR What am I doing wrong here ? am I missing a step ? Any insight will be much appreciated. Thank you
I'm not an expert in AT commands, but I bet you don't need all the brackets in yours. Brackets are used to indicate parameters which could be omitted. So your command should look like this: CMUX Read:AT+CMUX=0,0,5,255,10,3,30,10,2 Maybe even a shoter version will work: CMUX Read:AT+CMUX=0,0,5,255
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "gsm, at command, sim900" }
get notification when systemd-monitored service enters failed state I need to have network messages sent when a systemd service I have crashes or is hung (i.e., enters failed state; I monitor for hung by using WatchdogSec=). I noticed that newer systemd have FailureAction=, but then saw that this doesn't allow arbitrary commands, but just rebooting/shutdown. Specifically, I need a way to have one network message sent when systemd detects the program has crashed, and another when it detects it has hung. I'm hoping for a better answer than "parse the logs", and I need something that has a near-instant response time, so I don't think a polling approach is good; it should be something triggered by the event occurring.
systemd units support OnFailure that will activate a unit (or more) when the unit goes to failed. You can put something like OnFailure=notify-failed@%n And then create the `[email protected]` service where you can use the required specifier (you probably will want at least %i) to launch the script or command that will send notification. You can see a practical example in <
stackexchange-serverfault
{ "answer_score": 51, "question_score": 54, "tags": "linux, bash, service, systemd" }
Exercise 46, Chapter 1 from Real Analysis, Carothers I have this homework exercise and I need some quidelines in order to solve it. Let $f : \mathbb{R} \rightarrow \mathbb{R}$ be continuous. (a) If $f(0) > 0$, show that $f(x) > 0$ for all $x$ in some open interval $(-a , a )$. (b) If $f(x ) \geq 0$ for every rational $x$, show that $f(x ) \geq 0$ for all real $x$ . Will this result hold with $\geq 0$ replaced by $>0$? Explain.
1. Suppose not then for every $\epsilon_n=1/n \exists x_n\in (-1/n,1/n)$ with $f(x_n)=0$. We have $x_n\rightarrow0$ and since f is continuous $f(0)=lim_{n\rightarrow \infty } f(x_n)=0$ thus a contradiction 2. For $f:R\rightarrow R$ given by $f(x)=(x-\sqrt 2)^2,$ $f(r)>0 \forall r\in Q$ but $f(\sqrt2)=0$. However for a function satisfying the condition we have given $x\in R$ $\exists$ a sequence $r_n$ of rationals such that $r_n\rightarrow x$. Then we have $f(r_n)>0 \forall n$ thus $f(x)=lim_{n\rightarrow \infty } f(r_n)≥0$
stackexchange-math
{ "answer_score": 1, "question_score": 0, "tags": "calculus, real analysis, continuity, real numbers, rational numbers" }
How can I identify missing features in a SharePoint site that has been restored from a different farm? I recently inherited an application from a developer who is no longer with the company. This application restores SharePoint sites from backups and extracts metadata and files from lists in the site. The application runs on a SharePoint server and uses the Microsoft.SharePoint assemblies in C# and VB.Net. The backups come to us from various outside companies, and some of them have custom features installed. SharePoint Health Analyzer shows a warning about "Missing server side dependencies". When I look at the report there is a lot of "[MissingFeature] Database [db name] has reference(s) to a missing feature..." etc. The previous developer was supposed to implement a check for missing features, but it is obviously not working. How can I identify features that the restored site references, but are not installed on the farm? Thanks! RH
there are couple of ways. 1. Run the Test-spcontentDatabase command against the content DB to get the list 2. use this SharePoint Feature Administration and Clean Up Tool to identify and remove them 3. You can use the powershell to get this done. <
stackexchange-sharepoint
{ "answer_score": 5, "question_score": 5, "tags": "feature, restore" }
Find ONLY existent records Table is insert only table. I need to find records that never got value 1. How can I achieve that. select count(distinct(userId)) from XXXX with(nolock) where permission='1' and value=0 This is not working because in table there is userId column. and some userId's has value 1 too. I need to find UserId's that never got value 1. Id UserId Permission Value -- ------ ---------- ----- 1 2 1 0 2 2 1 1 When I execute my query, it brings count as 1. But userId 2 has value 1 too. I need to edit my query to bring the count as 0 if UserId has record for value 1.
Reading between the lines, I _think_ what you are after is a `HAVING` clause with a conditional aggregate: WITH CTE AS( SELECT UserId FROM dbo.YourTable --WITH (NOLOCK) -- DO NOT use NOLOCK unless you understand what it is truly doing WHERE permission = 1 --This looks like an int, not a varchar GROUP BY UserId HAVING COUNT(CASE [Value] WHEN 1 THEN 1 END) = 0) SELECT COUNT(UserId) FROM CTE;
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "c#, sql server" }
How to show the correct object numbers when using django-pagination I am using **django-pagination** to paginate my object list. It is working flawlessly. I want to give a number to each object on the page and I am using `{{forloop.counter}}` for that, but the problem is it starts the object count from 1 on each page. I wanted to display the actual object count. Say if I am paginating 10 objects per page, then I want to object number as 11 for the first object on page 2. I tried writing a template filter for this, but somehow I am not able to send both `request.get.page` and `{{forloop.counter}}` to my filter function. I am unable to do it that way. Any help for direction will be appreciated.
You can use the `add` template tag to add the current count from the paginator to the forloop {{ forloop.counter|add:paginator.page.start_index }}
stackexchange-stackoverflow
{ "answer_score": 17, "question_score": 14, "tags": "django, django templates, django pagination" }
My ASP.net MVC 4 site gets slow on first request to SQL Server Express 2012 I have an ASP.net MVC 4 site and it gets slow on the first request. It is not high slow but pages that use to long 1000-700 ms on load, the first time it longs 8-15seg. It occurs when i wait for 10 minutes for example and come back to make a request. The web site is not on production server yet. May it be when the app pool does not receive any request it goes to sleep?. I have configured the new AutoStart mode in framework 4: < I think it may be the first request to the SQL Server Express 2012 (in the same server). I have set the autoclose=off in the database. What more can i do?. How could i see what is going on the first request to avoid that slow response?.
Thanks to every one who has apported to this question. Finally i think it has to do with the idle time configuration in the App pool. It was set 5 min (default) and i have set it 60 min. and now it goes fine! Thanks to this question: First request is very slow after website sits idle with ASP.NET MVC 3 (IIS7)
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 3, "tags": "asp.net mvc, iis 7, asp.net mvc 4" }
How to package java libraries that will automatically work when jar file is distributed to another computer? I've created an application which has a few external libraries, i am trying to distribute to another machine. I want the application to work from just the .jar file. I know its something to do with the 'Resolve Project Problems', is there a way to prevent this when distributing to another machine I have already tried adding a library to the distribution folder, it carries over but doesn't do anything with it Run the application on a new machine without having to 'Resolve project problems' through net beans
You will need to Create a FAT jar Two Useful links which helped me where How to include jars in lib into project jar file in Netbeans? < This didn't entirely fix the issue, i was using a dynamic file string with in my program I copied the data folder from my application and pasted it in the store folder and rebuilt and also repackaged the fat jar. This made it work
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "java, netbeans" }
how to get the FULL details for the current user using UserService, including their default address? The default address data returned contains country and region codes, but not country and region names. Any one know if there's a way to do that in Spartacus, or would that be something custom?
Good question! You can use Spartacus's configurable endpoint mechanism to achieve this. For your particular case, you would want to override the `addressDetail` and `addresses` endpoints. You will need to add the FULL fields for country and regions your endpoints will look like this: addresses: 'users/${userId}/addresses?fields=DEFAULT,addresses(country(FULL),region(FULL))', addressDetail: 'users/${userId}/addresses/${addressId}?fields=country(FULL),region(FULL)', Alternatively, you could just add `fields=FULL` to receive ALL the available details.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "addressbook, region, country, spartacus storefront" }
Distinguishing between homophones in everyday speech While trying to figure out the polite imperative form of I figured the correct conjugation to be I found instead that, colloquially, the imperative is Am I correct in assuming that this is to distinguish between, and in everyday speech?
No. As and have different accents in both standard Japanese and Kansai dialect. and are... * : call someone. * : call someone and ask him to come somewhere. They are similar, sometimes same.
stackexchange-japanese
{ "answer_score": 2, "question_score": 2, "tags": "colloquial language, spoken language, homophonic kanji" }
'X-Frame-Options' is set to 'SAMEORIGIN' while adding custom facebook tab app I am trying to show this page in a custom facebook tab. It is giving me the following error: Refused to display ' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. This thread suggests I remove 'XFrameOptionsMiddleware' from MIDDLEWARE_CLASSES. When I remove that, I get the following error: CSRF verification failed. Request aborted. Reason: Reason given for failure: Referer checking failed - does not match Don't know what to do. How to fix this?
@csrf_exempt fixed the problem
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "python, django, facebook" }
IntelliJ IDEA shows redundant errors that do not exist I have problems with IntelliJ IDEA that appears after some time application is running. It finds errors in code which do not exist and marks them red. For example it tells me that one of arguments must be String instead of... String. The project of course builds ok. Mostly there are few imaginary errors at time and I have to restart IDE to force it to behave normally. What should I do to get rid off these problems? And if it is relevant, I'm developing an Android application. (IntelliJ IDEA 10.5.1 Community Edition #IC-107.322)
This issue is resolved in IDEA 10.5.2.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 3, "tags": "intellij idea" }
Handling global exceptions without killing the app? I throw various custom exceptions thoughout my code. Some of these are recoverable from, so I want a global handler to catch them, display a warning, then carry on. I have found the `AppDomain.UnhandledException` event which has an `IsTerminating` argument, but this is read only. Is there some event or other way to catch exceptions globally that still lets you handle them and carry on? (This is in Forms, but I'd be interesting in a WPF solution too)
Have found the solution. Use `Application.ThreadException` instead of `AppDomain.UnhandledException`. But you must also tell it to give exceptions on the UI thread too: public static void SetupGlobalExceptionHandler() { Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.ThreadException += OnException; } static void OnException(object sender, ThreadExceptionEventArgs args) { MessageBox.Show("There was a problem. Error is:\n\n" + args.Exception.Message); }
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 2, "tags": "c#, .net, winforms, exception, global" }
Where did Open Table go in SQL Server 2008? As of SQL Server 2005, you used to be able to open a flat file in SQL Management Studio off the right click menu for any database table. Once opened, you could add or update records right there in the grid. Now that SQL Server 2008 is out, Microsoft has hidden that feature, at least from the right-click menu. Where did it go?
It's replaced by "Edit Top 200 Rows". You can change that command in the Tools > Options > SQL Server Object Explorer > Commands. But once you right-click a table, choose "Edit Top 200 Rows", hunt on the toolbar for a button called "Show SQL Pane". From here you can edit the query so the grid shows a subset of the data that you want. They did this because people were accidentally opening huge tables with the old Open Table command. This method seems to work pretty well, though in general I find that the 2008 version is pretty wonky when talking to 2005 databases, but that's another matter....
stackexchange-stackoverflow
{ "answer_score": 48, "question_score": 26, "tags": "sql, database, sql server 2008" }
Apache Cordova Error When Add Platforms im new in apache cordova, i try make a project with cordova, in the begining it works, but when i add some platform it giving error. > Error: An error occured during creation of android sub-project. this the screen shoot <
"ERROR : executing command 'ant', make sure you have ant installed and added to your path." You need to install and configure ant if you want to add Android platform : < Here is a guide for Android platform : <
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "apache, cordova" }
Find the correct integers What $3$ integers have a sum of $1$ and a product of $36$ Integers can be negative. I've tried but can't get it. Please help
You could pretty quickly list out the combinations of 3 positive numbers whose product is 36. It appears clear that two of the numbers will need to be negative, so find the set where the biggest number is 1 more than the sum of the smallest 2 numbers.
stackexchange-math
{ "answer_score": 2, "question_score": 0, "tags": "integers" }
How can I build and install vpnc or similar VPN client in CoreOS? How can I build and install vpnc in CoreOS? `vpnc` is a "Cisco-compatible VPN client" and is available in the Ubuntu Server package repository. As CoreOS doesn't include build tools such as `gcc`, `libc`, or `make`, it makes it difficult to build any applications for the operating system. Could I build vpnc and statically link all of the libraries it requires in Ubuntu and then install it in CoreOS? Could I run `vpnc` in an Ubuntu container inside CoreOS that serves as a VPN gateway?
Discussion _Build and run vpnc on CoreOS?_ on forum CoreOS Dev suggested two solutions: 1. Build the binary on Ubuntu and copy it to CoreOS. 2. Run `vpnc` in its own container and run this container and the application container using the VPN within the same pod.
stackexchange-serverfault
{ "answer_score": 0, "question_score": 1, "tags": "vpn, coreos" }
What does the /= operator in Haskell mean? I am reading Learn You a Haskell, which contains `5 /= 5`. I am not so sure what this means. Does the first expression mean `5 / 5 = 5`? But, then, it shouldn't be `True`.
It means not equal. So `5 /= 5` is _false_ as `5 == 5` is _true_. `x /= y = not (x == y)` As suggested, it recalls the mathematical symbol "≠" (/=) opposite to "=" (==).
stackexchange-stackoverflow
{ "answer_score": 47, "question_score": 31, "tags": "haskell" }
difference between new type[0] and null - java What is the difference between type[] a = new type[0]; and type[] a = null; Do either forms occupy any memory ? Are there any similarities / differences ?
The first one (`new type[0]`) will actually create an array object (and therefore occupy memory). You can use the (0-sized) array object, for example to get its length or iterate over it, but you can, of course, not access any of its elements. So you can pass it to any function that doesn't make assumptions about the array's length (but does the proper checks instead) and it will work. The second one (`null`) doesn't create any object. You will get an exception, if you try to access any member.
stackexchange-stackoverflow
{ "answer_score": 8, "question_score": 6, "tags": "java, arrays, null" }
implicit conversion of an Objective-C pointer to 'void *' is disallowed with ARC - sqlite3 I am getting that error when I try to do this using ARC with the following SQLite code: NSMutableArray *rows = [[NSMutableArray alloc] init]; sqlite3_exec(database, "select distinct category from billy", callback, rows, NULL); Anyone know how to fix this?
Be warned that I never do ARC, but casting rows parameter to (__bridge_retained void *) should help if I understand the document correctly. Here is the code I use for testing. static int myCallback(void* ptr, int i, char** p1, char** p2) { NSMutableArray* array = (__bridge_transfer NSMutableArray*)ptr; return 0; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; NSMutableArray *rows = [[NSTestMutableArray alloc] init]; sqlite3_exec(NULL, "select distinct category from billy", &myCallback, (__bridge_retained CFMutableArrayRef)rows, NULL); } (__bridge_transfer ) is for transferring the ownership back so ARC will release it correctly. I override dealloc of my NSTestMutableArray to show that it is really deallocated, and it won't be deallocated if I comment the __bridge_transfer line.
stackexchange-stackoverflow
{ "answer_score": 6, "question_score": 3, "tags": "iphone, objective c, ios, sqlite, automatic ref counting" }
Understanding line bundles on $\mathbb{P}_k^1$ using transition functions Vakil defines $\mathcal{O}_{\mathbb{P}_k^1}(n)$ as follows: it is Spec $k[x_1/x_0]$ on $U_0 = D(x_0)$, and Spec $k[x_0/x_1]$ on $U_1 = D(x_1)$, and the transition function from $U_0$ to $U_1$ is multiplication by $(x_0/x_1)^n$.Then he claims that from this definition it's obvious that $\mathcal{O}(n) = \mathcal{O}(1)^{\otimes n}$. 1. I'm not sure if I completely understand transition functions. Is it basically giving a glue along the open sets $D(x_0/x_1) \subset U_0$ and $D(x_1/x_0) \subset U_1$? 2. I don't see how $\mathcal{O}(n) = \mathcal{O}(1)^{\otimes n}$ follows easily from this transition function definition. Tensor product of sheaves is pretty mysterious to me because you have to sheafify.
Regarding 2, you can use that, if $F$ and $G$ are quasi-coherent sheaves, and $U$ is an affine open, then $(F \otimes G)(U) = F(U) \otimes G(U)$, where the latter tensor product is over $\mathscr{O}(U)$. This is also true of morphisms between quasi-coherent sheaves. This will let you compute the tensor product, and conclude the 'obvious' fact. (It's not obvious.) See here for a reference: Why tensor product of two sheaves of modules is a sheaf of modules? It's also in Ravi, around where he introduces QCoh, I think.
stackexchange-math
{ "answer_score": 0, "question_score": 3, "tags": "algebraic geometry, projective space, line bundles" }
Xml To Excel Pipeline BizTalk I am looking for an XML to Excel Pipeline. I have tried so many of them. even tried to create my own. Is there any sample available that I can start working on?
The best way, if you have the time and the knowhow is to roll your own Excel pipeline Component. In order to get you started, install this into Visual Studio (there are other versions of it depending on BTS version, this one is for BTS 2013 R2): < The wizard will write the boilerplate code for you and will leave you to concentrate on the actual conversion. I'd recommend using some library to generate the Excel itself in order to get a valid, native, Excel file as output, for example EPPlus (< Once it's created, GAC:ed and put in the Pipeline Components folder, add it to your send pipeline in the "Encode" step.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "biztalk, biztalk pipelines" }
Move a local sqlite database to a remote server ios 5 I am creating an iPhone application using xcode 4.2. I have a local SQLite database that I have created and it works fine on the simulator. I want to move this database to a remote server so that others with this application can access the data and it can be updated. Can anyone tell me the easiest way to do this? Or point me in the direction of some good tutorials? I am pretty new to the whole iPhone programming so any help would be appreciated.
< this would help you
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "iphone, ios, database, sqlite, ios5" }
How to remove special charactor and remove space between charactors? I am working in scrapy + python. I have tried to extract jobid data from job url can any one guide me this to extract. < I have to extract this content alone "Director-Financial-Planning-Analysis" also need to remove the special characters too DirectorFinancialPlanningAnalysis my expected output should be : DirectorFinancialPlanningAnalysis My spider code is: hxs = Selector(response) item = response.request.meta['item'] item ['JobDetailUrl'] = response.url item ['InternalJobId'] = item ['JobDetailUrl'].re('.*\/(.*?)\.html').groups() My output error: item ['InternalJobId'] = item['JobDetailUrl'].re('.*\/(.*?)\.html') .groups() exceptions.AttributeError: 'str' object has no attribute 're'
`re()` is a method on a `Selector` object, here `response.url` is a string: re.search(r'([a-zA-Z\-]+)\.html$', response.url).group(1).replace('-', '') Demo: >>> import re >>> s = ' >>> re.search(r'([a-zA-Z\-]+)\.html$', s).group(1).replace('-', '') 'DirectorFinancialPlanningAnalysis'
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "python, python 2.7, selenium, selenium webdriver, scrapy" }
Dropping voltage for red channel on RGB LED I'm looking at a Multicomp OSW-8349 RGB LED, which has a Vf of 3V min / 4V max for the green and blue channels, and a Vf of 1.8V min to 2.8V max for the red channel, at 350mA. I'm planning on regulating 3.3V to drive the green and blue channels, but would like to avoid using another regulator just for the red one. Is there a cheap way to cut the voltage for the red LED? I'm considering using the forward voltage drop of a diode to bring it down to 2.6V, but I'm not sure how well this would work, especially with the temperature varying between ~16°C and ~38°C.
Yes, use a 2Ω resistor in series.
stackexchange-electronics
{ "answer_score": 2, "question_score": 8, "tags": "led, voltage, voltage regulator, diodes" }
How stosd works in assembly? Sorry for this question .. just wanted to understand how stosd works in assembly when EAX is zero mov ecx, 41 lea edi, [variable] xor eax, eax rep stosd I was debugging a malware with these instructions and with each stosd i can see windows directories paths are coming when following edi in dump. But from where these directories are comming when EAX is zero and not referring to any variable?
You are seeing the pointers _already_ stored in the array pointed by `edi`, _before_ each `stosd` overwrites them with zero. `stosd` writes `eax` to `edi` and increments it by four (assuming the `DF` flag is not set, which is usually the case). That snippet is equivalent to `memset(variable, 0, 41*4)`.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "assembly, x86, reverse engineering, analysis, malware" }
Android Studio 'Loading Devices' unable to active I am facing a problem, My android studio application. Loading Devices is disabling. I tried many ways to resolve that. but nothing didn't work. -Create a New Project, Error didn't resolve. -Restart the application even system also. -Followed Previous posts : Android Studio loading device button is disabled Android studio virtual device not loading Nothing Worked!! ![enter image description here](
**Restart** the PC and then **don't** open Android Studio directly , but **run it as Administrator** , this can be some **permission issue** , you can also try **File- >Invalidate Cache & Restart** !
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "android studio, adb" }
Any way to include custom fields in WP_Query results? Looking for a way to include custom fields in the output of WP_Query. I am managing a site where nearly every post type has a lot of custom fields defined and it would be much nicer not to have to run get_post_custom in almost every loop.
You may want to hook somewhere in the gazillion hooks available in **`wp-includes/query.php`**. I would suggest something like this: function my_always_get_post_custom( $posts ) { for ( $i = 0; $i < count($posts); $i++ ) { $custom_fields = get_post_custom( $posts[$i]->ID ); $posts[$i]->custom_fields = $custom_fields; } return $posts; } add_filter( 'the_posts', 'my_always_get_post_custom' ); In this way you will always have your posts custom fields at hand in your **`$post` object** without having to bother to look for them every time you are setting up a loop. From now on, you can just access them using `$post->custom_fields` as a `multi-dimensional array`.
stackexchange-wordpress
{ "answer_score": 5, "question_score": 2, "tags": "custom field, wp query" }
Duplicate keys in python dictionary I read this in the official documentation of Python > It is best to think of a dictionary as a set of key: value pairs, with the requirement that the keys are unique (within one dictionary). But when I am running this code dic={"a":1,"b":2,"a":3,"a":2,"a":4,"a":5} print(dic["a"]) I'm always getting 5 as output. I want to know why.
If you have a dict literal (within `{}`) and a key occurs multiple times, the last one "overwrites" the previous ones. It's just the decision that was taken in the first versions of Python. Print the whole dict to see: >>> dic={"a":1,"b":2,"a":3,"a":2,"a":4,"a":5} >>> dic {'a': 5, 'b': 2} See the docs, emphasis mine: > If a comma-separated sequence of key/datum pairs is given, they are evaluated from left to right to define the entries of the dictionary: each key object is used as a key into the dictionary to store the corresponding datum. **This means that you can specify the same key** **multiple times in the key/datum list, and the final dictionary’s value** **for that key will be the last one given.**
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": -1, "tags": "python" }
Php syntax problem <input type="radio" name="ques1" value="op4">Jingles<br> just a part of the code..... when i am checking this... iam doing this as $selected=$_POST['ques1']; now when i am doing this with for loop.... for($i=0;$i<...;$i++) $selected=$_POST['ques'.{$i+1}]; NEW SYSNTAX ADDED............................... $sql='UPDATE Reg_Stud SET Result=$perc WHERE RegID="$_SESSION['id']"'; //Whats wrong with this one??? ....//whts the correct syntax??
$selected=$_POST['ques'.($i+1)]; or, if you want to use string interpolation, for ($i = 1; $i <= ...; $i ++) { ... $selected = $_POST["ques$i"]; // or $selected = $_POST["ques{$i}"]; ... } That `{...}` is a special syntax to insert a complex variable (but not an expression like `$i+1`) inside a string. Outside of the string, it is just used for grouping statements.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "php" }
Importing MS Project 2013 data into Oracle 11g database Does anyone know if there is a straightforward way to get data out of MS Project 2013 and into Oracle 11g? We have a master schedule created in MS Proj and want to create a web-based application that will perform monitoring and metrics charting of the project schedule statuses. I have successfully exported to CSV and imported into Oracle, but this was cumbersome and required a lot of formatting of the data in the CSV format before it was pushed back into Oracle. I'm in the beginning phases here, but wanted to solicit anyone who may have had experience with this in the past.
If you don't mind writing a little code, you could use MPXJ. You should be able to extract what you need using Java or a .Net language. You can perform the import directly in code, or just generate a suitably formatted output file for import into Oracle using other tools.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "oracle, csv, oracle11g, odbc, ms project" }
FlowDocument TextElements only allowed a single parent I built a new FlowDocument Paragraph B by examining/using elements of an existing Paragraph A. To my surprise the elements I added to the new ParagraphB were magically deleted from ParagraphA. I created a simple illustration below. After the 3rd line executes the myRun element will be removed from myParagraphA. 1) How? What is the underlying mechanism that enables myParagraphA to delete myRun from its inline collection? 2) Why? I assume the designers did not want an element to have 2 parents. 3) If my observations are correct I guess I must add a copy of myRun to myParagraphB to avoid destroying myParagraphA. What is the best way to copy myRun with its text and properties (Cloning)? This is a performance hit since I actually will do this operation a lot. var myRun = new Run("Hello"); var myParagraphA = new Paragraph(myRun); var myParagraphB = new Paragraph(myRun); Thanks,
It's quite common that an item can only be in one list at a time. You'll usually see a Parent property (note: singular). This is the case for XmlElement, TreeViewItem etc. So by adding the Run to myParagraphB you overwrite its Parent property, and proper coding of that property removes it from myParagraphA's list of inlines. The solution is indeed: Cloning.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 3, "tags": "c#, wpf, richtextbox, flowdocument" }
Can't boot from CD/DVD or enter the BIOS on Windows 8 I'm trying to install Ubuntu 12.04 LTS in the same PC that I have Windows 8 installed now. I have burned a DVD with the Ubuntu ISO, so now I need to boot the pc from the DVD. When I access the boot menu on Windows 8, I have only three options: 1. Continue 2. Troubleshot 3. Turn Off your PC There's no `Use a Device` option, so I can't boot my machine from the DVD/CD. Also I can't access the BIOS, because my keyboard starts working when the operating system is active; before that, the lights are off and pressing `F2`, `F8` or `DEL` doesn't work. How can I do that? Thanks in advance.
I solved this by changing the keyboard, now I'm using the one from my other 10-years-old PC that used to use a keyboard with the old-style input (not USB, I don't know it's name). This keyboard is loaded when the machine is turned on, not when Windows is loaded, so now I can press `DEL` to enter the BIOS. Thanks to all.
stackexchange-superuser
{ "answer_score": 0, "question_score": 0, "tags": "windows 8, boot" }
Assign unserialize Laravel object to JS array I have serialize object returning from Controller to blade view in laravel like: "a:3:{i:0;s:1:"2";i:1;s:1:"4";i:2;s:1:"6";}" from my blade view I use this JS code block to get those value as array. var branches = {{unserialize($preliminary->branches)}}; But in there I'm getting error saying > expression expected any suggestions to solve this situation..?
Run `json_encode` on top of your `unserialize`. E.g. var branches = {{json_encode(unserialize($preliminary->branches))}}; `unserialize` is giving you a PHP object, which you are trying to inject directly into JS. By passing it through `json_encode`you convert it to a string javascript can grok.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "javascript, php, json, laravel 5, laravel blade" }
Get elements of list beginning with specific letter I have a list of words `allWords` and I am trying to create a new list from `allWords` containing only those words that begin with a specific letter `currLetter`. Looking at the docs, `collection.map()` seems like a great choice. However the statement below won't compile since `.starts(with: )` returns a boolean. targetWords = allWords.map { $0.starts(with: currLetter) } Can anyone point me in the right direction?
While not described in the documentation of collection type instance methods, the solution is to use `filter()` instead of `map()`: targetWords = allWords.filter { $0.starts(with: currLetter) }
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -1, "tags": "swift, swift5" }
¿Seleccionar un formulario creado mediante un array PHP? Mediante un `array` creo formularios con `php`, cada formulario tiene un `input` `text` el cual esta oculto _(hidden)_ , quiero mostrarlo mediante un botón en cada uno de esos formularios. Parecido a las publicaciones de facebook que para poder comentar tienes que darle click al botón "Comentar" y te aparece el inpux Text Este es mi código `jquery`. $("#mosCom").click(function(){ $("#comend").show(); }); `"moscom"` es el id de los botones mostrar en cada formulario y `"comend"` es el id del input text oculto. El problema es que todos los formularios tienen mismo id pensaba en crear un id con un contador `"moscom1"`, `"moscom2"`, pero me pregunto como podría seleccionar ese id en general con `jquery` y de ahí mostrar el `input text` correspondiente de ese formulario.
yo utilizaría clases para esto. Cada formulario tendría su class="myForm" por ej. Dentro de cada formulario tendrás el botón class="comentar". Por lo tanto, podrías hacer algo como: **html** : <form class="myForm" action="..."> <textarea name="comentario" class="hidden"></textarea> <button class="comentar">Comentar</a> </form> **Javascript:** $(".comentar").on("click", function(){ $(this).parentsUntil('textarea.comentario').show(); }); Esto es una aprox, depende de como tengas hecho tu html, pero en general podrás hacer referencia al parent del botón que ha llamado a la acción.
stackexchange-es_stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "php, javascript, jquery, html" }
error compiling java7 project with maven (heroku) I'm trying to upload on heroku simple servlet with maven. Locally my servlet is working just fine but when i use: `git push heroku master` I get "BUILD FAILURE" with error message: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 3.1:compile (default-compile) on project HelloServlet: Fatal error compiling: invalid target release: 1.7 -> [Help 1] I changed everything to Java 1.7 in system variables, maven is running Java 1.7, javac version is 1.7? Am I missing something here? edit: my JAVA_HOME and error screenshot !enter image description here !enter image description here
By default heroku apps run on OpenJDK 6.You have to add additional properties to make your app use Open JDK 7 on heroku. Refer : <
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 1, "tags": "java, git, maven, heroku" }
Find Fourier half range sine Series for $f(x)=x(\pi-x)$ on $(0,\pi)$. I tried finding the Fourier coefficient $ b_n$ but it came zero. **My attempt:** $ b_n=\frac{4}{\pi}\int_0^\pi x(\pi-x)\sin(2nx)dx\\\ =\frac{4}{\pi}\left\\{\pi\int_0^\pi x\sin(2nx)dx-\int_0^\pi x^2\sin(2nx)dx\right\\}\\\ =0$ **Correct answer is:** $\frac{8}{\pi}\left(\frac{\sin x}{1^3}+\frac{\sin3x}{3^3}+\frac{\sin5x}{5^3}+...\right)$
You should integrate $$\frac{2}{\pi} \int_0^{\pi } x (\pi -x) \sin (n x) \, dx=\frac{4-2 \pi n \sin (\pi n)-4 \cos (\pi n)}{\pi n^3}$$ to get coefficients $$\frac{8}{\pi },0,\frac{8}{27 \pi },0,\frac{8}{125 \pi },\ldots$$ and finally $$\frac{8}{\pi}\left(\sin x +\frac{\sin 3x}{3^3}+\frac{\sin 5x}{5^3}\ldots\right)$$
stackexchange-math
{ "answer_score": 2, "question_score": 2, "tags": "integration, fourier series" }
Looking Forward for someone to doing something I was wondering about "looking forward to" usage but adding in another subject. Is the following correct: I am looking forward for Peter to go (/going/be going) on holidays? I understand the basic usage (I am looking forward to going on holidays), but what about squeezing in another subject?
It doesn't matter. In fact, the object, not the subject is what we are dealing with here: "[I] am [looking forward (to)] [going on holidays]." subject ---------- verb ---------- object "[I] am [looking forward (to)] [(someone) going on holidays]" In the first case, _my_ is implied in place of (someone) and in the OP's example, _Peter_ takes the place. Neither is the subject here. The object phrase is "(someone) going on holidays", or whatever.
stackexchange-english
{ "answer_score": -1, "question_score": 0, "tags": "grammar" }
Enable Android device to access IIS Express whilst on same network I am looking for a way to easily test the mobile version of my site in development. I have set up IIS Express, such that I can access locally using: < or by using my PC name (dazbradbury-pc) < This then works from any machine on my network. However, when I try to use this address from an android device, it simply doesn't work. Has anyone got this working? If so, what further steps were required?
Thanks to @SLaks for the information: > That's probably because Android doesn't do WINS name resolution. Try the IP address. Hence, I updated my IIS Express to point to an IP address by inserting into the bindings in `applicationhost.config` an IP address: <binding protocol="http" bindingInformation="*:80:192.168.1.97" /> where `192.168.1.97` is the local IP address of my machine. I can now access my machines IIS Express instance from my android device.
stackexchange-stackoverflow
{ "answer_score": 10, "question_score": 11, "tags": "visual studio 2010, mobile, localhost, iis express, android browser" }
Display Value instead of Null when Value MINUS Null SELECT --PartnerId, ScheLineDesc, PartNumber, TotalQtyOrder, TotalShippedQty, TotalQtyOrder - TotalShippedQty AS TotalBalanceToShip !enter image description here I need to display TotalQtyOrder in TotalBalanceToShip when TotalShippedQty is Null. Right now, I only get Null.
use `coalesce()` function select ScheLineDesc, PartNumber, TotalQtyOrder, TotalShippedQty, coalesce(TotalQtyOrder, 0) - coalesce(TotalShippedQty, 0) as TotalBalanceToShip
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "sql" }
How to return the login screen of the original unity ubuntu? I've installed the LightDM GTK+ Greeter 1.7.0 as below sudo add-apt-repository ppa:lightdm-gtk-greeter-team/stable sudo apt-get update sudo apt-get install lightdm-gtk-greeter ( Now I want to return to the original login screen of unity ubuntu. Please show me a way. Tasks done but have no result: sudo ppa-purge ppa:lightdm-gtk-greeter-team/stable. sudo apt-fast remove lightdm-gtk-greeter sudo apt-fast install --reinstall lightdm.
First purge the package and remove the PPA. sudo apt-get purge lightdm-gtk-greeter* sudo add-apt-repository --remove ppa:lightdm-gtk-greeter-team/stable sudo apt-get update Then edit the file that reads the greeter. gksudo gedit /etc/lightdm/lightdm.conf.d/10-ubuntu.conf change this line `greeter-session=lightdm-gtk-greeter` to this `greeter-session=unity-greeter` if the line above does not exist, add it. if above file/path does not exits (depends on Ubuntu version) try this one gksudo gedit /etc/lightdm/lightdm.conf Then reconfigure both DM and greeter sudo dpkg-reconfigure lightdm unity-greeter Reboot your PC.
stackexchange-askubuntu
{ "answer_score": 5, "question_score": 4, "tags": "unity, lightdm, login screen" }
Git pull failing due to "local changes" even when there are none? When I try and pull from origin develop im getting this error: error: Your local changes to the following files would be overwritten by merge: filepath/file Please, commit your changes or stash them before you can merge. Aborting However filepath/file is in the git ignore file so when I type `git status` I dont see any changes that I could revert.
As I didn't mind losing my changes to this file I deleted the file, then did `git reset HEAD filepath/file` then `git checkout filepath/file`. This has worked.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "git" }
Getting Google Maps Intent to Return Location So I am trying to build an app that would allows the user to select a particular place from a Google Maps intent, and when the user pick a place, the intent would finish and return the latitude and longitude data to the previous activity. What is the best way to do this? What I have done so far: I used GPSTracker from here. to get the current latitude and longitude, and then used these data to start a google map intent pointing to current location.
The website you posted in your question does not look like it contains the actual map. If you need assistance with adding a Google Map to your application I would start here. Assuming you have that working and your code allows a user to place his or her point already, you can retrieve the coordinates of that point by using a built in function in the Marker class getPosition()). You can use the coordinates by accessing the public variables .latitude and .longitude as follows: `LatLng coord = myMarker.getPosition();` `double latitude = coord.latitude;` `double longitude = coord.longitude;`
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "android, google maps, geolocation" }
Moving your Arum Lilies I have some Arum Lilies that are getting pretty big. Is there some sort of general consensus on when a plant should be moved to a bigger pot. I would like for them to get as big as possible.
We had first better establish which plant you mean - Arum lily applies both to Arum (a bog plant usually grown outdoors) and Zantedeschia. If this is a houseplant, I'll assume it's Zantedeschia of some variety - these are rhizomatomous, and the usual time to divide these will be July/August. In terms of simply potting on to a larger pot, this can be done in Spring if the plant has outgrown its current container.
stackexchange-gardening
{ "answer_score": 3, "question_score": 2, "tags": "houseplants, propagation" }
Linux terminal tail commands i've searched a lot for this and i couldn't find any helpful information, what's the difference between " **tail –f /var/log/messages** " and " **tail –f /var/log/maillog** " in Linux?
A brief list: /var/log/messages : General message and system related stuff /var/log/auth.log : Authenication logs /var/log/kern.log : Kernel logs /var/log/cron.log : Crond logs (cron job) /var/log/maillog : Mail server logs /var/log/boot.log : System boot log /var/log/mysqld.log : MySQL database server log file /var/log/secure or /var/log/auth.log : Authentication log /var/log/utmp or /var/log/wtmp : Login records file
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -2, "tags": "linux, terminal, command, tail" }
Use patch variable or create new agents when only a few patch will update the value (which one is better?) I have to run the some code for different village map setting, now my grid is 20 * 20 patches but I will have up to 60 * 60 grid size as well, all patches now have 2 variables storage and food-level, only 10 patch will use their food-level variable, I can continue with the same settings or I can create 10 other turtles (trees for example) and assign them food-level and remove food-level for patches, which way do you think is better?
Neither approach seems obviously superior to me, given only the information that you've stated. The patches-only approach seems a little simpler, so I guess I'd stick with that for now, but keep the idea of switching in the back of your mind, in case you discover later once your model is more elaborate that there would be benefits to switching to turtles that just aren't apparent yet. Note that if you need to do `patches with [food-level > 0]` a lot, it will take time each to scan all of the patches to find the patches with food. If that turns out to be a performance issue in your model, using turtles instead would solve it. But the ten patches with food on them are always the same, then you could run `patches with [food-level > 0]` once during setup and store the resulting patchset in a global variable, and that would also solve the performance issue.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "performance, patch, agent, netlogo" }
Why is Ruby source code maintained by two version control systems? Why is Ruby maintained by both a SVN repo ` as guided by the official website, and mean while under a git repo ` 2 at github with active issues and pull requests? How does the community manage to merge, say, code contributed to the SVN repo to the Git repo and vice versa?
The SVN repository is where the development happens. The mirror at github is also an SVN repository since github supports those.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "ruby, git, svn, github" }
Windows - Map a Keyboard Key to the Same Action as Left Mouse Button Is the a programmatic way (or something more simple) to map some keyboard key to the same action windows-wide as the left mouse button in Windows XP / Vista. If programmatic is there a way to do this in .NET 2.0 (or greater)?
There is a programmatic way, and it is possible in C# with a global hook. But I find tools like AutoHotkey, which were made for this sort of thing, are much quicker to get up and running. The scripts can also be compiled to executables.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 3, "tags": ".net, windows, keyboard, keyboard shortcuts, mouse" }
how to talk HR about interview I have talked to an HR regarding a job opportunity and we had a discussion about CTC. After that, HR sent me a mail regarding the discussed points. > As we discussed your CTC will be '00.00'. So should I tell truth to HR or no need?
My answer would be : it depends. * In case the difference is small (i.e., the amount is rounded off to the nearest whole number), then probably that is okay. * In case there is a big difference, you should bring it up. There is a possibility that, according to the organizational policies, the package you ought to get is higher than you quoted, and they are offering you the company-standard package (which is higher than your expected number). However, given that you have interview scheduled, you don't want to lose a chance because of any human errors in communication. So, if there is a big difference, better to have it clarified with HR. After all, we all want to _earn_ our paychecks.
stackexchange-workplace
{ "answer_score": 0, "question_score": -2, "tags": "interviewing, communication, salary, human resources, negotiation" }
specify a range in bundler ruby version Is there a way to specify a range for ruby version? ruby '~> 2.1.0' Your Ruby version is 2.1.1, but your Gemfile specified ~> 2.1.0 ruby '>= 2.1.0' Your Ruby version is 2.1.1, but your Gemfile specified >= 2.1.0 Obviously, ranges works for gems, but maybe it's not possible for ruby version. Or did I get my syntax wrong?
You can't set a range for the ruby version, see here Syntax is like so: ruby 'RUBY_VERSION', :engine => 'ENGINE', :engine_version => 'ENGINE_VERSION', :patchlevel => 'RUBY_PATCHLEVEL'
stackexchange-stackoverflow
{ "answer_score": 7, "question_score": 7, "tags": "ruby on rails, bundler" }
warning: getc is obsolete; use STDIN.getc instead I'm having a problem with my rails application. When I type > script/server I get the following error: /Users/admin/.gem/ruby/1.8/gems/activesupport-2.3.5/ lib/active_support/multibyte/unicode_database.rb:37: warning: getc is obsolete; use STDIN.getc instead This causes the application to hang and not respond. How can I resolve this? (I'm using Rails 2.3.5, Gems 1.3.6, Ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin9] on a Mac OS 10.5)
I updated Ruby to > ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin9] and the problem has not occurred since.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "ruby on rails, ruby, rubygems, activesupport" }
search a database where column = array i am trying to see if you can search a database with an array of strings instead of just one if current_user.role == 'Coach' @groups.each do |group| @groupchats << group.id end else @mygroups.each do |group| @groupchats << group.group_id end end @groupchatss = Chat.where("group_id= "[email protected]_s+"").order('created_at DESC') so it searches the database where `group_id= [0,1,2,3]` or whatever the array actually is i am wondering if this is actually possible
You should use sql operator `IN` to do this. Rails will generate right sql query for you: @groupchatss = Chat.where(group_id: @groupchats).order('created_at DESC')
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "ruby on rails, arrays, ruby, database" }
Split the string abcd+xyz i want to split the string and get left and right components with respect to "+" that is i need to get abcd and xyz seperatly. I tried the below code. String org = "abcd+xyz"; String splits[] = org.split("+"); But i am getting null value for splits[0] and splits[1]... Please help..
The string you send as an argument to `split()` is interpreted as a regex (documentation for `split(String regex)`). You should add an escape character before the + sign: String splits[] = org.split("\\+"); You might also find the Summary of regular-expression constructs worth reading :)
stackexchange-stackoverflow
{ "answer_score": 13, "question_score": 1, "tags": "java, android, string" }
Create a new row for each cell containing a value I have a table similar to this: ID | Item 1 | Item 2 | Item 3 | Qty 1 | Qty 2 | Qty 3 1 | | X | X | | 3 | 4 2 | X | | X | 2 | | 1 3 | | | X | | | 9 I need to find a way to create a new row for each item per ID: ID | Item | Qty 1 | 2 | 3 1 | 3 | 4 2 | 1 | 2 Is there any way to accomplish this either through formula, native Excel tools, or VBA?
Use the technique described in detail here to get a Table that looks like this: ![SO33043100 first example]( Delete where ColumnC is `(Blanks)` or `X`. Select ColumnB and HOME > Editing - Find & Select, Replace..., Find what: `Qty`, Replace All. Adjust column labels and center all. You should then have a Table like so: ![SO33043100 second example]( Which you could choose to convert to Rage by right-clicking on one of its cells, Table, Convert to Range.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "sql, excel, excel formula, unpivot, vba" }
Knife list kernel version in an environment I am trying to find the command to list the kernel version for each node in an environment. The following command only list the nodes but not the kernel version. knife search node 'chef_environment:production'
You want: knife search node 'chef_environment:production' -a kernel.release
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "ubuntu, linux kernel, chef infra, chef recipe, knife" }
Inheriting Sitecore Roles I have a role "Editor" which is having certain permissions and don't have read access to Sitecore/Social item. Now i need to create a new role "Approver" which is having same access as Editor but with additional Read and Write access to Sitecore/Social Item. I tried by making Approver as member of Editor and then gave additional access to Approver. But this is not working. ![enter image description here](
`Deny` access right cannot be overwritten by any allow rule. What you need to do is to: * remove that `Deny` read access for `Editor` role * make your `Approver` role a member of `Editor` role * disable inheritance of access rights for that item for your `Editor` role * and for your `Approver` role you need to assign `Read` and `Write` back More information can be found in <
stackexchange-sitecore
{ "answer_score": 6, "question_score": 1, "tags": "security, role management" }
Recommended way to index a date field in postgres? I have a few tables with about 17M rows that all have a date column I would like to be able to utilize frequently for searches. I am considering either just throwing an index on the column and see how things go or sorting the items by date as a one time operation and then inserting everything into a new table so that the primary key ascends as the date ascends. Since these are both pretty time consuming I thought it might be worth it to ask here first for input. The end goal is for me to load sql queries into pandas for some analysis if that is relevant here.
The index on a date column makes sense when you are going to search the table for a given date(s), e.g.: select * from test where the_date = '2016-01-01'; -- or select * from test where the_date between '2016-01-01' and '2016-01-31'; -- etc In these queries there is no matter whether the sort order of primary key and the date column are the same or not. Hence rewriting the data to the new table will be useless. Just create an index. However, if you are going to use the index only in `ORDER BY`: select * from test order by the_date; then a primary key integer index may be significantly (2-4 times) faster then an index on a date column.
stackexchange-stackoverflow
{ "answer_score": 19, "question_score": 12, "tags": "performance, postgresql, indexing" }
GAP Editor with Syntax Highlighting for Windows Can anybody recommend a code editor for Windows which has GAP Syntax Highlighting? Thank you
I made a very simple, bare-bones GAP mode for Notepad++, which I used for a GAP course I taught. The following installation instructions are from the notes I handed to the students. (But I do not normally use Windows myself, so I haven't verified them for some time). 1. Download < 2. In Notepad++, select “Define your language...” from the “Language” menu. 3. In the resulting dialog, click the “Import...” button. 4. This opens a file selector dialog, from which you should select the `gap.xml` file from step 1. 5. Now close the “User Defined Language” dialog
stackexchange-math
{ "answer_score": 5, "question_score": 6, "tags": "soft question, math software, gap" }
Print PDF documents in folder, but specific pages I want to print multiple PDF documents in a folder, but only specific pages (but the same range for all, or better **not** print specific pages). How do I go about doing this?
There are free third-party tools for viewing and printing PDF files, such as Sumatra and PDF-XChange Viewer , that have command-line arguments to specify which documents(s) and page(s) to print (for Sumatra and for PDF-XChange Viewer). E.G., for Sumatra: ` -print-settings "1-3,5,"` prints pages 1,2,3, 5 & 9.
stackexchange-superuser
{ "answer_score": 1, "question_score": 1, "tags": "windows, pdf" }
a method about array algorithm class Node { public int value; public Node next; } private static Node GenerateList(params int[] array) { Node node = null; for (int i = a.Length - 1; i >= 0; i--) { node = new Node { value = array[i], next = node }; } return node; } This `GenerateList` method makes a list from an array, but I can not understand `node = new Node { value = array[i], next = node };`. Fir example, in the first loop: node is equal to a new node, but new node's next node points to the older node. In the second loop, the second new node is equal to the first node, the second new node's node will point to the first node, but what will happen to second node? What am I not understanding?
This is an `array` to the `link list` algorithm. input: array output: link list The starting node is set with the last element of the array. The `next` is set with the nearest item in the array that will be set in the next iteration of the loop. in each step, you move backwards in the array till the start of the array. This example can help: ![enter image description here](
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "c#, arrays, algorithm" }
How to use wifi direct on windows using intel my wifi dashboard I think I have it installed correctly with an intel advanced-n 6200 card (windows 7), I can turn on wifi-direct and see "ralink client" (another pc on windows 8.1 with an rt5572 chipset usb adapter) and my samsung phone but all I can do on both is just renaming or blocking them. Turning on the hotspot function seems to add some more client and makes a new access point appear on my phone as "direct-qu-PC-NAME" but not on my other computer (which could be an issue on its own). Am I doing something wrong, or is wifi-direct simply that, a device turning into an Access Point while being itself a client?
Alright, I got a new phone, which has a working WiFi Direc interface. I could initiate a connection with it to the PC easely. Gotta find out what's wrong on my ralink client now -_-
stackexchange-superuser
{ "answer_score": 0, "question_score": 0, "tags": "windows, wireless networking" }
Workday - Registering API Client - Terminology I want to use the Workday Rest API for Inter System communication What is the difference between Register API Client and Register API Client for Integrations Which one of those options should I use? Thanks Damien
Official answer from Workday is as follows You would use Register API Client when you want a user of your app/web site to be prompted to enter their authentication details. You can use Register API Client for Integrations when you don't want this human interaction.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "workday api" }
Connect to AZ VM from a non-ad joined device > Remote connection to VMs joined to Azure AD is only allowed from Windows 10 PCs that are >either Azure AD registered (minimum required build is 20H1) or Azure AD joined or hybrid >Azure AD joined to the same directory as the VM. Source: < My question: Is it possible to circumvent this? We need to connect to the VM's from non-registered devices as well..
There is no other way as of now. Remote connection to VMs joined to Azure AD is only allowed from Windows 10 PCs that are either Azure AD registered (minimum required build is 20H1) or Azure AD joined or hybrid Azure AD joined to the same directory as the VM. Additionally, to RDP using Azure AD credentials, the user must belong to one of the two Azure roles, Virtual Machine Administrator Login or Virtual Machine User Login.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "azure, azure active directory, virtual machine" }
Professional ways of saying "Keep me in the loop in case you have some other projects I may be able to contribute to" I’m a student and I’ve been visiting a collaborator of my advisor to work on a project. The visiting period ends in a few days and it has been productive and enjoyable. We have worked well together, but the professor has no shortage of students or collaborators. What is a more “refined and professional” way (for lack of a better term) to phrase the following message: > Keep me in the loop in case you have some other projects I may be able to contribute to.
> I really enjoy working with you. I hope you'll think of me if an opportunity arises where I might contribute to one of your projects.
stackexchange-academia
{ "answer_score": 52, "question_score": 36, "tags": "collaboration, communication" }
What functions in python matplotlib or seaborn to customize each box in the heatmap? This figure seems to be generated using python seaborn. But how exactly is each box customized with different shape (star or dot) and background color (size)? !xx Thanks!
I believe the graph in question was created in the R language 'ggplot2'. stackoverflow,Correlation Heatmaps in R The Python seaborn provides the following customization examples.Better Heatmaps and Correlation Matrix Plots in Python The process I found this answer is to search for the posted image in Google (by right-clicking on it) I'm checking out each of these sites, and I encourage you to take a look at them as well. If you've already searched and posted on our site, you're good to go.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "python, matplotlib, seaborn, heatmap" }
Do I need any kind of separator / release agent when casting concrete in shuttering plywood forms? We'll be casting my first concrete countertops soon. We already talked thickness, reinforcement and sealing with manufacturer of concrete mix we will be using (great guys!) so on that part, we feel safe. As you can see below, plywood has really smooth finish. I'll seal and round edges with silicone. My question is - **do I need to spray form with anything?** Or can I just clean it and pour concrete? It looks like it is designed to not need any separating agent, but I prefer to ask before I pour. We'll be using extra smooth mix designed for countertops and small architectural details, if that matters, and designed thickness is 3cm /(1 3/16 inch). ![Photo of smooth finish](
I've seen this done with melamine-coated boards. I would make sure that the plastic veneer of the boards you're using is one solid piece. Family Handyman indicates you don't need any special chemicals to get it out of the form > To remove the form, pry off the long sides and then the short sides. Pry against the form base rather than the concrete. If you have to pry off the form base, use a plastic putty knife; metal will mar the surface
stackexchange-diy
{ "answer_score": 2, "question_score": 2, "tags": "concrete, plywood, kitchen counters, countertops" }
Circular reference in Help --> Other (aka "contact us directly") This rough diagram should explain what I mean: (reference) > ![]( The "If your issue was not covered above, please feel free to contact us directly" line should be removed from the page it's referring to. :)
This is not relevant anymore with the new help center having such contact page: > ![]( Much cleaner, simpler and above all - no more circular reference. :)
stackexchange-meta
{ "answer_score": 1, "question_score": 7, "tags": "feature request, status completed, help center" }
Отдает и POST и GET параметры Не могу понять, почему данный код отдает и GET и POST одновременно Код тут не могу почему-то опубликовать. делаю все по инструкции но не дают отправить поэтому код тут То есть с post.php?act=a_new_book отправляется POST на post.php Как победить эту проблему?
> post.php?act=a_new_book сюда отправить POST запрос и чтобы вывелось, что было отправлено POST'ом Например со страницы index.php идет запрос на страницу post.php?act=a_new_book с POST параметрами name=1&user=62 Переделывая ваш пример: <?php if($_GET['act'] == "add_new_book" ) { ?> <!DOCTYPE html> <html> <head> </head> <body> <form method="POST" action=""> <input name="name" type="text" value="1" /> <input name="user" type="text" value="62" /> <input type="submit" value="Отправить"> </form> </body> </html> <?php } if(!empty($_POST)){ var_dump($_POST); } ?> Дальше разберетесь сами
stackexchange-ru_stackoverflow
{ "answer_score": 1, "question_score": -1, "tags": "php, post, get" }
How the return result like this , What is the lambda function do in this code? flist = [] for i in range(3): flist.append(lambda: i) for f in flist: print f() I don't know why its returning 2,2,2
In the last iteration through the first loop, your `i` value is 2 and hence ALL the `i` values in each element of the list are now 2. This is because you have created a live reference to the `i` variable. Here is a simplified demonstration: a = 5 c = lambda: a a += 5 >>> c() 10
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "python, python 2.7" }
Getting totals of columns depending on other column values I have an Excel sheet as follows: Column A | Column B | Column C ------------------------------ MyCorp | 23.30 | 13.00 Acme | 99.40 | 10.85 Acme | 11.30 | 61.80 Acme | 1.99 | 2.00 Acme | 24.85 | 14.76 NewBiz | 11.00 | 15.00 NewBiz | 44.00 | 44.22 I have several hundred of these records and would like to get summaries (totals) of column B and C for each Column A (company name) - taking into account if there is more than one record for a company the totals should be added How could this be accomplished within Excel?
For this layout, I believe the quickest approach would be to select another cell to output the data to and choose _Consolidate_ from the _data tab_ , with the settings shown... !enter image description here ... alternatively add column titles and use a Pivot Table which would offer more flexibility.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "windows, excel" }
Int32.TryParse C# - How to keep the last integer value I'm trying to convert a string to int with Int32.TryParse(input, out int number); and I want to keep the last integer value. E.g. If string input = "123" then int number = 123 and if string input = "" or null then int number should stay 123 till input had a new string value. Have someone a idea?
Keep a copy of the previous value, and if the parse failed copy it back in: var previousValue = 1; if(!int.TryParse(input, out var number)) { number = previousValue; }
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": -1, "tags": "c#, mvvm, tryparse" }
Glinting/gleaming/glimmering/glittering eyes? Most dictionaries that I have checked give a definition for the adjectives given in the title when they describe eyes, however it is always something like "When eyes X, they shine in a way that expresses a particular emotion". Therefore, I am wondering if these adjectives have different connotations when they describe eyes, as perceived by a native or some who's studied English.
A glint or a gleam in somebody's eye means that somebody has a secret- maybe something that amuses you. A glimmer is a very dim light, so when it is used about somebody's eye, it maybe means that they barely understand something, or feel only a very slight emotion. A glitter or sparkle in somebody's eye suggests that they express a strong feeling.
stackexchange-ell
{ "answer_score": 1, "question_score": 1, "tags": "meaning, word meaning, difference" }
Django - Automatically Assign Cleaned Data to Database Fields The usual way I do form handling is like this: contact = Contact( name=form.cleaned_data['name'], email=form.cleaned_data['email'], message=form.cleaned_data['message'], newsletter=form.cleaned_data['newsletter'] ) but for long forms, this obviously is a tedious task. I was wondering if there was any Django method I might have missed that automatically assigns the cleaned data to their corresponding column in the database table that I don't have to manually assign them. Any ideas? Thanks in advance!
Django offers you a Modelform class that was desgined for exactly this task.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "python, django" }
Postgresql stored procedures transferring Is there are way to get all stored procedures from 1st database and transfer it to the 2nd in creating database script? (without using pgAdmin or stuff like)
If you really interested only in the functions you can query `pg_proc` catalog and grab the `CREATE FUNCTION` statements for a given schema (let's say `public`): $ psql -AXtqc "SELECT pg_get_functiondef(oid)||';' FROM pg_proc p WHERE p.pronamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'public')" your_first_database If you really want only one step: $ psql -AXtqc "SELECT pg_get_functiondef(oid)||';' FROM pg_proc p WHERE p.pronamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'public')" your_first_database | psql your_second_database This is good for one-time-tasks, but not very good for definitive scripts, as the query may change from one version to other of PostgreSQL. Also, it consider function created by extensions as if they were not.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "database, postgresql, stored procedures, transfer" }
Binding Source doesn't work on column names with two or more words in DataGridView C# I am using BindingSource.Filter to filter data on my datagridview. I used the following code: BindingSource bs = new BindingSource(); bs.DataSource = datagridview1.DataSource; bs.Filter = "columnName like '%" + textBox1.Text + "%'"; datagridview1.DataSource = bs; This code works. But when I filter data on a two-word column, the code does not work anymore. I tried putting apostrophe on those words like `'column name' like '%" + tbFilter.Text + "%'`, but this does not help. Please help me find the right code to filter data on my columns.
Enclose column name in `[]`: bs.Filter = "[column Name] like '%" + textBox1.Text + "%'"; I think it's always a good idea even if your column names are one-word.
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 2, "tags": "c#, datagridview, bindingsource" }
Query to get grandparents and grandkids I got a table `people`: ID name surname mother_id father_id -------------------------------------------- 1 John smith null null 2 kate m null null 3 philip smith 2 1 4 dimitr smith 7 3 etc. I tried this query. SELECT p.name, P.surname, c.name as 'Mothers name', c.surname as 'Mothers surname', gm.name as 'Grandmother name', gm.surname as 'Grandmother surname' FROM dbo.people AS p JOIN dbo.people AS c ON (c.mother = p.Id) JOIN dbo.people AS gm ON (gm.mother = c.Id) But it doesn't really return what I expected
Problem with `ON` clause : select p.name, p.surname, coalesce(pm.name, '') as mothername, coalesce(pm.surname, '') as mothersurname, coalesce(pf.name, '') as grandmothername, coalesce(pf.surname, '') as grandmothersurname from people p left join people pm on pm.id = p.mother_id left join -- use mother_id from people p people pf on pf.id = p.father_id; -- use father_id from people p; Here is db-fiddle.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "sql, sql server" }
SwiftUI ScrollView scroll to top Is it possible to scroll to the top of a ScrollView in SwiftUI from the tap of a button? From what I've read so far it sounds like it's not, yet if I tap the status bar it works...
No, it's not. Let's anticipate upcoming WWDC to come up with enhanced SwiftUI.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "swiftui, scrollview" }
Where are .dex files located after apk installation? After installation of apk file on android device, where exactly does the dex file get stored or what is done with dex? Could any one please explain how the installation happens on android device?
The apk file is a compressed archive (actually a .zip in disguise) containing all the files needed for your program. It is stored in the data/app folder. The dex files are contained in this archive, which you can extract with any unzip tool.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 6, "tags": "android, path, installation, apk" }
Relationship between Category theory and Axiomatic set theory I've recently started learning Category theory- and I have a pondering- wondering if anyone can help. Is it possible for two categories to satisfy two different set-axiom system. Namely- is it possible for two distinct categories $SetZFC$ and $SetZF\neg C$ to exists? One satisfying AC and the other negating it? And finally, and more generally- Are categories subjected to any a-priory set of set-axioms? or are those axioms given as information in a given category? Thanks
The question seems to me can you describe the difference in the language of categories? In $Set(ZFC)$ every epimorphism splits, in $Set(ZF\neg C)$ not.
stackexchange-math
{ "answer_score": 4, "question_score": 10, "tags": "set theory, category theory, model theory, axioms" }
Сгенерировать ETH адрес из private key Как узнать ETH Account Address зная только Private key?
Берем приватный ключ (32 байта). Пусть это будет: 0x4040404040404040404040404040404040404040404040404040404040404040 Используя кривую `secp256k1` умножаем генератор на наш приватный ключ. Другими словами, получаем публичный ключ. Нам нужен результат (точка) в `uncompressed` формате. Получаем: 0x0450d1203e168650a52be58141df7b5be8e11f9c38e3ef76bffc9a8225039fcb97e9a96d2f85eddafdb1718ea1bbcc1795fb80a5bc0999e55fb50ae3089027744a Исключаем первый байт (`0x04`, он всегда будет такой) и хешируем полученный остаток (64 байта) функцией `Keccak256`. Это `SHA-3`, но с немного другими изначальными параметрами. Получаем: dd7063143807da6c79aecb72ee7e767e049143712099f92bc8a3b6b7f1b40335 Удаляем первые 12 байт, и получаем адрес: 0xee7e767e049143712099f92bc8a3b6b7f1b40335
stackexchange-ru_stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "ethereum" }
Why I am getting index 0 is out of bounds for axis 0 with size 0? I'm trying to have my function go through the spread sheet inspect every other 3 columns and find the location (row number) of some values but it works partially. The code runs and returns some values but I get this error message between and it stops. I'm using **`start=mm[0]`** to grab the first value from the array and **`end=mm[-1]`** to grab the last value. def get_voltageStatus(r,t): for i in range (1,len(data[0]),3): m=np.where((data[1:,i]>=r) & (data[1:,i]<=t)) mm_raws = [] mm=m[0] start=mm[0] end=mm[-1] print(data[0,i]) duration(start,end) Error is: > start=mm[0] IndexError: index 0 is out of bounds for axis 0 with size 0
this fixed the problem def get_voltageStatus(r,t): all=[] for i in range (1,len(data[0]),3): m=np.where((data[1:,i]>=r) & (data[1:,i]<=t)) print(i) mm_raws = [] mm=m[0] if mm.any(): start=mm[0] end=mm[-1] print(data[0,i]) temp=duration(start,end) all.append([data[0,i],temp])
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "python, arrays, indexing" }