qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
224,434
I am using gnu make and in a Makefile I have, I see below rule. I want to add a similar rule with a recipe, but when I add a rule and its receipe on the next line by giving a tab or space for the recipe, I get make error. ``` dummy : @echo $(OBJS) ``` When i turned on the vim command :set list , i see: ``` dumm...
2010/12/21
[ "https://superuser.com/questions/224434", "https://superuser.com", "https://superuser.com/users/4143/" ]
After picking some pointers from answer given by DMA57361 above, and some more fiddling, i noticed that long time back in my .vimrc I had this command `set expandtab` (It expands tabs into spaces) and I use vim. This was spoiling the Tab character which I was entering in my Makefile rules. Commenting that line in .vim...
In light of the accepted answer: recipes must be preceded by a `tab` character, which is automatically replaced if `set expandtab` is enabled in your `.vimrc`. Overwriting your `.RECIPEPREFIX` is not recommended, as this breaks makefiles in codebases you downloaded. The naive approach is to simply remove `set expandtab...
31,798,158
Recently i changed from **HSQLDB** to **H2**, changed a bit of code and my queries stopped executing. I test my SQL code with RazorSQL where i try to access my DB from , bud to my suprise there is no table created,no errors thrown no null pointers , valid sql, db file created - everything seems to be running alright b...
2015/08/03
[ "https://Stackoverflow.com/questions/31798158", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2733333/" ]
It's possible that re-using the `Statement` could be causing you issues, but since I don't have a fully runnable example to go on, it's difficult to be sure... So, I did this really quick test (using 1.4.182)... ``` import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import j...
**After further examination of my code :** code in original post is working and no change was needed. Problem that i was facing was a way i tryed to connect to my database from **RazorSQL** , JDBC URL that i used didnt matched exact URL that i used in my code i ommited `;DATABASE_TO_UPPER=false` which in turn let me c...
14,247,806
How to send one udp packet multiple time in scapy ? I need to send,an valid udp packet more than one times. Is there any specific method or function in scapy ?
2013/01/09
[ "https://Stackoverflow.com/questions/14247806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1933451/" ]
Here you go: ``` sendp(p, iface=eth0, inter=1 , count=x ) ``` Where `p` is your packet or a list of packets and `count` is the number of times to repeat the send operation. Also check the corresponding documentation [scapy.sendrecv Namespace Reference](http://fossies.org/dox/scapy-2.3.1/namespacescapy_1_1sendrecv....
You can do in a normal loop. Created the valid UDP packet and then put the sending function in a simple loop as follows: ``` for packet in range(No. of time you want to send the packet): send(Your UDP packet) ``` Hope that helps
14,247,806
How to send one udp packet multiple time in scapy ? I need to send,an valid udp packet more than one times. Is there any specific method or function in scapy ?
2013/01/09
[ "https://Stackoverflow.com/questions/14247806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1933451/" ]
create ip packet ``` i=IP() i.dst="destination ip " ``` create udp packet ``` u=UDP() u.dport="destination port" ``` now send ``` while(1) { send(i/u) } ```
You can do in a normal loop. Created the valid UDP packet and then put the sending function in a simple loop as follows: ``` for packet in range(No. of time you want to send the packet): send(Your UDP packet) ``` Hope that helps
14,247,806
How to send one udp packet multiple time in scapy ? I need to send,an valid udp packet more than one times. Is there any specific method or function in scapy ?
2013/01/09
[ "https://Stackoverflow.com/questions/14247806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1933451/" ]
With this line, your packet will be send continuously, on a loop : `send(packet, loop=1)`
You can do in a normal loop. Created the valid UDP packet and then put the sending function in a simple loop as follows: ``` for packet in range(No. of time you want to send the packet): send(Your UDP packet) ``` Hope that helps
14,247,806
How to send one udp packet multiple time in scapy ? I need to send,an valid udp packet more than one times. Is there any specific method or function in scapy ?
2013/01/09
[ "https://Stackoverflow.com/questions/14247806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1933451/" ]
Here you go: ``` sendp(p, iface=eth0, inter=1 , count=x ) ``` Where `p` is your packet or a list of packets and `count` is the number of times to repeat the send operation. Also check the corresponding documentation [scapy.sendrecv Namespace Reference](http://fossies.org/dox/scapy-2.3.1/namespacescapy_1_1sendrecv....
With this line, your packet will be send continuously, on a loop : `send(packet, loop=1)`
14,247,806
How to send one udp packet multiple time in scapy ? I need to send,an valid udp packet more than one times. Is there any specific method or function in scapy ?
2013/01/09
[ "https://Stackoverflow.com/questions/14247806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1933451/" ]
create ip packet ``` i=IP() i.dst="destination ip " ``` create udp packet ``` u=UDP() u.dport="destination port" ``` now send ``` while(1) { send(i/u) } ```
With this line, your packet will be send continuously, on a loop : `send(packet, loop=1)`
43,959,834
Have this jquery function that always gives me the second function every time i click. How can I stop this? I have a navbar that has 3 links and for every link i have a .contentDiv with different id's. Every time somone clicks on one of those links the toggle function takes place; hiding all .contentDiv expect the on...
2017/05/14
[ "https://Stackoverflow.com/questions/43959834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8008855/" ]
You can create a `clickToggle` function and use it to toggle between functions on click: Source: [jQuery click / toggle between two functions](https://stackoverflow.com/questions/4911577/jquery-click-toggle-between-two-functions/21520499#21520499) ```js (function($) { $.fn.clickToggle = function(func1, func2) { ...
```js var c = 1; $('.about').click(function() { $("#aboutContent").toggle(function() { c++; if (c % 2 == 0) alert("1") else alert("2"); }) }) ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> try this: <button class="about"> click </button...
43,959,834
Have this jquery function that always gives me the second function every time i click. How can I stop this? I have a navbar that has 3 links and for every link i have a .contentDiv with different id's. Every time somone clicks on one of those links the toggle function takes place; hiding all .contentDiv expect the on...
2017/05/14
[ "https://Stackoverflow.com/questions/43959834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8008855/" ]
```js var c = 1; $('.about').click(function() { $("#aboutContent").toggle(function() { c++; if (c % 2 == 0) alert("1") else alert("2"); }) }) ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> try this: <button class="about"> click </button...
The jQuery toggle() function to toggle between two specified functions is deprecated in v1.8 and removed in 1.9 as mentioned [here](https://api.jquery.com/toggle-event/). toggle() is now used to alternate show() and hide() only. So you'll have to create a customized toggle plugin as mentioned in the other answer or y...
43,959,834
Have this jquery function that always gives me the second function every time i click. How can I stop this? I have a navbar that has 3 links and for every link i have a .contentDiv with different id's. Every time somone clicks on one of those links the toggle function takes place; hiding all .contentDiv expect the on...
2017/05/14
[ "https://Stackoverflow.com/questions/43959834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8008855/" ]
You can create a `clickToggle` function and use it to toggle between functions on click: Source: [jQuery click / toggle between two functions](https://stackoverflow.com/questions/4911577/jquery-click-toggle-between-two-functions/21520499#21520499) ```js (function($) { $.fn.clickToggle = function(func1, func2) { ...
The jQuery toggle() function to toggle between two specified functions is deprecated in v1.8 and removed in 1.9 as mentioned [here](https://api.jquery.com/toggle-event/). toggle() is now used to alternate show() and hide() only. So you'll have to create a customized toggle plugin as mentioned in the other answer or y...
13,646
I'm working on smart contracts and using Ethereum wallet. I have formed a private test net and successfully deployed smart contracts on that network. But, I didn't get how the miner functionality works in this scenario. **Why mining is needed in private network?** Can someone explain me how mining is done in private ...
2017/03/28
[ "https://ethereum.stackexchange.com/questions/13646", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/6590/" ]
Even if you are the only one on this network, and that you are of course a trusty node, mining is important for 2 things: **confirming your transactions** and **creating new coins**. The transactions are included into blocks that are mined, and since you are the only one on your private network, you also got the rewar...
Depends on the consensus engine your are using. If you are using Ethash (proof-of-work), you would need to mine blocks (with geth, or ethminer). If you use a [Parity private network](https://github.com/paritytech/parity/wiki/Private-chains), you have several additional options. * The original Ethereum [Ethash](https:...
41,133,751
suppose check(x) is a function which returns true/false. suppose foo is a list of tuples I want to filter the tuples in foo. But the number of conditions, n, I want to check will vary n=2 ``` [ x for x in foo if ( check(x[0]) and check(x[1]) ) ] ``` n=3 ``` [ x for x in foo if ( check(x[0]) and check(x[1]) and c...
2016/12/14
[ "https://Stackoverflow.com/questions/41133751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6441544/" ]
Any reason not to use the built-in `all(…)`? > > ### all(...) > > > > ``` > all(iterable) -> bool > > ``` > > Return `True` if `bool(x)` is `True` for all values `x` in the `iterable`. > > > If the `iterable` is empty, return `True`. > > > If `n` is length of your `x`s, then you can use: ``` [ x for x in ...
Use [`all`](https://docs.python.org/2/library/functions.html#all) ``` [ x for x in foo if all(check(x[i]) for i in range(n)) ] ``` Where `n` is the number of checks You can also do it with [`filter`](https://docs.python.org/2/library/functions.html#filter): ``` [ x for x in foo if len(filter(check, x[:n])) == n ] ...
37,999,876
This `Activity` runs in fullscreen. Since elevation is missing in `Kitkat`, the `ViewPager` is going above the `Toolbar`. Here is my layout: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/PhotoPager_Layout" android:lay...
2016/06/23
[ "https://Stackoverflow.com/questions/37999876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3554400/" ]
Items in RelativeLayout are z-ordered. Defaulr oder is: earlier items behind later ones. Your toolbar is first in RelativeLayout, so it is behind any other views. There are three solutions. You can use any of them. 1. Reorder views in RelativeLayout: move toolbat to end: ``` <?xml version="1.0" encoding="utf-8"?> <R...
You better provide the code for that your HackyViewPager custom view to better understand your issue. But my guess is that in there you don't consider different OS versions counting the soft-buttons at the bottom (HOME, BACK, MENU). Starting from Lollipop, the soft buttons are part of the screen, while in earlier versi...
37,999,876
This `Activity` runs in fullscreen. Since elevation is missing in `Kitkat`, the `ViewPager` is going above the `Toolbar`. Here is my layout: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/PhotoPager_Layout" android:lay...
2016/06/23
[ "https://Stackoverflow.com/questions/37999876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3554400/" ]
Items in RelativeLayout are z-ordered. Defaulr oder is: earlier items behind later ones. Your toolbar is first in RelativeLayout, so it is behind any other views. There are three solutions. You can use any of them. 1. Reorder views in RelativeLayout: move toolbat to end: ``` <?xml version="1.0" encoding="utf-8"?> <R...
For me the problem was coming from ScrollView layout which was the parent of ViewPager , when I removed ScrollView, it worked. options in accepted answer didn't help me to solve it
4,014,177
Is there a good algorithm for this? after an amount of searching around I haven't been able to find any conclusive answers. Basically in a system which collects various bits of data about its users, each user is identified by a 64 bit unique Id. this Id is used as a primary key to a data set which may include any amou...
2010/10/25
[ "https://Stackoverflow.com/questions/4014177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/94192/" ]
For each ID generate a unique random ID and store it as part of the users information. Then you can get from an ID to hash. The reverse is computationally possible (as you must scan the whole key space) but excessively hard and time consuming.
Is there any reason why Unique ID needs to be the primary key? May be you could use some other primary key(Hash of the id) and store a encrypted primary user name which is encrypted using a known key. As far as i know a hash value cannot be reversed
2,159,847
I'm struggling with using EditText and Spannable text object, These days, I've read API documents around ten times, even I'm not certain that I understand correctly. So I'm looking for a kind of example which show me how to utilize EditText and Spannable.
2010/01/29
[ "https://Stackoverflow.com/questions/2159847", "https://Stackoverflow.com", "https://Stackoverflow.com/users/258508/" ]
Since you don't specify what you can't grasp from the API it's hard to answer your questions (short answer: rewrite your question to a specific questions rather than a general one). A typical Spannable-example is something like this to turn selected text in an EditText into Italic: ``` Spannable str = mBodyText.getTe...
I'm just starting to try to figure it out too, and it seems unnecessarily tricky. Here's a working method to add NEW spannable text to an existing view. I wanted to add colored text to a view, and this seemed like the only way to do it. Though it feels like an ugly hack, you can create a dummy TextView (not shown any...
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
The trackpad getting stuck is also a well known symptom of a bulging battery in the MacBook Pros of this generation. I'm dealing with this issue myself and am very annoyed about it too, because this 2007 Santa Rosa MBP I paid for is essentially the most lemon computer I've ever owned (at least four other hardware failu...
I had the same exact problem and it was almost unbearable to search for help. I took out the battery but kept my MacBook connected to the adaptor and, go figure, it works like a charm. Time for a new battery! The bulging on my battery is very noticeable.
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
This is going to sound dumb, but have you restarted the Mac? I've had this issue on my Magic Trackpad a couple of times and the only way I was able to cure it was with a simple restart. (At first I thought it might be because I also ran MagicPrefs, but I've since removed that and the problem still occurs sometimes). I...
I've had an iBook g4 that had this "Issue"... it turned out a cookie crumble got stuck in the space between trackpad and case (don't ask). Clicking a few times on different places on the trackpad and some canned air fixed it. Might be worth a try before you pop out the screwdrivers.
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
This is going to sound dumb, but have you restarted the Mac? I've had this issue on my Magic Trackpad a couple of times and the only way I was able to cure it was with a simple restart. (At first I thought it might be because I also ran MagicPrefs, but I've since removed that and the problem still occurs sometimes). I...
In most models there's a screw directly beneath the trackpad that influences how hard/soft the click should be. If you have the right tools to open it up, you could try turning it a bit to see what happens. What you can try first is to press down on the button, hold it down, move your finger from left to right a few t...
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
I had the same exact problem and it was almost unbearable to search for help. I took out the battery but kept my MacBook connected to the adaptor and, go figure, it works like a charm. Time for a new battery! The bulging on my battery is very noticeable.
In most models there's a screw directly beneath the trackpad that influences how hard/soft the click should be. If you have the right tools to open it up, you could try turning it a bit to see what happens. What you can try first is to press down on the button, hold it down, move your finger from left to right a few t...
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
The trackpad getting stuck is also a well known symptom of a bulging battery in the MacBook Pros of this generation. I'm dealing with this issue myself and am very annoyed about it too, because this 2007 Santa Rosa MBP I paid for is essentially the most lemon computer I've ever owned (at least four other hardware failu...
This is going to sound dumb, but have you restarted the Mac? I've had this issue on my Magic Trackpad a couple of times and the only way I was able to cure it was with a simple restart. (At first I thought it might be because I also ran MagicPrefs, but I've since removed that and the problem still occurs sometimes). I...
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
The trackpad getting stuck is also a well known symptom of a bulging battery in the MacBook Pros of this generation. I'm dealing with this issue myself and am very annoyed about it too, because this 2007 Santa Rosa MBP I paid for is essentially the most lemon computer I've ever owned (at least four other hardware failu...
I had something similar happen to my Macbook pro 2010. I fixed it by: 1. Open system preferences 2. Click Trackpad 3. Uncheck Tap to click, Dragging, Drag lock, secondary click Not sure if this is the same on a 2007 model.
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
The trackpad getting stuck is also a well known symptom of a bulging battery in the MacBook Pros of this generation. I'm dealing with this issue myself and am very annoyed about it too, because this 2007 Santa Rosa MBP I paid for is essentially the most lemon computer I've ever owned (at least four other hardware failu...
In most models there's a screw directly beneath the trackpad that influences how hard/soft the click should be. If you have the right tools to open it up, you could try turning it a bit to see what happens. What you can try first is to press down on the button, hold it down, move your finger from left to right a few t...
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
This is going to sound dumb, but have you restarted the Mac? I've had this issue on my Magic Trackpad a couple of times and the only way I was able to cure it was with a simple restart. (At first I thought it might be because I also ran MagicPrefs, but I've since removed that and the problem still occurs sometimes). I...
I had something similar happen to my Macbook pro 2010. I fixed it by: 1. Open system preferences 2. Click Trackpad 3. Uncheck Tap to click, Dragging, Drag lock, secondary click Not sure if this is the same on a 2007 model.
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
I had the same exact problem and it was almost unbearable to search for help. I took out the battery but kept my MacBook connected to the adaptor and, go figure, it works like a charm. Time for a new battery! The bulging on my battery is very noticeable.
I've had an iBook g4 that had this "Issue"... it turned out a cookie crumble got stuck in the space between trackpad and case (don't ask). Clicking a few times on different places on the trackpad and some canned air fixed it. Might be worth a try before you pop out the screwdrivers.
662
The trackpad button on my 2007 Macbook Pro seems to be sticking. Specifically, it's stuck in the "down" position, which means I'm selecting pretty much everything all the time (you wouldn't believe how frustrating it was just to ask this question). It was fine yesterday. What can I do to unstick it?
2010/08/27
[ "https://apple.stackexchange.com/questions/662", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/477/" ]
I had the same exact problem and it was almost unbearable to search for help. I took out the battery but kept my MacBook connected to the adaptor and, go figure, it works like a charm. Time for a new battery! The bulging on my battery is very noticeable.
I had something similar happen to my Macbook pro 2010. I fixed it by: 1. Open system preferences 2. Click Trackpad 3. Uncheck Tap to click, Dragging, Drag lock, secondary click Not sure if this is the same on a 2007 model.
2,048,301
I am exporting a function [using \_declspec(dllexport)] from a C++ exe. The function works fine when invoked by the exe itself. I am loading this exe (lets call this exe1) from another exe [the test project's exe - I'll call this exe2] using static linking i.e I use exe1's .lib file while compiling exe2 and exe2 loads ...
2010/01/12
[ "https://Stackoverflow.com/questions/2048301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/248748/" ]
Yes, you should read some topics of John L. Hennessy & David A. Patterson, "Computer Architecture: A quantitative Approach" It has microprocessors' history and theory , (starting with RISC archs - MIPS), pipelining, memory, storage, etc. David Patterson is a Professor of Computer of Computer Science on EECS Departm...
While I agree with the previous answers insofar as it is incredibly difficult to understand the entire process, we can at least break it down into categories, from lowest (closest to electrons) to highest (closest to what you actually see). Lowest Solid State Device Physics (How transistors work physically) Circuit Th...
2,048,301
I am exporting a function [using \_declspec(dllexport)] from a C++ exe. The function works fine when invoked by the exe itself. I am loading this exe (lets call this exe1) from another exe [the test project's exe - I'll call this exe2] using static linking i.e I use exe1's .lib file while compiling exe2 and exe2 loads ...
2010/01/12
[ "https://Stackoverflow.com/questions/2048301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/248748/" ]
Tanenbaum's [Structured Computer Organization](https://rads.stackoverflow.com/amzn/click/com/0131485210) is a good book about how computers work. You might find it hard to get through the book, but that's mostly due to the subject, not the author. However, I'm not sure I would recommend taking this approach. Understan...
While I agree with the previous answers insofar as it is incredibly difficult to understand the entire process, we can at least break it down into categories, from lowest (closest to electrons) to highest (closest to what you actually see). Lowest Solid State Device Physics (How transistors work physically) Circuit Th...
2,048,301
I am exporting a function [using \_declspec(dllexport)] from a C++ exe. The function works fine when invoked by the exe itself. I am loading this exe (lets call this exe1) from another exe [the test project's exe - I'll call this exe2] using static linking i.e I use exe1's .lib file while compiling exe2 and exe2 loads ...
2010/01/12
[ "https://Stackoverflow.com/questions/2048301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/248748/" ]
In my opinion, 20 years ago it was possible to understand the whole spectrum from BASIC all the way through operating system, hardware, down to the transistor or even quantum level. I don't know that it's possible for one person to understand that whole spectrum with today's technology. (Years ago, everyone serviced th...
While I agree with the previous answers insofar as it is incredibly difficult to understand the entire process, we can at least break it down into categories, from lowest (closest to electrons) to highest (closest to what you actually see). Lowest Solid State Device Physics (How transistors work physically) Circuit Th...
2,048,301
I am exporting a function [using \_declspec(dllexport)] from a C++ exe. The function works fine when invoked by the exe itself. I am loading this exe (lets call this exe1) from another exe [the test project's exe - I'll call this exe2] using static linking i.e I use exe1's .lib file while compiling exe2 and exe2 loads ...
2010/01/12
[ "https://Stackoverflow.com/questions/2048301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/248748/" ]
It's pretty simple really - the cpu loads instructions and executes them, most of those instructions revolve around loading values into registers or memory locations, and then manipulating those values. Certain memory ranges are set aside for communicating with the peripherals that are attached to the machine, such as ...
While I agree with the previous answers insofar as it is incredibly difficult to understand the entire process, we can at least break it down into categories, from lowest (closest to electrons) to highest (closest to what you actually see). Lowest Solid State Device Physics (How transistors work physically) Circuit Th...
206,418
In PCA the first dimension of the basis vector has the highest variance and the last has the least variance. So if we are using PCA just for dimension reduction why cant we find the variance of individual features, sort the features in the descending order of the variance and just use the first n features/dimensions.
2012/10/03
[ "https://math.stackexchange.com/questions/206418", "https://math.stackexchange.com", "https://math.stackexchange.com/users/43453/" ]
PCA is a process of projecting your matrix onto the eigenvectors of the covariance matrix of your data. There is one to one correspondence between eigenvectors and the principal components. It is a transformation which provably and optimally transform your data to a space from where you can recover your data, removing ...
what you are saying is not entirely wrong..actually it is the gist of PCA algorithm but it also probably does the work of transformation of data in plane to get a better understanding of it. I hope this link will help you a lot on this...PCA is an algorithm that is in use since about 1905..and there is no much better r...
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
None of the above solutions worked for me I use Vs Code btw so the thing I did was first go to android->build gradle and look for this line of code ``` dependencies { classpath 'com.android.tools.build:gradle:7.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } ``` **AND CHANGE THAT...
I found myself with the exact same problem, I searched a lot how to make the sdk changes, tried many of the solutions that are mentioned in several POSTs and nothing seemed to work or solve the problem, however the one that did work provisionally was to overwrite the version from gradle.properties with ``` org.gradle....
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
in my mac, there is no gradle projects settings, so this is what i solved my problem: [`1. Open project structure in android studio`](https://i.stack.imgur.com/R9NrC.jpg) [`2. Follow platform settings > android studio default JDK`](https://i.stack.imgur.com/EuMLa.png) [`3. Then download JDK with this settings`](http...
I found myself with the exact same problem, I searched a lot how to make the sdk changes, tried many of the solutions that are mentioned in several POSTs and nothing seemed to work or solve the problem, however the one that did work provisionally was to overwrite the version from gradle.properties with ``` org.gradle....
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
I got the same problem but what I did is that I deleted the android folder and run it again. If your are using android studio, in your terminal past this **Flutter create .** and it will build the android project using your specified SDK instead
I am using ``` - Flutter 3.3.2 - Android Studio 4.1.1 - Java 1.8 ``` **Solution:** *changing gradle classpath at android/build.gradle file under dependencies* ``` classpath 'com.android.tools.build:gradle:7.1.2' ``` TO ``` classpath 'com.android.tools.build:gradle:4.1.0' ``` [![enter image descrip...
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
in my mac, there is no gradle projects settings, so this is what i solved my problem: [`1. Open project structure in android studio`](https://i.stack.imgur.com/R9NrC.jpg) [`2. Follow platform settings > android studio default JDK`](https://i.stack.imgur.com/EuMLa.png) [`3. Then download JDK with this settings`](http...
in vs code in ur explorer open android>app>gradle.properties and then add this code ``` org.gradle.java.home=C:\\Program Files\\Java\\jdk-18.0.2 ``` if u use another version of jdk then replace jdk-18.0.2 to jdk-ur version the all code in gradle.properties should be like this ``` org.gradle.jvmargs=-Xmx1536M androi...
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
I had that problem and I had solved it doing this: Add the command below in gradle.properties file: ``` org.gradle.java.home=C:\Program Files\\Java\\jdk-18.0.1.1. ``` In my case: ``` org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true org.gradle.java.home=C:\Program Files\\Java\\jdk-1...
None of the above solutions worked for me I use Vs Code btw so the thing I did was first go to android->build gradle and look for this line of code ``` dependencies { classpath 'com.android.tools.build:gradle:7.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } ``` **AND CHANGE THAT...
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
in my mac, there is no gradle projects settings, so this is what i solved my problem: [`1. Open project structure in android studio`](https://i.stack.imgur.com/R9NrC.jpg) [`2. Follow platform settings > android studio default JDK`](https://i.stack.imgur.com/EuMLa.png) [`3. Then download JDK with this settings`](http...
It worked for me that I removed [project\_name].iml file in the project folder, and ran the main.
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
**The headache-less solution:** Just uninstall your (older) version of android studio, go to their website, and install the latest version. This should automatically update your java version to whatever your Flutter project requires. Worked for me after trying lots of other methods.
It worked for me that I removed [project\_name].iml file in the project folder, and ran the main.
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
Is your place set up? Is the gradle java version too low ``` JAVA_HOME D:\Android\Android Studio\jre %JAVA_HOME%\bin ``` [![enter image description here](https://i.stack.imgur.com/IRW46.png)](https://i.stack.imgur.com/IRW46.png)
None of the above solutions worked for me I use Vs Code btw so the thing I did was first go to android->build gradle and look for this line of code ``` dependencies { classpath 'com.android.tools.build:gradle:7.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } ``` **AND CHANGE THAT...
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
I had that problem and I had solved it doing this: Add the command below in gradle.properties file: ``` org.gradle.java.home=C:\Program Files\\Java\\jdk-18.0.1.1. ``` In my case: ``` org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true org.gradle.java.home=C:\Program Files\\Java\\jdk-1...
**The headache-less solution:** Just uninstall your (older) version of android studio, go to their website, and install the latest version. This should automatically update your java version to whatever your Flutter project requires. Worked for me after trying lots of other methods.
71,532,385
I imported a Flutter project, and when I tried to run it, I got this message error: ``` FAILURE: Build failed with an exception. * Where: Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24 * What went wrong: A problem occurred evaluating project ':app'. > Failed to ...
2022/03/18
[ "https://Stackoverflow.com/questions/71532385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10831461/" ]
I had that problem and I had solved it doing this: Add the command below in gradle.properties file: ``` org.gradle.java.home=C:\Program Files\\Java\\jdk-18.0.1.1. ``` In my case: ``` org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true org.gradle.java.home=C:\Program Files\\Java\\jdk-1...
in vs code in ur explorer open android>app>gradle.properties and then add this code ``` org.gradle.java.home=C:\\Program Files\\Java\\jdk-18.0.2 ``` if u use another version of jdk then replace jdk-18.0.2 to jdk-ur version the all code in gradle.properties should be like this ``` org.gradle.jvmargs=-Xmx1536M androi...
42,114,468
I am trying to condense a large dataset with some rules and then return object. What I´ve done inside a model is this: ``` class Network < ActiveRecord::Base def condense self.each do |row| #Maybe delete row end return self end end ``` So maybe I have misunderstood but calling Network.all.cond...
2017/02/08
[ "https://Stackoverflow.com/questions/42114468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2319731/" ]
You have defined an instance method, whereas what you want is a `Network`'s singleton method: ``` def self.condense # now `self` here is a `Network` class itself all.each do |row| # iterate over each instance of the class end end ``` Usage: ``` Network.condense ``` P.S. Be aware, that using `all.each` is ve...
The only problem you have is that you don't understand `self`. Here is a basic rule of thumb: * `self` in an instance method refers to the current object of the class. * `self` in a class method refers to the class itself. So can you tell me what are the 2 `self` in your code refer to?
42,114,468
I am trying to condense a large dataset with some rules and then return object. What I´ve done inside a model is this: ``` class Network < ActiveRecord::Base def condense self.each do |row| #Maybe delete row end return self end end ``` So maybe I have misunderstood but calling Network.all.cond...
2017/02/08
[ "https://Stackoverflow.com/questions/42114468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2319731/" ]
You can create a class that takes in the array of `Networks` you want to `condense` ``` class NetworkCondenser def initialize(networks) @networks = networks end def call @networks.each do |network| # do your stuff here end @networks end end ``` And use it like this, from a controller o...
The only problem you have is that you don't understand `self`. Here is a basic rule of thumb: * `self` in an instance method refers to the current object of the class. * `self` in a class method refers to the class itself. So can you tell me what are the 2 `self` in your code refer to?
51,330,098
I'm using the following code (in Kotlin) to select an image from the Google Photos app on my Samsung tablet. ``` val intent = Intent (Intent.ACTION_GET_CONTENT) intent.type = "image/*" startActivityForResult(intent, REQUEST_GOOGLE_PHOTOS_IMAGE) ``` I've also tried ``` Intent (Intent.ACTION_GET_CONTENT,MediaStore....
2018/07/13
[ "https://Stackoverflow.com/questions/51330098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5277309/" ]
Instead of looping you could use a timer to periodically poll for the CPU usage. ``` class Test { private System.Timers.Timer _timer; public Test( ) { _timer = new System.Timers.Timer { // Interval set to 1 millisecond. Interval = 1, AutoReset = true, ...
I'd use `Task.Run` instead of a `BackgroundWorker` in your case: ``` private void Grid_Loaded(object sender, RoutedEventArgs e) { //Keep it running for 5 minutes CancellationTokenSource cts = new CancellationTokenSource(new TimeSpan(hours: 0, minutes: 5, seconds: 0)); //Keep it running until user closes t...
13,017
If I travelled near a black hole, my time would progress slower relative to someone on Earth. This is clear enough. However, what if we sent a probe with a camera to a black hole? When we watch the screen, would we see time through the camera's perspective — that is, would the Universe appear to progress faster as the ...
2015/12/29
[ "https://astronomy.stackexchange.com/questions/13017", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/9301/" ]
> > If I travelled near a black hole, my time would progress slower relative to someone on Earth. This is clear enough. > > > Yes, no problem with the gravitational time dilation. > > However, what if we sent a probe with a camera to a black hole? When we watch the screen, would we see time through the camera'...
For simplicity, let's say that the black hole is isolated and non-rotating (and uncharged), so that the situation is described by the comparatively simple Schwarzschild spacetime. Let's also suppose that the camera free-falls radially into the black hole. What is the camera looking at? Suppose it is looking at some st...
24,605
I was playing with my brother, and we both had equal number of pieces. He carelessly moved his king in the direction of my queen. I was about to checkmate my brother, but he told that my mating move was invalid. If his king comes in my direction and gets caught, I must say that I don't keep there. I was confused. Can...
2019/05/29
[ "https://chess.stackexchange.com/questions/24605", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/19248/" ]
Yes. Putting your own king into danger is considered an illegal move. Depending on the context, illegal moves can be treated in different ways: * In most casual games, players just agree to roll back to the position before the illegal move was made. * In tournament games, the player who didn't make the illegal move ge...
If by "get caught" you mean the king moves such that it can be taken in one move, then yes you don't win the game. You must allow your opponent to take the move back. In official tournaments this would be counted as an "illegal move", and after 2 illegal moves from your opponent you win the game. A checkmate is where ...
24,605
I was playing with my brother, and we both had equal number of pieces. He carelessly moved his king in the direction of my queen. I was about to checkmate my brother, but he told that my mating move was invalid. If his king comes in my direction and gets caught, I must say that I don't keep there. I was confused. Can...
2019/05/29
[ "https://chess.stackexchange.com/questions/24605", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/19248/" ]
Yes. Putting your own king into danger is considered an illegal move. Depending on the context, illegal moves can be treated in different ways: * In most casual games, players just agree to roll back to the position before the illegal move was made. * In tournament games, the player who didn't make the illegal move ge...
Moving your king into check (i.e. where it can be captured) is called an "illegal move". If you are playing a casual game then you should put the position back to what it was before the illegal move was made and make a legal move. If you are playing in a competition then more formal rules apply as specified in the se...
24,605
I was playing with my brother, and we both had equal number of pieces. He carelessly moved his king in the direction of my queen. I was about to checkmate my brother, but he told that my mating move was invalid. If his king comes in my direction and gets caught, I must say that I don't keep there. I was confused. Can...
2019/05/29
[ "https://chess.stackexchange.com/questions/24605", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/19248/" ]
Yes. Putting your own king into danger is considered an illegal move. Depending on the context, illegal moves can be treated in different ways: * In most casual games, players just agree to roll back to the position before the illegal move was made. * In tournament games, the player who didn't make the illegal move ge...
There is a special case where you can reply to an illegal move with checkmate. In blitz chess different sets of rules exist. I have played blitz tournaments over the board where if you leave your king in check [so you have made an illegal move] the other player can "take" your king which is checkmate and they win the g...
24,605
I was playing with my brother, and we both had equal number of pieces. He carelessly moved his king in the direction of my queen. I was about to checkmate my brother, but he told that my mating move was invalid. If his king comes in my direction and gets caught, I must say that I don't keep there. I was confused. Can...
2019/05/29
[ "https://chess.stackexchange.com/questions/24605", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/19248/" ]
If by "get caught" you mean the king moves such that it can be taken in one move, then yes you don't win the game. You must allow your opponent to take the move back. In official tournaments this would be counted as an "illegal move", and after 2 illegal moves from your opponent you win the game. A checkmate is where ...
There is a special case where you can reply to an illegal move with checkmate. In blitz chess different sets of rules exist. I have played blitz tournaments over the board where if you leave your king in check [so you have made an illegal move] the other player can "take" your king which is checkmate and they win the g...
24,605
I was playing with my brother, and we both had equal number of pieces. He carelessly moved his king in the direction of my queen. I was about to checkmate my brother, but he told that my mating move was invalid. If his king comes in my direction and gets caught, I must say that I don't keep there. I was confused. Can...
2019/05/29
[ "https://chess.stackexchange.com/questions/24605", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/19248/" ]
Moving your king into check (i.e. where it can be captured) is called an "illegal move". If you are playing a casual game then you should put the position back to what it was before the illegal move was made and make a legal move. If you are playing in a competition then more formal rules apply as specified in the se...
There is a special case where you can reply to an illegal move with checkmate. In blitz chess different sets of rules exist. I have played blitz tournaments over the board where if you leave your king in check [so you have made an illegal move] the other player can "take" your king which is checkmate and they win the g...
324,004
I am currently discovering the algebraic geometry of Grothendieck. I have the impression that this theory, which leads to categories, schemas, topos etc. alone can encompass all modern mathematics (with the exception of probabilities). That is to say, to understand it, you really need to know everything. It also has ex...
2019/02/24
[ "https://mathoverflow.net/questions/324004", "https://mathoverflow.net", "https://mathoverflow.net/users/131855/" ]
There are lots of examples, so let me just tell one. P. Deligne (1971) used [Eichler–Shimura isomorphism](http://en.wikipedia.org/wiki/Eichler%E2%80%93Shimura%20isomorphism) to reduce the [Ramanujan conjecture](https://en.wikipedia.org/wiki/Ramanujan%E2%80%93Petersson_conjecture) on the $\tau$ function to the [Weil co...
You can look at *Lectures on applied $\ell$-adic cohomology* by Fouvry, Kowalski, Michel and Sawin : <https://arxiv.org/abs/1712.03173>
324,004
I am currently discovering the algebraic geometry of Grothendieck. I have the impression that this theory, which leads to categories, schemas, topos etc. alone can encompass all modern mathematics (with the exception of probabilities). That is to say, to understand it, you really need to know everything. It also has ex...
2019/02/24
[ "https://mathoverflow.net/questions/324004", "https://mathoverflow.net", "https://mathoverflow.net/users/131855/" ]
Do you consider $L$-functions of elliptic curves over $\mathbf Q$ (or other number fields) to be in the spirit of "analytic number theory undertaken by Dirichlet, Von Mangoldt, Chebyshev, Hardy, Littlewood, Ramanujan, and so on"? Those 19th and early 20th century folks did not have the definition, which only came much ...
There are lots of examples, so let me just tell one. P. Deligne (1971) used [Eichler–Shimura isomorphism](http://en.wikipedia.org/wiki/Eichler%E2%80%93Shimura%20isomorphism) to reduce the [Ramanujan conjecture](https://en.wikipedia.org/wiki/Ramanujan%E2%80%93Petersson_conjecture) on the $\tau$ function to the [Weil co...
324,004
I am currently discovering the algebraic geometry of Grothendieck. I have the impression that this theory, which leads to categories, schemas, topos etc. alone can encompass all modern mathematics (with the exception of probabilities). That is to say, to understand it, you really need to know everything. It also has ex...
2019/02/24
[ "https://mathoverflow.net/questions/324004", "https://mathoverflow.net", "https://mathoverflow.net/users/131855/" ]
There are lots of examples, so let me just tell one. P. Deligne (1971) used [Eichler–Shimura isomorphism](http://en.wikipedia.org/wiki/Eichler%E2%80%93Shimura%20isomorphism) to reduce the [Ramanujan conjecture](https://en.wikipedia.org/wiki/Ramanujan%E2%80%93Petersson_conjecture) on the $\tau$ function to the [Weil co...
From the point of view of analytic number theory the most important specific result which is proved using algebraic geometry is Burgess' bounds for character sums. The proof relies on Wiles bound for character sums, together with a rather complicated combinatorial argument. One could argue that as Stepanov, Schmidt, an...
324,004
I am currently discovering the algebraic geometry of Grothendieck. I have the impression that this theory, which leads to categories, schemas, topos etc. alone can encompass all modern mathematics (with the exception of probabilities). That is to say, to understand it, you really need to know everything. It also has ex...
2019/02/24
[ "https://mathoverflow.net/questions/324004", "https://mathoverflow.net", "https://mathoverflow.net/users/131855/" ]
Do you consider $L$-functions of elliptic curves over $\mathbf Q$ (or other number fields) to be in the spirit of "analytic number theory undertaken by Dirichlet, Von Mangoldt, Chebyshev, Hardy, Littlewood, Ramanujan, and so on"? Those 19th and early 20th century folks did not have the definition, which only came much ...
You can look at *Lectures on applied $\ell$-adic cohomology* by Fouvry, Kowalski, Michel and Sawin : <https://arxiv.org/abs/1712.03173>
324,004
I am currently discovering the algebraic geometry of Grothendieck. I have the impression that this theory, which leads to categories, schemas, topos etc. alone can encompass all modern mathematics (with the exception of probabilities). That is to say, to understand it, you really need to know everything. It also has ex...
2019/02/24
[ "https://mathoverflow.net/questions/324004", "https://mathoverflow.net", "https://mathoverflow.net/users/131855/" ]
You can look at *Lectures on applied $\ell$-adic cohomology* by Fouvry, Kowalski, Michel and Sawin : <https://arxiv.org/abs/1712.03173>
From the point of view of analytic number theory the most important specific result which is proved using algebraic geometry is Burgess' bounds for character sums. The proof relies on Wiles bound for character sums, together with a rather complicated combinatorial argument. One could argue that as Stepanov, Schmidt, an...
324,004
I am currently discovering the algebraic geometry of Grothendieck. I have the impression that this theory, which leads to categories, schemas, topos etc. alone can encompass all modern mathematics (with the exception of probabilities). That is to say, to understand it, you really need to know everything. It also has ex...
2019/02/24
[ "https://mathoverflow.net/questions/324004", "https://mathoverflow.net", "https://mathoverflow.net/users/131855/" ]
Do you consider $L$-functions of elliptic curves over $\mathbf Q$ (or other number fields) to be in the spirit of "analytic number theory undertaken by Dirichlet, Von Mangoldt, Chebyshev, Hardy, Littlewood, Ramanujan, and so on"? Those 19th and early 20th century folks did not have the definition, which only came much ...
From the point of view of analytic number theory the most important specific result which is proved using algebraic geometry is Burgess' bounds for character sums. The proof relies on Wiles bound for character sums, together with a rather complicated combinatorial argument. One could argue that as Stepanov, Schmidt, an...
2,923,901
Consider the following two problems: > > 1. Show that if for some $x\in\mathbb R$ and for each $n\in\mathbb N$ we have $n^x\in\mathbb N$, then $x\in\mathbb N$. > 2. Show that if for some $x\in\mathbb R$ and for each $n\in\mathbb N$ we have $n^x\in\mathbb Q$, then $x\in\mathbb Z$. > > > The first of those is a som...
2018/09/20
[ "https://math.stackexchange.com/questions/2923901", "https://math.stackexchange.com", "https://math.stackexchange.com/users/127263/" ]
Not exactly elementary, but it does follow from Wilkie’s conjecture, which was recently proven in <https://arxiv.org/abs/2202.05305>. Indeed, suppose $x$ is irrational, and WLOG suppose that $0\leq x\leq 1$. Look at the graph of the function $f(t)=t^{x}$. It is definable in $\mathbb{R}\_{exp}$ and is transcendental (i...
Not an answer, but some ideas that could help. The first thing to notice is that if $n^x\in\mathbb Q$ for all $n\in\mathbb N$, then this is also true for $n\in\mathbb Q\_+$. Now, let us use $S$ to denote the set of all $x$ with this property: $$ S=\{ x\in\mathbb R \mid \forall r\in\mathbb Q : r^x\in\mathbb Q \} $$ With...
2,923,901
Consider the following two problems: > > 1. Show that if for some $x\in\mathbb R$ and for each $n\in\mathbb N$ we have $n^x\in\mathbb N$, then $x\in\mathbb N$. > 2. Show that if for some $x\in\mathbb R$ and for each $n\in\mathbb N$ we have $n^x\in\mathbb Q$, then $x\in\mathbb Z$. > > > The first of those is a som...
2018/09/20
[ "https://math.stackexchange.com/questions/2923901", "https://math.stackexchange.com", "https://math.stackexchange.com/users/127263/" ]
Not exactly elementary, but it does follow from Wilkie’s conjecture, which was recently proven in <https://arxiv.org/abs/2202.05305>. Indeed, suppose $x$ is irrational, and WLOG suppose that $0\leq x\leq 1$. Look at the graph of the function $f(t)=t^{x}$. It is definable in $\mathbb{R}\_{exp}$ and is transcendental (i...
The problem states: (1) $x$ is fixed, possibly from $\mathbb{R}$ (2) $n$ ranges over all $\mathbb{N}$. In other words, $n$ can be any natural number. (3) Assume $n^x\in\mathbb{Q}$. By (2), the condition $n^x\in\mathbb{Q}$ must hold for all natural $n$. (4) Then necessarily one must conclude $x\in\mathbb{Z}$ An ele...
14,948,635
I am currently working to link an sqlite3 db to my ios project. I have created the project as a single view application. ![enter image description here][1] as you can see in the image below I have my set frameworks and my database file. However when I type in the #import "./usr/include/sqlite3.h" it says that the file ...
2013/02/19
[ "https://Stackoverflow.com/questions/14948635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085391/" ]
Actually, the code ``` #import "/usr/include/sqlite3.h" ``` should also work, but anyway it is incorrect to use this approach. The correct way is to include like this: ``` #import <sqlite3.h> ``` So Xcode will always search for the header in the appropriate SDK currently used to build project. And don't forget t...
To get best tutorial for iphone Sqlite Database connectivity you can click [HERE](https://stackoverflow.com/questions/6977973/iphonehow-to-use-sqlite-connectivity-in-iphone): And add libsqlite3.dylib to your project. Then add #import "sqlite3.h" in .h file of your class in which you have to use sqlite.. For more detai...
14,948,635
I am currently working to link an sqlite3 db to my ios project. I have created the project as a single view application. ![enter image description here][1] as you can see in the image below I have my set frameworks and my database file. However when I type in the #import "./usr/include/sqlite3.h" it says that the file ...
2013/02/19
[ "https://Stackoverflow.com/questions/14948635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085391/" ]
Actually, the code ``` #import "/usr/include/sqlite3.h" ``` should also work, but anyway it is incorrect to use this approach. The correct way is to include like this: ``` #import <sqlite3.h> ``` So Xcode will always search for the header in the appropriate SDK currently used to build project. And don't forget t...
add libsqlite3.tbd on your project select your TARGETS > Build Phases > Link Binary With Libraries > > add libsqlite3.tbd > > > [![enter image description here](https://i.stack.imgur.com/yTB9U.png)](https://i.stack.imgur.com/yTB9U.png) I've got xcode7
14,948,635
I am currently working to link an sqlite3 db to my ios project. I have created the project as a single view application. ![enter image description here][1] as you can see in the image below I have my set frameworks and my database file. However when I type in the #import "./usr/include/sqlite3.h" it says that the file ...
2013/02/19
[ "https://Stackoverflow.com/questions/14948635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2085391/" ]
To get best tutorial for iphone Sqlite Database connectivity you can click [HERE](https://stackoverflow.com/questions/6977973/iphonehow-to-use-sqlite-connectivity-in-iphone): And add libsqlite3.dylib to your project. Then add #import "sqlite3.h" in .h file of your class in which you have to use sqlite.. For more detai...
add libsqlite3.tbd on your project select your TARGETS > Build Phases > Link Binary With Libraries > > add libsqlite3.tbd > > > [![enter image description here](https://i.stack.imgur.com/yTB9U.png)](https://i.stack.imgur.com/yTB9U.png) I've got xcode7
14,072,757
I have a page of results on my site, im using AJAX to return more reslts when scrolled down, my problem is however as it pulls the results, it seems to pull the same ones multiple times? I dont know what causes this, can anybody see what im doing wrong? **AJAX** ``` $(window).scroll(function () { if ($(window).sc...
2012/12/28
[ "https://Stackoverflow.com/questions/14072757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/766532/" ]
So the issue is that you are making the ajax call multiple times once you hit your scroll threshold. You need to add a flag on the first ajax call so it doens't get called again until the ajax call has finished. ``` ajaxInProgress = false; if (!ajaxInProgress && ($(window).scrollTop() >= $(document).height() - $(windo...
The issue is with how you are passing data with your ajax call. From the Jquery docs, you need to put count and the amount in a javascript object within data: ``` $.ajax({ type: "POST", url: "getentries.php", data: {count: number}, success: function(results){ $('.directory').append...
14,072,757
I have a page of results on my site, im using AJAX to return more reslts when scrolled down, my problem is however as it pulls the results, it seems to pull the same ones multiple times? I dont know what causes this, can anybody see what im doing wrong? **AJAX** ``` $(window).scroll(function () { if ($(window).sc...
2012/12/28
[ "https://Stackoverflow.com/questions/14072757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/766532/" ]
The problem is most likely multiple ajax calls being fired while you scroll. Set up a timed event listener like so: ``` didScroll = false; $(window).scroll(function() { didScroll = true; }); setInterval(function() { if ( didScroll ) { didScroll = false; if(($(document).height() - $(window).hei...
The issue is with how you are passing data with your ajax call. From the Jquery docs, you need to put count and the amount in a javascript object within data: ``` $.ajax({ type: "POST", url: "getentries.php", data: {count: number}, success: function(results){ $('.directory').append...
14,072,757
I have a page of results on my site, im using AJAX to return more reslts when scrolled down, my problem is however as it pulls the results, it seems to pull the same ones multiple times? I dont know what causes this, can anybody see what im doing wrong? **AJAX** ``` $(window).scroll(function () { if ($(window).sc...
2012/12/28
[ "https://Stackoverflow.com/questions/14072757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/766532/" ]
The problem is most likely multiple ajax calls being fired while you scroll. Set up a timed event listener like so: ``` didScroll = false; $(window).scroll(function() { didScroll = true; }); setInterval(function() { if ( didScroll ) { didScroll = false; if(($(document).height() - $(window).hei...
So the issue is that you are making the ajax call multiple times once you hit your scroll threshold. You need to add a flag on the first ajax call so it doens't get called again until the ajax call has finished. ``` ajaxInProgress = false; if (!ajaxInProgress && ($(window).scrollTop() >= $(document).height() - $(windo...
2,566,665
I'm trying to find the intermediate step: $$\frac{1}{(x-\frac{x^2}{2}+\frac{x^3}{12}-\frac{x^4}{144}+...)^2} = \frac{1}{x^2}+\frac{1}{x}+\frac{7}{12}+\frac{19x}{72} ...$$ Is there a quick way to find these first few terms that I'm missing here? Thanks
2017/12/14
[ "https://math.stackexchange.com/questions/2566665", "https://math.stackexchange.com", "https://math.stackexchange.com/users/371745/" ]
The first terms of the doninator of the LHS are$$x^2-x^3+\frac{5 x^4}{12}-\frac{7 x^5}{72}+\cdots=x^2\left(1-x+\frac{5 x^2}{12}-\frac{7 x^3}{72}+\cdots\right).$$Therefore, the RHS can be written as$$\frac1{x^2}\left(b\_0+b\_1x+b\_2x^2+b\_3x^3+\cdots\right)$$and we must have$$\left(1-x+\frac{5 x^2}{12}-\frac{7 x^3}{72}+...
There’s another way to do this by hand, but let me deal with a slightly more general situation. You may perform a division of power series in *exactly* the same way you learned to divide polynomials in high school, but by writing the terms in *ascending* order of degree instead of descending. If, for instance, you want...
58,554,951
When the code comes to the step "pstmt.executeUpdate()" it freezes and blocked and I didn't receive any SQL exception This is works: ``` SQL = "INSERT INTO Procedure (file_path,id) VALUES ('/test/file_test.pdf',512);"; pstmt = con.prepareStatement(SQL,Statement.RETURN_GENERATED_KEYS); pstmt.executeUpdate(); ``` Th...
2019/10/25
[ "https://Stackoverflow.com/questions/58554951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12154774/" ]
`array_shift()` is a stand-alone function - you don't need to assign it to a value, it automatically unsets it from the given variable: ``` <?php $a = ['a', 'b', 'c', 'd']; array_shift($a); print_r($a); ``` <https://3v4l.org/GEr3g>
In you example `$rem` is the return from the function `array_shift` as stated on the doc it will return the eliminated index value, on the other side whenever you print ``` print_r($a); ``` This will return the array after the function performed.
58,554,951
When the code comes to the step "pstmt.executeUpdate()" it freezes and blocked and I didn't receive any SQL exception This is works: ``` SQL = "INSERT INTO Procedure (file_path,id) VALUES ('/test/file_test.pdf',512);"; pstmt = con.prepareStatement(SQL,Statement.RETURN_GENERATED_KEYS); pstmt.executeUpdate(); ``` Th...
2019/10/25
[ "https://Stackoverflow.com/questions/58554951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12154774/" ]
`array_shift()` is a stand-alone function - you don't need to assign it to a value, it automatically unsets it from the given variable: ``` <?php $a = ['a', 'b', 'c', 'd']; array_shift($a); print_r($a); ``` <https://3v4l.org/GEr3g>
> > `array_shift()` shifts the first value of the array off and returns it > > > The *"it"* refers to *"the first value"*, not to *"the array"*. It shifts off the first value and returns said first value; the array is being shortened by that process. Pay close attention to what is being returned in the example cod...
58,554,951
When the code comes to the step "pstmt.executeUpdate()" it freezes and blocked and I didn't receive any SQL exception This is works: ``` SQL = "INSERT INTO Procedure (file_path,id) VALUES ('/test/file_test.pdf',512);"; pstmt = con.prepareStatement(SQL,Statement.RETURN_GENERATED_KEYS); pstmt.executeUpdate(); ``` Th...
2019/10/25
[ "https://Stackoverflow.com/questions/58554951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12154774/" ]
`array_shift()` is a stand-alone function - you don't need to assign it to a value, it automatically unsets it from the given variable: ``` <?php $a = ['a', 'b', 'c', 'd']; array_shift($a); print_r($a); ``` <https://3v4l.org/GEr3g>
As the php doc [array\_shift](https://www.php.net/array_shift) shows. The return result of `array_shift` is the first value of the array that been shifted off, and remove the first value of the original array. > > > ``` > array_shift ( array &$array ) : mixed > > ``` > > array\_shift() shifts the first value of t...
58,554,951
When the code comes to the step "pstmt.executeUpdate()" it freezes and blocked and I didn't receive any SQL exception This is works: ``` SQL = "INSERT INTO Procedure (file_path,id) VALUES ('/test/file_test.pdf',512);"; pstmt = con.prepareStatement(SQL,Statement.RETURN_GENERATED_KEYS); pstmt.executeUpdate(); ``` Th...
2019/10/25
[ "https://Stackoverflow.com/questions/58554951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12154774/" ]
> > `array_shift()` shifts the first value of the array off and returns it > > > The *"it"* refers to *"the first value"*, not to *"the array"*. It shifts off the first value and returns said first value; the array is being shortened by that process. Pay close attention to what is being returned in the example cod...
In you example `$rem` is the return from the function `array_shift` as stated on the doc it will return the eliminated index value, on the other side whenever you print ``` print_r($a); ``` This will return the array after the function performed.
58,554,951
When the code comes to the step "pstmt.executeUpdate()" it freezes and blocked and I didn't receive any SQL exception This is works: ``` SQL = "INSERT INTO Procedure (file_path,id) VALUES ('/test/file_test.pdf',512);"; pstmt = con.prepareStatement(SQL,Statement.RETURN_GENERATED_KEYS); pstmt.executeUpdate(); ``` Th...
2019/10/25
[ "https://Stackoverflow.com/questions/58554951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12154774/" ]
> > `array_shift()` shifts the first value of the array off and returns it > > > The *"it"* refers to *"the first value"*, not to *"the array"*. It shifts off the first value and returns said first value; the array is being shortened by that process. Pay close attention to what is being returned in the example cod...
As the php doc [array\_shift](https://www.php.net/array_shift) shows. The return result of `array_shift` is the first value of the array that been shifted off, and remove the first value of the original array. > > > ``` > array_shift ( array &$array ) : mixed > > ``` > > array\_shift() shifts the first value of t...
26,304,422
I am trying to update a table (`DMS_TEST_LOAD`) based on two other tables (`TDCE_NE` and `TDCE_NE_COMP`). Any idea what is wrong with the below query? I keep getting the useless "Syntax error in UPDATE statement." error from Access. Thanks in advance. ``` UPDATE DMS_TEST_LOAD AS DMS ((INNER JOIN TDCE_NE_COMP AS COMP ...
2014/10/10
[ "https://Stackoverflow.com/questions/26304422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1947544/" ]
Not too sure what SQL system MS access uses. But you might want to try this ``` UPDATE DMS SET DMS.[Char Parm 1 (Trk Dir)] = COMP.[CHAR_PARM1] FROM DMS_TEST_LOAD AS DMS INNER JOIN TDCE_NE_COMP AS COMP ON COMP.[NAME] LIKE DMS.[Trunk Group Number (TGN)] AND COMP.[NE_COMP_TYPE_ID]=421 INNER JOIN TDCE_NE AS NE...
In MS Access you have to make sure you use the parenthesis correctly in the joins. I do believe you are after the following: ``` UPDATE DMS SET DMS.[Char Parm 1 (Trk Dir)] = COMP.CHAR_PARM1 FROM (DMS_TEST_LOAD AS DMS INNER JOIN TDCE_NE_COMP AS COMP ON (COMP.NAME = DMS.[Trunk Group Number (TGN)]) AND (COMP.NE_CO...
26,304,422
I am trying to update a table (`DMS_TEST_LOAD`) based on two other tables (`TDCE_NE` and `TDCE_NE_COMP`). Any idea what is wrong with the below query? I keep getting the useless "Syntax error in UPDATE statement." error from Access. Thanks in advance. ``` UPDATE DMS_TEST_LOAD AS DMS ((INNER JOIN TDCE_NE_COMP AS COMP ...
2014/10/10
[ "https://Stackoverflow.com/questions/26304422", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1947544/" ]
Not too sure what SQL system MS access uses. But you might want to try this ``` UPDATE DMS SET DMS.[Char Parm 1 (Trk Dir)] = COMP.[CHAR_PARM1] FROM DMS_TEST_LOAD AS DMS INNER JOIN TDCE_NE_COMP AS COMP ON COMP.[NAME] LIKE DMS.[Trunk Group Number (TGN)] AND COMP.[NE_COMP_TYPE_ID]=421 INNER JOIN TDCE_NE AS NE...
How about something like this... ``` UPDATE DMS SET [Char Parm 1 (Trk Dir)] = COMP.[CHAR_PARM1] FROM DMS_TEST_LOAD DMS INNER JOIN TDCE_NE_COMP AS COMP ON COMP.[NAME] LIKE DMS.[Trunk Group Number (TGN)] AND COMP.[NE_COMP_TYPE_ID]=421 INNER JOIN TDCE_NE AS NE ON NE.[ID]=COMP.[NE_ID] AND NE.[NAME]=DMS...
163,413
Apparently, the path to the statue of Lord Mi'ihen is being guarded by some pretty nasty summoners. I tried warping to Djose Highroad, but it puts me on the beach where the Crusaders battled Sin. I can't seem to find a way to the north side of Mushroom Rock, and the south side has some Aeons I'm not prepared to fight...
2014/04/08
[ "https://gaming.stackexchange.com/questions/163413", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/14775/" ]
Actually, you *can* get to the Mii'hen Highroad from the north side. Move left from where you start, and you'll eventually be able to climb the wreckage of the machina. If you can't find it, you can still go from the south side; the aeons chasing you event is random. If you get the cutscene, run screaming back south t...
Actually, the cutscene should only occur if you are too close to the first two summoners. If you hug the left wall you shouldn't initiate the cutscene.
163,413
Apparently, the path to the statue of Lord Mi'ihen is being guarded by some pretty nasty summoners. I tried warping to Djose Highroad, but it puts me on the beach where the Crusaders battled Sin. I can't seem to find a way to the north side of Mushroom Rock, and the south side has some Aeons I'm not prepared to fight...
2014/04/08
[ "https://gaming.stackexchange.com/questions/163413", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/14775/" ]
Actually, you *can* get to the Mii'hen Highroad from the north side. Move left from where you start, and you'll eventually be able to climb the wreckage of the machina. If you can't find it, you can still go from the south side; the aeons chasing you event is random. If you get the cutscene, run screaming back south t...
Yea its because the Mi'ihen Highroad actually continues right through the first area of mushroom rock taking you to the beach area "Mushroom Rock - Aftermath" then continues along Djose Highroad. But the game makes you climb the long route through mushroom rock the first time around and once the guy infront of the Mac...
4,405
**TL;DR**: Users shouldn't flood edits without a consensus. Read my post but skip the optional stuff... :) Every now and then, we get an edit flood at our front page. This sometimes happens without any consensus and sometimes even at unacceptable moments / rates. Which is why I think we should get a better coordinatio...
2012/02/16
[ "https://meta.superuser.com/questions/4405", "https://meta.superuser.com", "https://meta.superuser.com/users/9666/" ]
TL;DR ===== I think this is an interesting idea, but causes more harm then good. Long version ============ Just my two cents, but I think that there is really only one type of edit flood that you are trying to address, namely deliberate "mechanical" editing where the user knows that they will be processing a lot of ...
### I believe we don't need additional measures. We've had the occasional edit floods before (like with the re-uploading of images), but ever since then, we've been very cautious, and I guess the Meta community has developed a bit more sensible approach to mass-editing. Whenever I *call* for editing of posts (like [h...
38,084,413
I'm working with the API, and no one I hire knows how to make the API call that gets a list of organization workspaces. It's extremely frustrating. Can you please take a moment and let me know how to actually make the PHP or Ruby call? I've already tried hiring people, and I'm waisting money. Please help. <https://...
2016/06/28
[ "https://Stackoverflow.com/questions/38084413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4578276/" ]
The call is actually quite simple: `GET /space/org/{org_id}/available/` As Chris mentioned, you can do that using any of our SDKs, e.g.: **PHP** ``` PodioSpace.phpPodioSpace::get_available( $org_id ); ``` **Ruby** ``` Podio::Space.find_open_for_org( org_id ) ``` You an find the docs here: <https://developers.p...
Podio provides client libraries for both PHP and Ruby, as well as a few other languages. PHP: <https://github.com/podio/podio-php> Ruby: <https://github.com/podio/podio-rb> There are examples in the documentation.
36,379,519
The client I'm working with wants to be able to print the data they've generated in my application. I know that you can take what amounts to a screenshot of the application and print that, but it looks terrible to have the light gray form background (and since my client will be printing 30+ of these a day, that would w...
2016/04/02
[ "https://Stackoverflow.com/questions/36379519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1333476/" ]
Apart from hacking around the issue, the end result is going to be an image captured at screen resolution then printed at some other resolution - either stretched and ugly or small and harder to read. Printing isn't that hard, and the results are much prettier. [This answer](https://stackoverflow.com/a/1683630/920669)...
After you have set the color to White, you can call: ``` myForm.Repaint(); Application.DoEvents(); ``` That should change the color immidiately.
50,699,428
I am writing a simple code to count how many words there are in a txt file with java. It doesn't work cause it has a "noSuchElementException". Can you please help me fix it? Thank you! ``` public class Nr_Fjaleve { public static void main(String args[]) throws FileNotFoundException { Scanner input = new Scanner(n...
2018/06/05
[ "https://Stackoverflow.com/questions/50699428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9332604/" ]
You are looking for `hasNextLine` but then you are retrieving just `next`. So simply change your code to: ``` while (input.hasNext()) { String fjala = input.next(); count++; } ```
I took a look at your problem and immediately found a solution. In order to try to be as helpful as possible, I want to give a possible approach (I would personally use) which is more readable and can be used in the Java 8 Lambda Environment. ``` public class Nr_Fjaleve { public static void main(String args[]) th...
44,788,504
I'm making a game using PHP with MySQL and I need an UPDATE query where the fields names could change from one user to another. My code is: ``` $upd = $sql->prepare("UPDATE empire_users SET :p = :p + :p2 WHERE id = :id"); $upd->execute(array( ':p' => "p".$type, ':p2' => 10, ':id' => $_SESSION["id"] )); `...
2017/06/27
[ "https://Stackoverflow.com/questions/44788504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6257552/" ]
See <http://php.net/manual/fr/pdo.prepare.php>, especially following comment: *"To those wondering why adding quotes to around a placeholder is wrong, and why you can't use placeholders for table or column names:* *There is a common misconception about how the placeholders in prepared statements work: they are not s...
Thanks for your answers, I corrected : ``` $upd = $sql->prepare("UPDATE empire_users SET p".$type." = p".$type." + :p2 WHERE id = :id"); $upd->execute(array( ':p2' => 10, ':id' => $_SESSION["id"] )); ```
42,772,528
So basically I am asking a user to type a line. It only accepts the first 10 characters. If enter is pressed it will just set that whole line to false. Then I want to set an array to true if the char is #, otherwise everything else will be false. So I tried this ``` boolean[][] world = new boolean [8][10]; for(int i...
2017/03/13
[ "https://Stackoverflow.com/questions/42772528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6130878/" ]
You need a bounds check on your String `temp`, like ``` if( temp.equals("")){ world[i][j] = false; } else if (temp.length() <= j) { // Bounds check world[i][j] = false } Else if( temp.charAt(j) == 35){ world[i][j] = true; } else { world[i][j] = false; } ```
add this condition to this line `if(temp.equals("") || temp.length()<10){ world[i][j] = false; }`
98,653
On the heels of [a recent post](https://meta.stackexchange.com/questions/98149/why-is-it-considered-rude-to-say-thanks-in-advance-on-so) regarding a user spamming "Thanks in advance is considered extremely rude" and starting arguments on several posts, I ended up sending in 3 detailed flags on posts where this occurred...
2011/07/15
[ "https://meta.stackexchange.com/questions/98653", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/-1/" ]
As the mod who marked your flag invalid (and suspended the troublemaker), here's my take: The problem I had with the flag was that it was on [this question](https://stackoverflow.com/questions/6702500/android-frame-animation-in-value-arrays-xml) by [TheOnoy123](https://stackoverflow.com/users/814035/theonoy123). I ha...
This was somewhat addressed in the question: [Flag marked invalid even though question was closed for same reason: can I challenge?](https://meta.stackexchange.com/q/98347/149820) by a comment to [Won't's response](https://meta.stackexchange.com/questions/98347/flag-marked-invalid-even-though-question-was-closed-for-sa...
2,950,065
I have to remove hazardous chracter from my query post string. Is there any function define in php to remove directly or another way ?
2010/06/01
[ "https://Stackoverflow.com/questions/2950065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355441/" ]
First thing first what do you use these strings for ? * If you store them in a database : use parameterized queries (use [mysqli](http://www.php.net/manual/en/mysqli.prepare.php) or [PDO](http://www.php.net/manual/en/pdo.prepare.php) instead of mysql). * If you display them in a webpage : use [htmlspecialchar](http://...
I hope you aren't putting sql queries into a GET string... but whatever. If this is for a query, use `mysql_real_escape_string`.
2,950,065
I have to remove hazardous chracter from my query post string. Is there any function define in php to remove directly or another way ?
2010/06/01
[ "https://Stackoverflow.com/questions/2950065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355441/" ]
First thing first what do you use these strings for ? * If you store them in a database : use parameterized queries (use [mysqli](http://www.php.net/manual/en/mysqli.prepare.php) or [PDO](http://www.php.net/manual/en/pdo.prepare.php) instead of mysql). * If you display them in a webpage : use [htmlspecialchar](http://...
In normally for this, we can use `addslashes` and `stripslashes` in php. But better method is to use `mysql_real_escape_string` for query to avoid this type of sql injection.
2,950,065
I have to remove hazardous chracter from my query post string. Is there any function define in php to remove directly or another way ?
2010/06/01
[ "https://Stackoverflow.com/questions/2950065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355441/" ]
First thing first what do you use these strings for ? * If you store them in a database : use parameterized queries (use [mysqli](http://www.php.net/manual/en/mysqli.prepare.php) or [PDO](http://www.php.net/manual/en/pdo.prepare.php) instead of mysql). * If you display them in a webpage : use [htmlspecialchar](http://...
[Filter](http://ca.php.net/manual/en/function.filter-input.php) the input?
2,950,065
I have to remove hazardous chracter from my query post string. Is there any function define in php to remove directly or another way ?
2010/06/01
[ "https://Stackoverflow.com/questions/2950065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/355441/" ]
First thing first what do you use these strings for ? * If you store them in a database : use parameterized queries (use [mysqli](http://www.php.net/manual/en/mysqli.prepare.php) or [PDO](http://www.php.net/manual/en/pdo.prepare.php) instead of mysql). * If you display them in a webpage : use [htmlspecialchar](http://...
Use `strip_tags()`, `htmlspecialchars()` and `htmlentities()`.
29,574,931
I want to implement a `touchListener` on a polyline displayed with Google Maps V2 Android API. Zoom level: `CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(lat_Lng, 5);` I tried the following polyline touch code: ``` boolean onpoly = false; for (Polyline polyline : mPolylines) { ...
2015/04/11
[ "https://Stackoverflow.com/questions/29574931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1516596/" ]
try this ``` final List<LatLng> latLngList; // Extract polyline coordinates and put them on this list private GoogleMap map; for(int i = 0; i < latLngList.size(); i++){ MarkerOptions mar = new MarkerOptions(); mar.position(new LatLng(latLngList.get(i).latitude, latLngList.g...
Until the questions in my comments are answered i thought i'll try to make them redundant by suggesting the usage of a 3rd party library; [android-maps-utils](https://github.com/googlemaps/android-maps-utils) To do what i think you might be trying to do simply integrate the library and use the following line: `PolyUti...
29,574,931
I want to implement a `touchListener` on a polyline displayed with Google Maps V2 Android API. Zoom level: `CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(lat_Lng, 5);` I tried the following polyline touch code: ``` boolean onpoly = false; for (Polyline polyline : mPolylines) { ...
2015/04/11
[ "https://Stackoverflow.com/questions/29574931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1516596/" ]
try this ``` final List<LatLng> latLngList; // Extract polyline coordinates and put them on this list private GoogleMap map; for(int i = 0; i < latLngList.size(); i++){ MarkerOptions mar = new MarkerOptions(); mar.position(new LatLng(latLngList.get(i).latitude, latLngList.g...
I think your approach is correct. The only thing that fails is the distance check. And this is because os the touch and the zoom level: You know that when you tap on the screen, the screen point that is passed to the applications is the center of your finger surface, that is in touch with the screen. This means, that ...
29,574,931
I want to implement a `touchListener` on a polyline displayed with Google Maps V2 Android API. Zoom level: `CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(lat_Lng, 5);` I tried the following polyline touch code: ``` boolean onpoly = false; for (Polyline polyline : mPolylines) { ...
2015/04/11
[ "https://Stackoverflow.com/questions/29574931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1516596/" ]
try this ``` final List<LatLng> latLngList; // Extract polyline coordinates and put them on this list private GoogleMap map; for(int i = 0; i < latLngList.size(); i++){ MarkerOptions mar = new MarkerOptions(); mar.position(new LatLng(latLngList.get(i).latitude, latLngList.g...
I implemented a similar thing in the following way: 1. Convert all locations to the screen coordinates using `map.getProjection().toScreenLocation()` 2. Use standard distance formula to determine distance from point to point (or from point to segment, if you want to detect clicks on line segments too) and if this dist...
33,090,209
``` spades = ['2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS'] hearts = ['2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH'] clubs = ['2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC'] diamonds = ['2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD'] suits ...
2015/10/12
[ "https://Stackoverflow.com/questions/33090209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4880347/" ]
You can create a [dictionary](https://docs.python.org/2/tutorial/datastructures.html#dictionaries): ``` card_values = { '5S': 5, 'JS': 11, 'AS': 14, # Etc. } ``` Then retrieve the associated value using `card_values["5S"]` for example.
I think the separation of card types (2 to 10, J, Q, K, A) and card suits is way more cleaner. This way, you don't have to worry about the numbering or typos in the suits. ``` card_types = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A'] spades = [card + "S" for card in card_types] hearts = [card + "...
33,090,209
``` spades = ['2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS'] hearts = ['2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH'] clubs = ['2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC'] diamonds = ['2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD'] suits ...
2015/10/12
[ "https://Stackoverflow.com/questions/33090209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4880347/" ]
You can create a [dictionary](https://docs.python.org/2/tutorial/datastructures.html#dictionaries): ``` card_values = { '5S': 5, 'JS': 11, 'AS': 14, # Etc. } ``` Then retrieve the associated value using `card_values["5S"]` for example.
Using `dictionary` key-value pair for each an every value isn't nice solution. For this particular situation, you can achieve what do you want with a simple solution. See the pattern, ``` list_index:0 value:2 list_index:1 value:3 list_index:2 value:4 ............ ....... list_index:12 value:14 ``` Use th...
33,090,209
``` spades = ['2S','3S','4S','5S','6S','7S','8S','9S','10S','JS','QS','KS','AS'] hearts = ['2H','3H','4H','5H','6H','7H','8H','9H','10H','JH','QH','KH','AH'] clubs = ['2C','3C','4C','5C','6C','7C','8C','9C','10C','JC','QC','KC','AC'] diamonds = ['2D','3D','4D','5D','6D','7D','8D','9D','10D','JD','QD','KD','AD'] suits ...
2015/10/12
[ "https://Stackoverflow.com/questions/33090209", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4880347/" ]
You can create a [dictionary](https://docs.python.org/2/tutorial/datastructures.html#dictionaries): ``` card_values = { '5S': 5, 'JS': 11, 'AS': 14, # Etc. } ``` Then retrieve the associated value using `card_values["5S"]` for example.
You probably want a function.. ``` def get_card_value(card_str): value = card_str[0] face_values = { 'A':14, 'K':13, 'Q':12, 'J':11 } if value.upper() in face_values: return face_values[value.upper()] else: ...
44,137,233
I have a wix bundle which installs various modules. One of the modules amongst those can cause the system reboot. Now the way I would like to happen is that if it is a UI installation then at the end of the installation of the bundle I would like for a prompt to appear and if it is a silent install then I would like to...
2017/05/23
[ "https://Stackoverflow.com/questions/44137233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641305/" ]
As you have found, MSI packages are always suppressed from initiating a reboot. What you are missing is that the Bootstrapper Application (e.g. WixStdBA or a custom / Managed BA) is what controls reboots. The BA inspects the result of the installation of each MSI package. If any of the MSI packages require a reboot, ...
The default value for the REBOOT property is not ReallySuppress, so something else is going on. Without looking at the source, any custom actions, or the MSI it's hard to say why this is. A complete verbose log might show it being set; it might be in the Property table of the MSI; it could be set from custom action cod...
10,600,293
Which way is the best to show message in Controller? Is must showing count articles. ``` $c = count($articles); if($c == 0) { return "On site are 0 articles"; } elseif ($c == 1){ return "On site is 1 article"; } else { return "On site are" . $c . "articles"; } ``` or: ``` if($c == 1) { $text1 = 'is'; $te...
2012/05/15
[ "https://Stackoverflow.com/questions/10600293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1395867/" ]
Your question is a little vague to provide a clear cut answer, but my guess is using the db to calculate the totals will be far more efficient than you writing the code on the website. Sql Server will attempt to optimize the query to use as much of the server resources as possible to make it more efficient. Your code w...
If I understand the question performing the calculation is more scalable has it is on that single data set. As you add data to a table even with indexes lookups will get slower. Also the indexes increase table size and increase the time required to insert a record.
10,600,293
Which way is the best to show message in Controller? Is must showing count articles. ``` $c = count($articles); if($c == 0) { return "On site are 0 articles"; } elseif ($c == 1){ return "On site is 1 article"; } else { return "On site are" . $c . "articles"; } ``` or: ``` if($c == 1) { $text1 = 'is'; $te...
2012/05/15
[ "https://Stackoverflow.com/questions/10600293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1395867/" ]
Your question is a little vague to provide a clear cut answer, but my guess is using the db to calculate the totals will be far more efficient than you writing the code on the website. Sql Server will attempt to optimize the query to use as much of the server resources as possible to make it more efficient. Your code w...
If I've understood you correctly, this is a question about caching - should you calculate on the fly, or lookup the results in a cache? In most web architectures, your SQL database is a brilliant cache, right up to the point where it becomes a terrible cache. Scaling your (SQL) database is notoriously tricky - introdu...
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
Sorry, it is not clear what you are asking. Are you asking, would it speed up a query such as ``` SELECT product, sum(quantity) FROM receipts GROUP BY product ``` if you added an index on quantity? If that is the question, then the answer is no. Generally speaking, indexes are helpful when you need to find just ...
No. Indexes improve searches by limiting how many checks are required. An aggregate function (count, max, min, sum, avg) has to run through all the entries in a column regardless.
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
No. Indexes improve searches by limiting how many checks are required. An aggregate function (count, max, min, sum, avg) has to run through all the entries in a column regardless.
If you want to make the summation faster, you can pre-materialized the result. On Oracle, use [Materialized Views](http://en.wikipedia.org/wiki/Materialized_view), on MS SQL use [Indexed Views](http://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx). On your specific question "Is creating an index for a c...
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
No. Indexes improve searches by limiting how many checks are required. An aggregate function (count, max, min, sum, avg) has to run through all the entries in a column regardless.
If the index is covering, it will generally be faster. How much faster will be determined by the difference between the number of columns in the table versus the number in the index. In addition, it might be faster if there are any filtering criteria.
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
No. Indexes improve searches by limiting how many checks are required. An aggregate function (count, max, min, sum, avg) has to run through all the entries in a column regardless.
I found indexing a column in the where(productid here) helps when using this query: SELECT productid, sum(quantity) FROM receipts WHERE productid = 1 GROUP BY productid One of my queries went from 45 seconds to almost instant once I added the index.
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
Sorry, it is not clear what you are asking. Are you asking, would it speed up a query such as ``` SELECT product, sum(quantity) FROM receipts GROUP BY product ``` if you added an index on quantity? If that is the question, then the answer is no. Generally speaking, indexes are helpful when you need to find just ...
If you want to make the summation faster, you can pre-materialized the result. On Oracle, use [Materialized Views](http://en.wikipedia.org/wiki/Materialized_view), on MS SQL use [Indexed Views](http://www.microsoft.com/technet/prodtechnol/sql/2005/impprfiv.mspx). On your specific question "Is creating an index for a c...
437,915
Is creating an index for a column that is being summed is faster than no index?
2009/01/13
[ "https://Stackoverflow.com/questions/437915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26087/" ]
Sorry, it is not clear what you are asking. Are you asking, would it speed up a query such as ``` SELECT product, sum(quantity) FROM receipts GROUP BY product ``` if you added an index on quantity? If that is the question, then the answer is no. Generally speaking, indexes are helpful when you need to find just ...
If the index is covering, it will generally be faster. How much faster will be determined by the difference between the number of columns in the table versus the number in the index. In addition, it might be faster if there are any filtering criteria.