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 |
|---|---|---|---|---|---|
64,348,283 | I am trying to call an API from the output of a query , the output of the query is int , but when I call the query it returns something like `[(12345,)],` but I want only `12345` how to reconstruct the output
i am using import re regular expression to remove the unwanted characters but it is not working as expected.
... | 2020/10/14 | [
"https://Stackoverflow.com/questions/64348283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11241234/"
] | [(12345,)]
it is just a tuple inside a list
you can take the element out by using
```
data = contact[0][0]
print(data)
```
will give you the required results | The result is an integer in a tuple in a list; you can get the result as a scalar value by unpacking on the left-hand side of the assignment.
```py
[(id,)] = cursor.fetchall()
``` |
510,244 | I have the following chart in Excel:
[](https://i.stack.imgur.com/T2uFV.png)
I want to calculate the area under the graph line.
Any idea? | 2012/11/25 | [
"https://superuser.com/questions/510244",
"https://superuser.com",
"https://superuser.com/users/175758/"
] | For each adjacent pair of points, take average of y-coordinates, then multiply by difference of x-coordinates, and accumulate for all pairs. | For your related post ([How to paint area under graph line with average line?](https://superuser.com/questions/510254/how-to-paint-area-under-graph-line-with-average-line/511507#511507)) I suggested using a column chart. The area chart overemphasizes some points more than the values should allow. Since the points are d... |
37,073 | I am literally new in APEX, I am originally a SF Admin.
SO this is my 1st APEX project.
I would like to mass update the values of a date field in an Object.
Can someone give me a sample how to do it?
I really appreciate your help on this.
Thanks ! | 2014/05/27 | [
"https://salesforce.stackexchange.com/questions/37073",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/8573/"
] | I suggest you take a look at the recipes in the Force.com cookbook. You can download it [here](https://developer.salesforce.com/page/JP%3aForce_Platform_Cookbook)
what you want to do is likely most easily done using a list view button. A complete recipe is available in the downloadable cookbook, plus a heap of other r... | You can use data loader too for mass updates |
37,073 | I am literally new in APEX, I am originally a SF Admin.
SO this is my 1st APEX project.
I would like to mass update the values of a date field in an Object.
Can someone give me a sample how to do it?
I really appreciate your help on this.
Thanks ! | 2014/05/27 | [
"https://salesforce.stackexchange.com/questions/37073",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/8573/"
] | **On the controller:**
```
public void updateMyAccounts() {
Object__c[] objs = [SELECT id, Custom_Date_Field__c FROM Object__c WHERE CreatedDate = TODAY];
for (Object__c obj : objs) {
obj.Custom_Date_Field__c = date.today();
}
update objs;
}
```
**On the Visualforce page:**
```
<apex:commandButton value="U... | You can use data loader too for mass updates |
2,085,178 | I am looking at collecting more detailed java statistics (in plain text format) i.e. statistics that the jstat command emits - like garbage collection data etc. Can anyone please suggest me the best tool to collect the java process statistics like jmap.
EDIT
----
Google gives me advise to use `jmap` with `-histo:live... | 2010/01/18 | [
"https://Stackoverflow.com/questions/2085178",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/146250/"
] | You can also take a look at [this](http://openjdk.java.net/groups/jmx/) which is free and is part of the Java API. There are some [tutorials](http://java.sun.com/docs/books/tutorial/jmx/overview/index.html) that explain how to use this technology. Hope this helps ...
~Bolt | Maybe you could investigate integrating [Shadowtail](http://shadowtail.sourceforge.net/index.php?option=com_content&view=section&layout=blog&id=16&Itemid=111) with your application. |
322,284 | mapbox GL: I got this error
Error: The sourceLayer parameter must be provided for vector source types.
What is wrong? | 2019/05/09 | [
"https://gis.stackexchange.com/questions/322284",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/67519/"
] | If the layer-source type = geojson, the map.setFeatureState needs source, id,
if the layer-source type= vector(for example tilesets URL),
the map.setFeatureState needs source, id, and for vector sources sourceLayer properties.
sample vector source :
```js
//var _mapbox_style = 'mapbox://styles/hoogw/cjusyfrn725qp1fl... | geojson source sample:
```
map.addSource("_geojson_source", {
"type": "geojson",
"data": ___GeoJson
});
if ((geojson_feature_type.toLowerCase() == 'polygon')
|| (geojson_feature_type.toLowerCase() == 'multipolygon'))
{
// ------------- poly... |
9,152,715 | I'm trying to stretch the content of a div the height of the page. I've Googled the problem and so far nothing works. The whole thing is starting to give me a headache. Perhaps someone more experienced could take a look at my code? The full stylesheet is >400 lines, so I'm including what is (hopefully) relevant.
"Wrap... | 2012/02/05 | [
"https://Stackoverflow.com/questions/9152715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/907787/"
] | You have really wrong code:
* `.wrapper` matched `<div class="wrapper">` not `<div id="wrapper">`.
* `<div id="#contentWrapper">` is not correct, you should try `<div id="contentWrapper">`
* `height: auto;` is the problem. The wrapper needs to be 100% height, not auto...
* the `height: 100%` after `height: auto !impor... | Maybe it's the default margins and padding, have you tried this?
```
body {margin: 0px; padding: 0px; }
``` |
9,152,715 | I'm trying to stretch the content of a div the height of the page. I've Googled the problem and so far nothing works. The whole thing is starting to give me a headache. Perhaps someone more experienced could take a look at my code? The full stylesheet is >400 lines, so I'm including what is (hopefully) relevant.
"Wrap... | 2012/02/05 | [
"https://Stackoverflow.com/questions/9152715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/907787/"
] | You have really wrong code:
* `.wrapper` matched `<div class="wrapper">` not `<div id="wrapper">`.
* `<div id="#contentWrapper">` is not correct, you should try `<div id="contentWrapper">`
* `height: auto;` is the problem. The wrapper needs to be 100% height, not auto...
* the `height: 100%` after `height: auto !impor... | The contentShadow must have overflow: auto. Try this
```
body, html { height: 100%; margin: 0; padding: 0; }
#container { width: 100%; height: 100%; overflow: auto; display: block; }
<body>
<div id="container">
This should fill the page!
</div>
</body>
``` |
9,152,715 | I'm trying to stretch the content of a div the height of the page. I've Googled the problem and so far nothing works. The whole thing is starting to give me a headache. Perhaps someone more experienced could take a look at my code? The full stylesheet is >400 lines, so I'm including what is (hopefully) relevant.
"Wrap... | 2012/02/05 | [
"https://Stackoverflow.com/questions/9152715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/907787/"
] | You have really wrong code:
* `.wrapper` matched `<div class="wrapper">` not `<div id="wrapper">`.
* `<div id="#contentWrapper">` is not correct, you should try `<div id="contentWrapper">`
* `height: auto;` is the problem. The wrapper needs to be 100% height, not auto...
* the `height: 100%` after `height: auto !impor... | I had this issue for the better part of my life, but I just solved it for myself, so I'm sharing, just in case somebody else can benefit.
My HTML/BODY selector is set to height:100%.
My container div within the HTML/BODY selector is set to min-height:800px.
My CONTENT div inside of the CONTAINER div didn't have a... |
27,844,934 | My Mobile Service worked great till I install 'Microsoft.WindowsAzure.Storage': 4.3.0.0 through NuGet from Visual Studio.
After the installation of it, Mobile Services shows
**Error
Found conflicts between different versions of the same dependent assembly 'Microsoft.WindowsAzure.Storage': 4.3.0.0. Please change your ... | 2015/01/08 | [
"https://Stackoverflow.com/questions/27844934",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4038104/"
] | Oh, there's already a solution and I verified correct.
<http://blogs.msdn.com/b/jpsanders/archive/2014/10/10/azure-mobile-services-net-backend-found-conflicts-between-different-versions-of-the-same-dependent-assembly.aspx>
1. backup your project.
2. find a clean packages.config
3. copy content from it and replace to ... | I had the same problem when working on an Azure Mobile Service project (.NET Backend). However, I could not downgrade to Azure.Storage 3.1.0.1 because it requires Ms.Data.OData; 5.6.0 (exact version). Even having the assemblyBinding which redirects all versions to MS.Data.OData to 5.6.2, still did not work.
At the en... |
485,921 | I'm having some trouble with pf/altq on OpenBSD but as I'm new to it I'm not sure if its because I'm misunderstanding how to use anchors, or if something is wrong with my system.
I'm trying to add altq rules to an anchor using pfctl, but pfctl keeps saying the device is busy when I try. If I use the same rules in pf.c... | 2013/03/08 | [
"https://serverfault.com/questions/485921",
"https://serverfault.com",
"https://serverfault.com/users/118068/"
] | According to <http://lists.freebsd.org/pipermail/freebsd-pf/2008-October/004826.html> you can't load queues into anchors as I'm trying to do.
You have to load the queue rules in to the main pf.conf file and load only the filter rules that assign traffic to the queue(s) into the anchor. | You can have more than one pf.conf files. Something like this:
```
/etc/pf.conf
/<whatever path>/tshaping.conf
/<whatever path>/other_rules.conf
```
and just run:
```
pfctl -f /etc/pf.conf
pfctl -f /<whatever path>/tshaping.conf
pfctl -f /<whatever path>/other_rules.conf
```
However, you can manipulate [Tables](h... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | You can track the active tab in a hidden field using Javascript, then check the hidden field when the page is loaded. (Also in Javascript)
Alternatively, you can use UpdatePanels with ASP.Net AJAX to eliminate the postbacks. (Note that if the tabs are in an update panel, they won't work correctly) | An alternative to using a hidden field is to use the cookie property on the tab control
>
> $("#tabs").tabs({
> cookie: {
> expires: 1
> }
> });
>
>
>
You need to reference the jquery.cookie.js file for this to work
[jQuery tabs cookie](http://jqueryui.com/demos/tabs/#cookie) |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | You can track the active tab in a hidden field using Javascript, then check the hidden field when the page is loaded. (Also in Javascript)
Alternatively, you can use UpdatePanels with ASP.Net AJAX to eliminate the postbacks. (Note that if the tabs are in an update panel, they won't work correctly) | Try the following:
```
<p class="hiddenData"><asp:HiddenField ID="hdnData" runat="server" /></p>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs li a').click(function() { });
$('.tabs li').hover(function() {
var liData = $(this);
$('.hiddenData input... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | You can track the active tab in a hidden field using Javascript, then check the hidden field when the page is loaded. (Also in Javascript)
Alternatively, you can use UpdatePanels with ASP.Net AJAX to eliminate the postbacks. (Note that if the tabs are in an update panel, they won't work correctly) | You said
```
//When page loads...
$(".tab_content").hide(); //Hide all content
```
I would load the this with css since that's faster. hide is probably doing a display:none;
one solution is writing javascript from codebehind.
and example with c#
```
var selectedTab = IsAdvancedSearch ? "{'selected':1}" : ... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | You can track the active tab in a hidden field using Javascript, then check the hidden field when the page is loaded. (Also in Javascript)
Alternatively, you can use UpdatePanels with ASP.Net AJAX to eliminate the postbacks. (Note that if the tabs are in an update panel, they won't work correctly) | The hidden field approach works well for me. With the .aspx containing
```
<asp:HiddenField runat="server" ID="hfLastTab" Value="0" />
```
and the js ready function containing
```
$("#tabs").tabs({ active: <%= hfLastTab.Value %> });
```
the active tab will be set per the hidden field. (That's the jQuery UI v1.9 p... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | An alternative to using a hidden field is to use the cookie property on the tab control
>
> $("#tabs").tabs({
> cookie: {
> expires: 1
> }
> });
>
>
>
You need to reference the jquery.cookie.js file for this to work
[jQuery tabs cookie](http://jqueryui.com/demos/tabs/#cookie) | Try the following:
```
<p class="hiddenData"><asp:HiddenField ID="hdnData" runat="server" /></p>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs li a').click(function() { });
$('.tabs li').hover(function() {
var liData = $(this);
$('.hiddenData input... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | An alternative to using a hidden field is to use the cookie property on the tab control
>
> $("#tabs").tabs({
> cookie: {
> expires: 1
> }
> });
>
>
>
You need to reference the jquery.cookie.js file for this to work
[jQuery tabs cookie](http://jqueryui.com/demos/tabs/#cookie) | You said
```
//When page loads...
$(".tab_content").hide(); //Hide all content
```
I would load the this with css since that's faster. hide is probably doing a display:none;
one solution is writing javascript from codebehind.
and example with c#
```
var selectedTab = IsAdvancedSearch ? "{'selected':1}" : ... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | An alternative to using a hidden field is to use the cookie property on the tab control
>
> $("#tabs").tabs({
> cookie: {
> expires: 1
> }
> });
>
>
>
You need to reference the jquery.cookie.js file for this to work
[jQuery tabs cookie](http://jqueryui.com/demos/tabs/#cookie) | The hidden field approach works well for me. With the .aspx containing
```
<asp:HiddenField runat="server" ID="hfLastTab" Value="0" />
```
and the js ready function containing
```
$("#tabs").tabs({ active: <%= hfLastTab.Value %> });
```
the active tab will be set per the hidden field. (That's the jQuery UI v1.9 p... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | Try the following:
```
<p class="hiddenData"><asp:HiddenField ID="hdnData" runat="server" /></p>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs li a').click(function() { });
$('.tabs li').hover(function() {
var liData = $(this);
$('.hiddenData input... | You said
```
//When page loads...
$(".tab_content").hide(); //Hide all content
```
I would load the this with css since that's faster. hide is probably doing a display:none;
one solution is writing javascript from codebehind.
and example with c#
```
var selectedTab = IsAdvancedSearch ? "{'selected':1}" : ... |
2,149,908 | I'm using jquery tab and following js method, how and what can i modify it to maintain state of tab between postbacks? (This resets tabs to first tab after page\_load)
```
$(document).ready(function() {
//When page loads...
$(".tab_content").hide(); //Hide all content
$("ul.tabs li:first").add... | 2010/01/27 | [
"https://Stackoverflow.com/questions/2149908",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/125551/"
] | Try the following:
```
<p class="hiddenData"><asp:HiddenField ID="hdnData" runat="server" /></p>
<script type="text/javascript">
$(document).ready(function() {
$('.tabs li a').click(function() { });
$('.tabs li').hover(function() {
var liData = $(this);
$('.hiddenData input... | The hidden field approach works well for me. With the .aspx containing
```
<asp:HiddenField runat="server" ID="hfLastTab" Value="0" />
```
and the js ready function containing
```
$("#tabs").tabs({ active: <%= hfLastTab.Value %> });
```
the active tab will be set per the hidden field. (That's the jQuery UI v1.9 p... |
46,516,425 | I have `<textarea>` element and create range inside it:
* Create new range via `document.createRange()`
* Get the only child node of `<textarea>` via `textarea.childNodes[0]`
* Set range start and range end via `range.setStart` and `range.setEnd`
Then I call `range.getBoundingClientRect()`:
```js
let textarea = docu... | 2017/10/01 | [
"https://Stackoverflow.com/questions/46516425",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5812238/"
] | `<textarea>` is a [replacement element](https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element)
>
> Objects inserted using the CSS content property are anonymous replaced
> elements. They are "anonymous" because they don't exist in the HTML
> markup.
>
>
> | Here is an example how to do it:
<https://jh3y.medium.com/how-to-where-s-the-caret-getting-the-xy-position-of-the-caret-a24ba372990a>
You need to create a div, copy all styles of the input element into that div, copy text up to the selection into that div, add a span inside that div with the selection and then you ca... |
12,085,751 | Firstly, I am aware that there are quite a few questions that are similar to this one in SO. I have read most, if not all of them, over the past week. But I still can't make this work for me.
I am developing a Ruby on Rails app that allows users to upload mp3 files to Amazon S3. The upload itself works perfectly, but ... | 2012/08/23 | [
"https://Stackoverflow.com/questions/12085751",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1066242/"
] | The "buffer" object yielded when passing a block to #write is an instance of StringIO. You can write to the buffer using #write or #<<. Here is an example that uses the block form to upload a file.
```
file = File.open('/path/to/file', 'r')
obj = s3.buckets['my-bucket'].objects['object-key']
obj.write(:content_length... | After read the source code of the [AWS gem](https://github.com/aws/aws-sdk-ruby), I've adapted (or mostly copy) the multipart upload method to yield the current progress based on how many chunks have been uploaded
```
s3 = AWS::S3.new.buckets['your_bucket']
file = File.open(filepath, 'r', encoding: 'BINARY')
file_to_... |
140,693 | The picture rapresents what i want to achieve.

I read, somewhere on the Internet, that you can render the fbo and pass that fbo as a texture to render into the [ImGui](https://github.com/ocornut/imgui "ImGui @ github.com.ocornut") window.... | 2017/05/04 | [
"https://gamedev.stackexchange.com/questions/140693",
"https://gamedev.stackexchange.com",
"https://gamedev.stackexchange.com/users/-1/"
] | First you need to render you scene to a Frame Buffer Object (here is a good course on FBO: <https://learnopengl.com/#!Advanced-OpenGL/Framebuffers>)
After that you will end up with a Texture (of type GLuint) containing your rendered scene. To print it into Dear imGUI, just call a Draw Image Command.
**EDIT New (simpl... | Rendering to a FBO and using as a texture is just fancy speak for rendering to texture and then using that texture in a subsequent render. All geometry generated by imgui are just texture triangles.
FBO stands for FrameBuffer Object, it is a collection of images that you can use as a rendertarget. Opengl is initialize... |
14,666,752 | I have a small issue with the final value, i need to round to 2 decimals.
```
var pri='#price'+$(this).attr('id').substr(len-2);
$.get("sale/price?output=json", { code: v },
function(data){
$(pri).val(Math.round((data / 1.19),2));
});
});
```
Any help i... | 2013/02/02 | [
"https://Stackoverflow.com/questions/14666752",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2033849/"
] | If you want it visually formatted to two decimals as a string (for output) use [`toFixed()`](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toFixed):
```
var priceString = someValue.toFixed(2);
```
The answer by @David has two problems:
1. It leaves the result as a floating poin... | Just multiply the number by 100, round, and divide the resulting number by 100. |
5,017,032 | Say we have an exe, can that be readily converted to assembly? Is there a way for software authors to prevent/obstruct this? | 2011/02/16 | [
"https://Stackoverflow.com/questions/5017032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619710/"
] | No. A program can only be run by your system if it can understand it; if it understands it, it probably is in machine code, which is directly convertable to assembly.
What you can do is to try to employ code obfuscation methods, so as to make the disassembled binary as hard to understand as possible.
<http://en.wikib... | In a word, no. Just like you can't prevent someone from reading and analyzing a book that you give them. |
5,017,032 | Say we have an exe, can that be readily converted to assembly? Is there a way for software authors to prevent/obstruct this? | 2011/02/16 | [
"https://Stackoverflow.com/questions/5017032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619710/"
] | In a word, no. Just like you can't prevent someone from reading and analyzing a book that you give them. | I think maranas has the best answer to this so far but would add that I think you can disassemble the program, with some conditions. First think of it this way, if it is actually executable, meaning can be executed by a processor then absolutely you can parse through that binary in exactly the same way the processor ca... |
5,017,032 | Say we have an exe, can that be readily converted to assembly? Is there a way for software authors to prevent/obstruct this? | 2011/02/16 | [
"https://Stackoverflow.com/questions/5017032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619710/"
] | No. A program can only be run by your system if it can understand it; if it understands it, it probably is in machine code, which is directly convertable to assembly.
What you can do is to try to employ code obfuscation methods, so as to make the disassembled binary as hard to understand as possible.
<http://en.wikib... | Executables are designed to be executed (hence the name) by computer processors. The assembly language is a layer on top of the machine-code that the computer processor executes. If your program can be run as machine-code, then it can be read as assembly.
You probably have a situation like this: A proprietary C/C++ wr... |
5,017,032 | Say we have an exe, can that be readily converted to assembly? Is there a way for software authors to prevent/obstruct this? | 2011/02/16 | [
"https://Stackoverflow.com/questions/5017032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619710/"
] | Executables are designed to be executed (hence the name) by computer processors. The assembly language is a layer on top of the machine-code that the computer processor executes. If your program can be run as machine-code, then it can be read as assembly.
You probably have a situation like this: A proprietary C/C++ wr... | I think maranas has the best answer to this so far but would add that I think you can disassemble the program, with some conditions. First think of it this way, if it is actually executable, meaning can be executed by a processor then absolutely you can parse through that binary in exactly the same way the processor ca... |
5,017,032 | Say we have an exe, can that be readily converted to assembly? Is there a way for software authors to prevent/obstruct this? | 2011/02/16 | [
"https://Stackoverflow.com/questions/5017032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619710/"
] | No. A program can only be run by your system if it can understand it; if it understands it, it probably is in machine code, which is directly convertable to assembly.
What you can do is to try to employ code obfuscation methods, so as to make the disassembled binary as hard to understand as possible.
<http://en.wikib... | If by "converted" you mean compiled, and by that you mean compiled to machine code, yes, absolutely. Every bit of code that runs on any box is running as machine code. For any particular language the answer varies based on whether tools exist to create a stand-alone executable that does not need the language's run-time... |
5,017,032 | Say we have an exe, can that be readily converted to assembly? Is there a way for software authors to prevent/obstruct this? | 2011/02/16 | [
"https://Stackoverflow.com/questions/5017032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619710/"
] | If by "converted" you mean compiled, and by that you mean compiled to machine code, yes, absolutely. Every bit of code that runs on any box is running as machine code. For any particular language the answer varies based on whether tools exist to create a stand-alone executable that does not need the language's run-time... | I think maranas has the best answer to this so far but would add that I think you can disassemble the program, with some conditions. First think of it this way, if it is actually executable, meaning can be executed by a processor then absolutely you can parse through that binary in exactly the same way the processor ca... |
5,017,032 | Say we have an exe, can that be readily converted to assembly? Is there a way for software authors to prevent/obstruct this? | 2011/02/16 | [
"https://Stackoverflow.com/questions/5017032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/619710/"
] | No. A program can only be run by your system if it can understand it; if it understands it, it probably is in machine code, which is directly convertable to assembly.
What you can do is to try to employ code obfuscation methods, so as to make the disassembled binary as hard to understand as possible.
<http://en.wikib... | I think maranas has the best answer to this so far but would add that I think you can disassemble the program, with some conditions. First think of it this way, if it is actually executable, meaning can be executed by a processor then absolutely you can parse through that binary in exactly the same way the processor ca... |
31,670,581 | I'm really confused by the new Dot Net Execution SDK and the new Shared Library form of cross-platform .net application/library.
I have some Portable Class Libraries, and I was planning to use these under the Mono environment (and possibly xamarin in the future). I picked PCL over a normal CL because it seemed logica... | 2015/07/28 | [
"https://Stackoverflow.com/questions/31670581",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1657476/"
] | PCL support for .NET Framework 4.6 and .NET Core will be released soon, along with the Visual Studio Tools for Windows 10. This release will add targets for UWP, .NET 4.6 and Asp.NET 5.0.
You should feel free to continue to use Portable Class Libraries to write single-binary libraries.
The DNX based class libraries a... | Portable Class Library support for ".NET Framework 4.6" and "ASP.NET Core 5.0" is included in Visual Studio 2015 RTM. You need to install the optional "Tools and Windows SDK 10.0.10240" hidden under "Universal Windows App Development Tools". |
59,147,344 | Is there a way to send EMR logs to CloudWatch instead of S3. We would like to have all our services logs in one location. Seems like the only thing you can do is set up alarms for monitoring but that doesn't cover logging.
<https://docs.aws.amazon.com/emr/latest/ManagementGuide/UsingEMR_ViewingMetrics.html>
Would I h... | 2019/12/02 | [
"https://Stackoverflow.com/questions/59147344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12470793/"
] | you can install the CloudWatch agent via EMR’s bootstrap configuration, and configure it to watch log directories. It then starts to push logs to Amazon CloudWatch Logs | You can read the logs from s3 and push them to the cloudwatch using boto3 and delete them from s3 if you do not need. In some use-cases stdout.gz log will be needed to be in the cloudwatch for monitoring purposes.
boto3 documentation on [put\_log\_events](https://boto3.amazonaws.com/v1/documentation/api/latest/referen... |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | You should probably not use ids for dynamically created content, as you could end up with more than one element with the same id - meaning that `document.getElementById` (which I assume sizzle uses for the `#id` selector) will only return the first (potentially non-visible) one. | A few points to think about:
1. `OnDialogClose` you should detach `#MenuDialog` from DOM to avoid multiple objects with same ID or you can check whether `div#MenuDialog` exists before adding one.
2. `var Selector = $("a:contains('sometext')");` is a pointless line unless you re-use it else where.
3. You use `$('#MenuD... |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | Because this shows up early in the search for creating a dynamic dialog in jquery, I'd like to point out a better method to do this. Instead of adding your dialog div and content to the HTML and then calling it, you can do this much more easily by shoving the HTML directly into a jquery object, as so:
```
$(function (... | You should probably not use ids for dynamically created content, as you could end up with more than one element with the same id - meaning that `document.getElementById` (which I assume sizzle uses for the `#id` selector) will only return the first (potentially non-visible) one. |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | You should probably not use ids for dynamically created content, as you could end up with more than one element with the same id - meaning that `document.getElementById` (which I assume sizzle uses for the `#id` selector) will only return the first (potentially non-visible) one. | Personally, I managed in this way:
1) Build the html of the dialog, with two span with xxx as default value
```
<div id="dialog1" title="Title of the dialog">
<p>There are two variables: <span id="var1">xxx</span> and
<span id="var2">xxx</span></p>
</div>
```
2) Make the div ready for being a dialog
```
$... |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | Because this shows up early in the search for creating a dynamic dialog in jquery, I'd like to point out a better method to do this. Instead of adding your dialog div and content to the HTML and then calling it, you can do this much more easily by shoving the HTML directly into a jquery object, as so:
```
$(function (... | A few points to think about:
1. `OnDialogClose` you should detach `#MenuDialog` from DOM to avoid multiple objects with same ID or you can check whether `div#MenuDialog` exists before adding one.
2. `var Selector = $("a:contains('sometext')");` is a pointless line unless you re-use it else where.
3. You use `$('#MenuD... |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | I needed a way to use a JSON webservice to control things like alerts and updates on the client-side without the client initiating an action. I hope to update this to use web-sockets, but for now it's a timed pull and each pull includes the delay for the next pull so I can even manage that once the client has loaded up... | A few points to think about:
1. `OnDialogClose` you should detach `#MenuDialog` from DOM to avoid multiple objects with same ID or you can check whether `div#MenuDialog` exists before adding one.
2. `var Selector = $("a:contains('sometext')");` is a pointless line unless you re-use it else where.
3. You use `$('#MenuD... |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | Because this shows up early in the search for creating a dynamic dialog in jquery, I'd like to point out a better method to do this. Instead of adding your dialog div and content to the HTML and then calling it, you can do this much more easily by shoving the HTML directly into a jquery object, as so:
```
$(function (... | Personally, I managed in this way:
1) Build the html of the dialog, with two span with xxx as default value
```
<div id="dialog1" title="Title of the dialog">
<p>There are two variables: <span id="var1">xxx</span> and
<span id="var2">xxx</span></p>
</div>
```
2) Make the div ready for being a dialog
```
$... |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | Because this shows up early in the search for creating a dynamic dialog in jquery, I'd like to point out a better method to do this. Instead of adding your dialog div and content to the HTML and then calling it, you can do this much more easily by shoving the HTML directly into a jquery object, as so:
```
$(function (... | I needed a way to use a JSON webservice to control things like alerts and updates on the client-side without the client initiating an action. I hope to update this to use web-sockets, but for now it's a timed pull and each pull includes the delay for the next pull so I can even manage that once the client has loaded up... |
6,354,443 | I am using the code below to create a jQuery UI Dialog widget dynamically:
```
$(function () {
var Selector = $("a:contains('sometext')");
$(Selector).bind('click', function () {
var NewDialog = "<div dir=rtl id='MenuDialog'></div>";
var DialogContetn = '<div dir=rtl ><table wi... | 2011/06/15 | [
"https://Stackoverflow.com/questions/6354443",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/369161/"
] | I needed a way to use a JSON webservice to control things like alerts and updates on the client-side without the client initiating an action. I hope to update this to use web-sockets, but for now it's a timed pull and each pull includes the delay for the next pull so I can even manage that once the client has loaded up... | Personally, I managed in this way:
1) Build the html of the dialog, with two span with xxx as default value
```
<div id="dialog1" title="Title of the dialog">
<p>There are two variables: <span id="var1">xxx</span> and
<span id="var2">xxx</span></p>
</div>
```
2) Make the div ready for being a dialog
```
$... |
39,941,230 | I am using the two files below for my project. The variable I am referring to, `Node parent`, was originally not a pointer, but I quickly found out this doesn't work for obvious reasons (memory).
So I turned it into a pointer. The problem is that `parent` appears to not be properly handled in my code, so I end up wit... | 2016/10/09 | [
"https://Stackoverflow.com/questions/39941230",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6051635/"
] | You should check if `parent` is `nullptr` or not:
```
bool Node::getParent( Node& node )
{
if ( parent )
{
node = *parent;
return true;
}
else
{
return false;
}
}
```
Note that you have to implement the proper copy-constructor of `Node` is needed.
A possible solution i... | You should check if parent is null or not before defreferencing.
convert signature of your getParent as:
```
Node* Node::getParent()
Node* Node::getParent() {
return parent;
}
```
And in your application whenever you access it, check first.
```
Node * parent = getParent();
if(parent==nullptr){
cout << "pa... |
68,447,195 | I have a `.pkl` file that has looks something like this but has at least 300 rows:
| X | Y | Z | M |
| --- | --- | --- | --- |
| -0.522 | 3 | 0.55 | Yes |
| 0.44 | 5 | NaN | No |
| NaN | NaN | 0.241 | Maybe |
| 0.325 | 3 | Nan | Yes |
I want to get a list of values for Y and M [3 = Yes, 5 = No, 3 = Yes ] but in some ... | 2021/07/19 | [
"https://Stackoverflow.com/questions/68447195",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16447709/"
] | Sure, it's called a render prop. Just directly pass the node like this:
```js
// in the parent component
<Grid
tableData={gridData}
columnData={activeListColumnDef}
icon={<AddIcon onClick={onClickOpenActiveListEditor} />}
{...props}
/>
// in the Grid component
function Grid({tableData, columnData, icon... | You could do something like:
```
const renderIcon = (onClick) => {
return <Icon onClick={onClick} />
}
...
<IconButton renderIcon={renderIcon} />
```
Then, inside `IconButton`:
```
{renderIcon()}
``` |
27,573,161 | Is it possible to connect to [Google Cloud SQL](https://cloud.google.com/sql/docs) from a [Google Managed VM](https://cloud.google.com/appengine/docs/managed-vms/)? With regular Google App Engine applications, I can connect by authorizing my project in the Cloud SQL console and using `unix_socket='/cloudsql/' + _INSTAN... | 2014/12/19 | [
"https://Stackoverflow.com/questions/27573161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4379134/"
] | The `/cloudsql/` sockets are only available in regular App Engine. Managed VMs are regular VMs so connection to Cloud SQL needs to use the external IP of that Cloud SQL instances. The external IP needs to be whitelisted. The external IP is showed in the Developers Console and can also be retrieved via gcloud CLI tool.
... | Everything is described here depends on language:
<https://cloud.google.com/sql/docs/dev-access>
more details with pythons are here:
subject: Step 2: Grant your App Engine application access to the Google Cloud SQL instance
<https://cloud.google.com/appengine/docs/python/cloud-sql/> |
27,573,161 | Is it possible to connect to [Google Cloud SQL](https://cloud.google.com/sql/docs) from a [Google Managed VM](https://cloud.google.com/appengine/docs/managed-vms/)? With regular Google App Engine applications, I can connect by authorizing my project in the Cloud SQL console and using `unix_socket='/cloudsql/' + _INSTAN... | 2014/12/19 | [
"https://Stackoverflow.com/questions/27573161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4379134/"
] | The `/cloudsql/` sockets are only available in regular App Engine. Managed VMs are regular VMs so connection to Cloud SQL needs to use the external IP of that Cloud SQL instances. The external IP needs to be whitelisted. The external IP is showed in the Developers Console and can also be retrieved via gcloud CLI tool.
... | Concerning the first solution provided by @Razvan Musaloiu-E
>
> Switch to use only SSL connections for IP connectivity and whitelist 0.0.0.0/0.
>
>
>
Are there any security concerns if I do this ? Besides from having a "root"/"root" login/pasword on my Cloud SQL database of course... |
27,573,161 | Is it possible to connect to [Google Cloud SQL](https://cloud.google.com/sql/docs) from a [Google Managed VM](https://cloud.google.com/appengine/docs/managed-vms/)? With regular Google App Engine applications, I can connect by authorizing my project in the Cloud SQL console and using `unix_socket='/cloudsql/' + _INSTAN... | 2014/12/19 | [
"https://Stackoverflow.com/questions/27573161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4379134/"
] | The `/cloudsql/` sockets are only available in regular App Engine. Managed VMs are regular VMs so connection to Cloud SQL needs to use the external IP of that Cloud SQL instances. The external IP needs to be whitelisted. The external IP is showed in the Developers Console and can also be retrieved via gcloud CLI tool.
... | If you're willing to try out Cloud SQL Second Generation (currently in Beta), there's built-in support for connecting from Managed VMs that is similar to App Engine: <https://cloud.google.com/sql/docs/sql-proxy#gae> |
27,573,161 | Is it possible to connect to [Google Cloud SQL](https://cloud.google.com/sql/docs) from a [Google Managed VM](https://cloud.google.com/appengine/docs/managed-vms/)? With regular Google App Engine applications, I can connect by authorizing my project in the Cloud SQL console and using `unix_socket='/cloudsql/' + _INSTAN... | 2014/12/19 | [
"https://Stackoverflow.com/questions/27573161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4379134/"
] | If you're willing to try out Cloud SQL Second Generation (currently in Beta), there's built-in support for connecting from Managed VMs that is similar to App Engine: <https://cloud.google.com/sql/docs/sql-proxy#gae> | Everything is described here depends on language:
<https://cloud.google.com/sql/docs/dev-access>
more details with pythons are here:
subject: Step 2: Grant your App Engine application access to the Google Cloud SQL instance
<https://cloud.google.com/appengine/docs/python/cloud-sql/> |
27,573,161 | Is it possible to connect to [Google Cloud SQL](https://cloud.google.com/sql/docs) from a [Google Managed VM](https://cloud.google.com/appengine/docs/managed-vms/)? With regular Google App Engine applications, I can connect by authorizing my project in the Cloud SQL console and using `unix_socket='/cloudsql/' + _INSTAN... | 2014/12/19 | [
"https://Stackoverflow.com/questions/27573161",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4379134/"
] | If you're willing to try out Cloud SQL Second Generation (currently in Beta), there's built-in support for connecting from Managed VMs that is similar to App Engine: <https://cloud.google.com/sql/docs/sql-proxy#gae> | Concerning the first solution provided by @Razvan Musaloiu-E
>
> Switch to use only SSL connections for IP connectivity and whitelist 0.0.0.0/0.
>
>
>
Are there any security concerns if I do this ? Besides from having a "root"/"root" login/pasword on my Cloud SQL database of course... |
273 | I'm looking for a minimum of fuss here to get up and running.
Bonuses:
- cross platform
- portable (can be installed/run from a USB)
*Clarification: I'm not looking to setup a full-fledged remote testing server, I just need something simple that I can load localhost in my computer's browser and check my latest cha... | 2010/07/08 | [
"https://webmasters.stackexchange.com/questions/273",
"https://webmasters.stackexchange.com",
"https://webmasters.stackexchange.com/users/120/"
] | [XAMPP](http://www.apachefriends.org/en/xampp.html). It is also easy to do with [PortableApps.com](http://portableapps.com/apps/development/xampp) but you don't need PortableApps to do it on a removable drive. | [Xampp](http://www.apachefriends.org/en/xampp.html) is easy to install and you can choose to install it in portable form on a USB drive. |
273 | I'm looking for a minimum of fuss here to get up and running.
Bonuses:
- cross platform
- portable (can be installed/run from a USB)
*Clarification: I'm not looking to setup a full-fledged remote testing server, I just need something simple that I can load localhost in my computer's browser and check my latest cha... | 2010/07/08 | [
"https://webmasters.stackexchange.com/questions/273",
"https://webmasters.stackexchange.com",
"https://webmasters.stackexchange.com/users/120/"
] | Some options include:
* [XAMPP](http://www.apachefriends.org/en/xampp.html): (Cross Platform) Comes with Apache, MySQL, PHP and Perl support out of the box and is portable but needs manual configuration if you defer from the default.
* [WAMP](http://www.wampserver.com/en/): (Windows) Comes with Apache, MySQL and PHP s... | [Xampp](http://www.apachefriends.org/en/xampp.html) is easy to install and you can choose to install it in portable form on a USB drive. |
14,914,184 | Is it possible to declare an array inside a loop. For some reasons I can not declare it before the loop since its length changes. I am wondering if I can re-declare/delete an array within the loop. I am using C++/CLI language. | 2013/02/16 | [
"https://Stackoverflow.com/questions/14914184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2031775/"
] | You can use `last` method:
```
$('root > elem1').last();
```
By looking at QueryPath API it seems you can code:
```
$root->children('elem1')->last()
``` | [last()](http://api.jquery.com/last/) method that reduces the set of matched elements to the final one in the set, can do it for you like below;
```
$('root > elem1').last();
```
OR
You can use [:last-child Selector](http://api.jquery.com/last-child-selector/) that selects all elements that are the last child of th... |
14,914,184 | Is it possible to declare an array inside a loop. For some reasons I can not declare it before the loop since its length changes. I am wondering if I can re-declare/delete an array within the loop. I am using C++/CLI language. | 2013/02/16 | [
"https://Stackoverflow.com/questions/14914184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2031775/"
] | You can use `last` method:
```
$('root > elem1').last();
```
By looking at QueryPath API it seems you can code:
```
$root->children('elem1')->last()
``` | This works
```
$root->find('elem1:last-of-type');
```
Thanks David Thomas for Proof of Concept
<http://jsfiddle.net/davidThomas/RehZ7/> |
14,914,184 | Is it possible to declare an array inside a loop. For some reasons I can not declare it before the loop since its length changes. I am wondering if I can re-declare/delete an array within the loop. I am using C++/CLI language. | 2013/02/16 | [
"https://Stackoverflow.com/questions/14914184",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2031775/"
] | This works
```
$root->find('elem1:last-of-type');
```
Thanks David Thomas for Proof of Concept
<http://jsfiddle.net/davidThomas/RehZ7/> | [last()](http://api.jquery.com/last/) method that reduces the set of matched elements to the final one in the set, can do it for you like below;
```
$('root > elem1').last();
```
OR
You can use [:last-child Selector](http://api.jquery.com/last-child-selector/) that selects all elements that are the last child of th... |
31,969,263 | I would like any guidance or a starting point to implement a product comparator in out html5 knockout app. The comparator can add upto 3 products for comparison side by side, user has choice to remove any and add in a new product.
My problem is basically its easier to delete a div but how do i remove entire columns of... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31969263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1645859/"
] | 1. In my case, I first added a new Asset Catalog set to my extension.
2. In that Asset Catalog, I added an new AppIcon, using the + menu at the bottom. Note the name is: **AppIcon**
3. I then added my images to the new AppIcon.
4. Then under Targets, I selected my extension, then under Build Settings under Asset Catalo... | The best answer for the same as following :
1. Select Project -> Goto "**Build Phase**"
2. Expands the "**Compile Source**"
3. Add "**images.xcassests**" of your mainProject
>
> The bigest advantage of following above step is "*Memory Management*" + "*Decrease Size Of Project Too*".
>
>
>
Hope It helps... |
31,969,263 | I would like any guidance or a starting point to implement a product comparator in out html5 knockout app. The comparator can add upto 3 products for comparison side by side, user has choice to remove any and add in a new product.
My problem is basically its easier to delete a div but how do i remove entire columns of... | 2015/08/12 | [
"https://Stackoverflow.com/questions/31969263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1645859/"
] | 1. In my case, I first added a new Asset Catalog set to my extension.
2. In that Asset Catalog, I added an new AppIcon, using the + menu at the bottom. Note the name is: **AppIcon**
3. I then added my images to the new AppIcon.
4. Then under Targets, I selected my extension, then under Build Settings under Asset Catalo... | You have to add a separate Asset Catalog to your app extention, as your app and your extention are not sharing files.
Right click your app extention folder in the Xcode browser on the left -> *New File...* -> *Asset Catalog* (Resource).
Then add a App Icon to your asset catalog. Select asset catalog in the Xcode brow... |
24,295,820 | First time using Doxygen here. Using the Doxygen Wizard, and I'm pretty sure I'm setting all the directories and everything correctly but for some reason the outputted documentation only has the header files. My project is written in C, and it's like it is just completely ignoring the .c source files and only grabbing ... | 2014/06/18 | [
"https://Stackoverflow.com/questions/24295820",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2390773/"
] | In The Doxyfile, set **EXTRACT\_ALL = YES**.
Default Value is **NO**.
This will document all the entities, without the requirement of any Doxygen Special comments. | I think I may have solved it. There seems to be source code documentation for .c source files now after changing the settings as shown in the image below.
 |
12,999,763 | I am building an application where I have a server and a client that talk to each other -~~over telnet~~. (via socket). The server program is monitoring a tank of some gass, and sends temperature level and preassure level via socket to the accepted clients.
I have managed to get the client and server to talk to each o... | 2012/10/21 | [
"https://Stackoverflow.com/questions/12999763",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1275746/"
] | First of all, what you want is adding metadata to mp3s which is the most common usage scenario people have. The "normal" way is to use a Musicbrainz Tagger, open these files there and work with the interface to attach the correct metadata.
The suggested (gui) tool is [Musicbrain Picard](http://musicbrainz.org/doc/Music... | Check out our perl modules for accessing the Cover Art Archive:
[http://metacpan.org/pod/Net::CoverArtArchive](http://metacpan.org/pod/Net%3a%3aCoverArtArchive)
More info on our archive is here, including specs:
<http://coverartarchive.org/>
Good luck! |
54,990,863 | I have a variadic template function F which must be called upon exactly two objects. Another function, called G, will therefore call F twice, once for object one and the other one for object two. G is therefore also variadic, but the problem is that the two variadic parameters packs for the two calls on F can be differ... | 2019/03/04 | [
"https://Stackoverflow.com/questions/54990863",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3074280/"
] | using Tag might help here, as you cannot partial specialize function:
```
template <typename ... Ts>
struct Tag {};
template< typename ...Args>
void F(Obj obj) { /*...*/ }
template<typename ...Args1, typename ...Args2>
void G(Tag<Args1...>, Obj obj_1, Tag<Args2...>, Ojb obj_2)
{
F<Args1...>( obj_1 );
F<Args2... | Tags are a great plan. If you don't want to use tags, you can use lambdas.
In [c++20](/questions/tagged/c%2b%2b20 "show questions tagged 'c++20'") we can do
```
template<class...Args1>
auto G() {
return []<class...Args2>() {
F<Args1...>( obj_1 );
F<Args2...>( obj_2 );
};
}
```
now calling this is a *big... |
78,854 | Let X be a normally distributed variable with unknown parameters μ and σ (sigma). If we know that
P (X ≥ 75) = 0.7291 and P (X ≥ 83) = 0.7764. With the information given Is it possible to determine the values for μ and σ ?. It is possible these odds?, Personally I see no sense to this probabilities? because I believe t... | 2011/11/04 | [
"https://math.stackexchange.com/questions/78854",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/9799/"
] | I will assume you are trying to show
$$\frac{d}{d t} \mathrm{P} \int\_{-\infty}^\infty dx \ \frac{\phi(x)}{x-t} = \mathrm{P} \int\_{-\infty}^\infty dx \ \frac{\phi(x)-\phi(t)}{(x-t)^2}$$
Using the definition of principal value and the Leibniz integral rule you will find
$$\frac{d}{d t} \mathrm{P} \int\_{-\infty}^\inft... | One can begin with $$\frac{d}{dt}P \; \int\_{-\infty}^\infty \frac{\phi(x)-\phi(t)}{x-t}dx.$$ |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | >
> what should the sports be like and which ones could be easily adapted to zero or low gravity for both entertainment and revenue for the larger space stations?
>
>
>
Well for starts any sport based on the physics of gravity bringing the ball or focus of the game down to score points, end a play, or otherwise in... | * E-sports
Here you can have any game you want. Look at competitive League of Legends, Starcraft 2 or COD. With more immersive VR or even fully immersive steering via brain-maschine connection you can have any sport imaginable and even some, which are impractical today (like full contact gladiator fights). This would ... |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | **Ender's Game**
A good portion of my favorite bits of Ender's Game was the description of their war games in zero-g. This sounds like a perfect sport to run for fast interesting spectator sport.
Rules
>
> The objective of the Battle Room game was to either freeze all soldiers of the opponent's army, or to have fou... | Ulama
=====
[](https://i.stack.imgur.com/1A0le.jpg)
This game has a long imperial tradition in Mesoamerica where the most prominent cultures had some version of it, including Aztecs and Mayans, just to mention the most well-known. According to wikipedia:
>
> the... |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | **Quidditch**
Ok on Earth it looks lameass but with microdrone balls and compressed gas propelled "broomsticks" it could actually work
From this
[](https://i.stack.imgur.com/JU114.png)
To this
[. This would ... |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | >
> what should the sports be like and which ones could be easily adapted to zero or low gravity for both entertainment and revenue for the larger space stations?
>
>
>
Well for starts any sport based on the physics of gravity bringing the ball or focus of the game down to score points, end a play, or otherwise in... | Ulama
=====
[](https://i.stack.imgur.com/1A0le.jpg)
This game has a long imperial tradition in Mesoamerica where the most prominent cultures had some version of it, including Aztecs and Mayans, just to mention the most well-known. According to wikipedia:
>
> the... |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | If you create artificial gravity by placing contestants in a rotating arena, you create a lot of tricky Coriolis force effects. This would be nice for example in any sports involving accurate shooting or throwing, like Javelin, or Archery, as the contestant needs to account for the extra curvature and spin. Variations ... | * E-sports
Here you can have any game you want. Look at competitive League of Legends, Starcraft 2 or COD. With more immersive VR or even fully immersive steering via brain-maschine connection you can have any sport imaginable and even some, which are impractical today (like full contact gladiator fights). This would ... |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | **Ender's Game**
A good portion of my favorite bits of Ender's Game was the description of their war games in zero-g. This sounds like a perfect sport to run for fast interesting spectator sport.
Rules
>
> The objective of the Battle Room game was to either freeze all soldiers of the opponent's army, or to have fou... | * E-sports
Here you can have any game you want. Look at competitive League of Legends, Starcraft 2 or COD. With more immersive VR or even fully immersive steering via brain-maschine connection you can have any sport imaginable and even some, which are impractical today (like full contact gladiator fights). This would ... |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | **Quidditch**
Ok on Earth it looks lameass but with microdrone balls and compressed gas propelled "broomsticks" it could actually work
From this
[](https://i.stack.imgur.com/JU114.png)
To this
[](https://i.stack.imgur.com/JU114.png)
To this
[, people float in a 3D glass ball. The logistics of the game would be similar in that you'd have a goalie responsible for defending what is basically a hole in one side of the ball, but... |
142,065 | The Hegemony wishes to organise not only terrestrial games within the inner colonies, but has also wished to establish major sporting events for the other colonies in low gravity environments on top of this they even play a Olympics like event for the "Spacers". Examples of colonies that wpuld host these sports would b... | 2019/03/22 | [
"https://worldbuilding.stackexchange.com/questions/142065",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/51720/"
] | If you create artificial gravity by placing contestants in a rotating arena, you create a lot of tricky Coriolis force effects. This would be nice for example in any sports involving accurate shooting or throwing, like Javelin, or Archery, as the contestant needs to account for the extra curvature and spin. Variations ... | **Ender's Game**
A good portion of my favorite bits of Ender's Game was the description of their war games in zero-g. This sounds like a perfect sport to run for fast interesting spectator sport.
Rules
>
> The objective of the Battle Room game was to either freeze all soldiers of the opponent's army, or to have fou... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | Something like:
```
sw.WriteLine(row["columnname"].ToString());
```
would be more appropriate. | There is no "natural" string representation for a DataRow. You need to write it out in whatever format you desire, i.e., comma-separated list of values, etc. You can enumerate the columns and print their values, for instance:
```
foreach (DataRow row in table.Rows)
{
bool firstCol = true;
foreach (DataColumn c... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | Something like:
```
sw.WriteLine(row["columnname"].ToString());
```
would be more appropriate. | The below code will let you to write text file each column separated by '|'
```
foreach (DataRow row in dt.Rows)
{
object[] array = row.ItemArray;
for (int i = 0; i < array.Length - 1; i++)
{
swExtLogFile.Write(array[i].ToString() + " | ");
}
swExtL... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | When you try to print out a `DataRow` like that, it is calling [`Object.ToString()`](http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx), which simply prints out the name of the type. What you want to do is something like:
```
sw.WriteLine(String.Join(",", row.ItemArray));
```
This will print a comm... | There is no "natural" string representation for a DataRow. You need to write it out in whatever format you desire, i.e., comma-separated list of values, etc. You can enumerate the columns and print their values, for instance:
```
foreach (DataRow row in table.Rows)
{
bool firstCol = true;
foreach (DataColumn c... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | When you try to print out a `DataRow` like that, it is calling [`Object.ToString()`](http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx), which simply prints out the name of the type. What you want to do is something like:
```
sw.WriteLine(String.Join(",", row.ItemArray));
```
This will print a comm... | You need to write the columns from each DataRow. Currently you are writing the DataRow object that is dataRow.ToString() hence you get string name `"System.Data.DataRow"` of dataRow in your file
```
foreach(DataRow row in table.Rows)
{
foreach(DataColumn column in table.Columns)
{
sw.WriteLine(row[column]);
}
}
... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | There is no "natural" string representation for a DataRow. You need to write it out in whatever format you desire, i.e., comma-separated list of values, etc. You can enumerate the columns and print their values, for instance:
```
foreach (DataRow row in table.Rows)
{
bool firstCol = true;
foreach (DataColumn c... | Try this:
**To write the DataTable rows to text files in the specific directory**
```
var dir = @"D:\New folder\log"; // folder location
if (!Directory.Exists(dir)) // if it doesn't exist, create
Directory.CreateDirectory(dir);
foreach (DataRow row in dt.Rows)
... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | The below code will let you to write text file each column separated by '|'
```
foreach (DataRow row in dt.Rows)
{
object[] array = row.ItemArray;
for (int i = 0; i < array.Length - 1; i++)
{
swExtLogFile.Write(array[i].ToString() + " | ");
}
swExtL... | There is no "natural" string representation for a DataRow. You need to write it out in whatever format you desire, i.e., comma-separated list of values, etc. You can enumerate the columns and print their values, for instance:
```
foreach (DataRow row in table.Rows)
{
bool firstCol = true;
foreach (DataColumn c... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | The below code will let you to write text file each column separated by '|'
```
foreach (DataRow row in dt.Rows)
{
object[] array = row.ItemArray;
for (int i = 0; i < array.Length - 1; i++)
{
swExtLogFile.Write(array[i].ToString() + " | ");
}
swExtL... | You need to write the columns from each DataRow. Currently you are writing the DataRow object that is dataRow.ToString() hence you get string name `"System.Data.DataRow"` of dataRow in your file
```
foreach(DataRow row in table.Rows)
{
foreach(DataColumn column in table.Columns)
{
sw.WriteLine(row[column]);
}
}
... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | When you try to print out a `DataRow` like that, it is calling [`Object.ToString()`](http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx), which simply prints out the name of the type. What you want to do is something like:
```
sw.WriteLine(String.Join(",", row.ItemArray));
```
This will print a comm... | Try this:
**To write the DataTable rows to text files in the specific directory**
```
var dir = @"D:\New folder\log"; // folder location
if (!Directory.Exists(dir)) // if it doesn't exist, create
Directory.CreateDirectory(dir);
foreach (DataRow row in dt.Rows)
... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | When you try to print out a `DataRow` like that, it is calling [`Object.ToString()`](http://msdn.microsoft.com/en-us/library/system.object.tostring.aspx), which simply prints out the name of the type. What you want to do is something like:
```
sw.WriteLine(String.Join(",", row.ItemArray));
```
This will print a comm... | The below code will let you to write text file each column separated by '|'
```
foreach (DataRow row in dt.Rows)
{
object[] array = row.ItemArray;
for (int i = 0; i < array.Length - 1; i++)
{
swExtLogFile.Write(array[i].ToString() + " | ");
}
swExtL... |
11,749,812 | ```
public void GenerateDetailFile()
{
if (!Directory.Exists(AppVars.IntegrationFilesLocation))
{
Directory.CreateDirectory(AppVars.IntegrationFilesLocation);
}
DateTime DateTime = DateTime.Now;
using (StreamWriter sw = File.CreateText(AppVars.IntegrationFilesLocation +
Da... | 2012/07/31 | [
"https://Stackoverflow.com/questions/11749812",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1336632/"
] | Something like:
```
sw.WriteLine(row["columnname"].ToString());
```
would be more appropriate. | Try this:
**To write the DataTable rows to text files in the specific directory**
```
var dir = @"D:\New folder\log"; // folder location
if (!Directory.Exists(dir)) // if it doesn't exist, create
Directory.CreateDirectory(dir);
foreach (DataRow row in dt.Rows)
... |
156,109 | Newbie to illustrator here and haven't found an answer to this online yet.
Looking to separate all shapes in this vector but cant dissect the circles with scissor tool because of paths placed in circles. I want to move, fill, or transform pieces separately.
[](h... | 2022/02/22 | [
"https://graphicdesign.stackexchange.com/questions/156109",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/172383/"
] | * Select All
* Grab the **Live Paint Bucket** tool
* Pick a color from Swatches
* Start Clicking | Given what you already have there the Shapebuilder tool can get you what you want.
You will need to Select each circle and pen path separately (otherwise the circle overlaps will cause you trouble).
Use the shapebuilder tool to make each circle/ pen tool path into separate shapes.
Then Select and color them as you l... |
5,664,615 | I have a complex query that requires a rank in it. I've learned that the standard way of doing that is by using the technique found on this page: <http://thinkdiff.net/mysql/how-to-get-rank-using-mysql-query/>. I'm using Infobright as the back end and it doesn't work quite as expected. That is, while a standard MySQL e... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5664615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/373327/"
] | With many tips of this topic I made it work.
However it works now with a query string in the URL.
*.htaccess file in the folder fotoalbum/uploads/ :*
```
Options -Indexes
<Files *>
deny from all
</Files>
```
*getfile.php file in the folder /fotoalbum/ :*
```
<?php
//this file checks if user is logged in and die... | I guess the PHP-File is saved with [BOM](http://en.wikipedia.org/wiki/Byte_Order_Mark), save it without BOM.
Why i guess this:  looks like a BOM |
5,664,615 | I have a complex query that requires a rank in it. I've learned that the standard way of doing that is by using the technique found on this page: <http://thinkdiff.net/mysql/how-to-get-rank-using-mysql-query/>. I'm using Infobright as the back end and it doesn't work quite as expected. That is, while a standard MySQL e... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5664615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/373327/"
] | With many tips of this topic I made it work.
However it works now with a query string in the URL.
*.htaccess file in the folder fotoalbum/uploads/ :*
```
Options -Indexes
<Files *>
deny from all
</Files>
```
*getfile.php file in the folder /fotoalbum/ :*
```
<?php
//this file checks if user is logged in and die... | Hi
I'm taking a shot here, but have you checked to make sure mime\_content\_type is returning the correct mime type for your file? It would seem like if the statement
```
header("Content-type: ".$type);
```
is not outputting correctly, then the image or text file will not come through correctly either. PHP.net indi... |
5,664,615 | I have a complex query that requires a rank in it. I've learned that the standard way of doing that is by using the technique found on this page: <http://thinkdiff.net/mysql/how-to-get-rank-using-mysql-query/>. I'm using Infobright as the back end and it doesn't work quite as expected. That is, while a standard MySQL e... | 2011/04/14 | [
"https://Stackoverflow.com/questions/5664615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/373327/"
] | With many tips of this topic I made it work.
However it works now with a query string in the URL.
*.htaccess file in the folder fotoalbum/uploads/ :*
```
Options -Indexes
<Files *>
deny from all
</Files>
```
*getfile.php file in the folder /fotoalbum/ :*
```
<?php
//this file checks if user is logged in and die... | You should use readfile() instead of echo file\_get\_contents() when streaming images and other binary files back to the client.
**Update:**
The issue you are having with mime\_content\_type() is due to PHP\_EOL which is adding a line break. There also is a lot of unnecessary type casting. Below is a cleaned up vers... |
35,767 | If two analytical functions of $\mathbb{C}$ f and g are equal on an infinite number of input values, than they are equal. I can't seem to find a counterexample, but I haven't seen this anywhere except on the particular practice exam question I'm trying to solve.
Edit:Uncountably infinite. Sorry about that. | 2011/04/29 | [
"https://math.stackexchange.com/questions/35767",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/2919/"
] | As pointed out in the comments, this is false: $\sin(x)$ has infinitely many zeroes, so it coincides with the constant function $0$ infinitely often.
What is true, however, is that if $U$ is a connected domain, $f,g$ are analytic in $U$, and the set of points where $f$ and $g$ coincide has a limit point *in* $U$, then... | Any uncountable subset of Euclidean space has a limit point (in our case, we have that the set of points where f and g agree has a limit point). This is because $E^n$ is Lindelöf, i.e.,every cover of $E^n$ by open sets has a countable subcover, and by Weierstrass Theorem on Infinite Bounded Subsets of $ E^n$.
We take ... |
42,232,564 | I am facing the following problem with [Flow](https://flowtype.org/):
I have a type alias of an object, `A`:
```
type A = {
B: {
C: string
}
}
```
I want to create another type alias, `B` p.e., that have the signature of the `B` property in `A`.
I tried with `type B = A.B;` but it Flow throws the followin... | 2017/02/14 | [
"https://Stackoverflow.com/questions/42232564",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7564254/"
] | You can use the `$PropertyType` helper
```
type A = {
B: {
C: string
}
}
type B = $PropertyType<A, 'B'>
```
See <https://flow.org/en/docs/types/utilities/#toc-propertytype> for the full docs. | Can you just do this?
```
type B = {
C: string
}
type A = {
B: B
}
```
It's not exactly what you asked for, but it does allow you to avoid duplication. I don't believe there is a way to do exactly what you have asked for. |
59,067,229 | My goal is to re-use a task window in VS Code. However, when I enter ctrl + c, the task stops, but then writes: "**Terminal will be reused by tasks, press any key to close it.**".
I don't want to close the window. It's frustrating because it forces me to open a new window and navigate to the correct directory.
I reco... | 2019/11/27 | [
"https://Stackoverflow.com/questions/59067229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3694288/"
] | I don't think this is possible and it *may* be by design.
If you look at the [schema of tasks.json](https://code.visualstudio.com/docs/editor/tasks-appendix), you see:
```js
/**
* The description of a task.
*/
interface TaskDescription {
/**
* The task's name
*/
label: string;
/**
* The type of a cu... | It sounds like you want to launch a shell in the right folder after the task is complete. I'm not sure if this is the best way to do it, but I do something similar with compound tasks.
```
{
"label": "some label",
"type": "npm",
"script": "build",
"path": "some-path/",
"problemMatcher": [],
"ru... |
59,067,229 | My goal is to re-use a task window in VS Code. However, when I enter ctrl + c, the task stops, but then writes: "**Terminal will be reused by tasks, press any key to close it.**".
I don't want to close the window. It's frustrating because it forces me to open a new window and navigate to the correct directory.
I reco... | 2019/11/27 | [
"https://Stackoverflow.com/questions/59067229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3694288/"
] | I found yet another solution for this that works great for me:
1. using bash:
```
"tasks": [
{
"label": "start server",
"type": "shell",
"command": "bash -c 'cd backend && npm run dev; exec bash'",
"isBackground": false,
"presentation": {
"panel": "new",
... | It sounds like you want to launch a shell in the right folder after the task is complete. I'm not sure if this is the best way to do it, but I do something similar with compound tasks.
```
{
"label": "some label",
"type": "npm",
"script": "build",
"path": "some-path/",
"problemMatcher": [],
"ru... |
59,067,229 | My goal is to re-use a task window in VS Code. However, when I enter ctrl + c, the task stops, but then writes: "**Terminal will be reused by tasks, press any key to close it.**".
I don't want to close the window. It's frustrating because it forces me to open a new window and navigate to the correct directory.
I reco... | 2019/11/27 | [
"https://Stackoverflow.com/questions/59067229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3694288/"
] | I don't think this is possible and it *may* be by design.
If you look at the [schema of tasks.json](https://code.visualstudio.com/docs/editor/tasks-appendix), you see:
```js
/**
* The description of a task.
*/
interface TaskDescription {
/**
* The task's name
*/
label: string;
/**
* The type of a cu... | I found a solution for this, my task looks something like this
```js
"tasks": [
{
"label": "start server",
"type": "shell",
"command": "RUN='cd backend && npm run dev' bash",
"problemMatcher": [],
},
]
```
and at the end of my .bashrc I have `eval "$... |
59,067,229 | My goal is to re-use a task window in VS Code. However, when I enter ctrl + c, the task stops, but then writes: "**Terminal will be reused by tasks, press any key to close it.**".
I don't want to close the window. It's frustrating because it forces me to open a new window and navigate to the correct directory.
I reco... | 2019/11/27 | [
"https://Stackoverflow.com/questions/59067229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3694288/"
] | I found yet another solution for this that works great for me:
1. using bash:
```
"tasks": [
{
"label": "start server",
"type": "shell",
"command": "bash -c 'cd backend && npm run dev; exec bash'",
"isBackground": false,
"presentation": {
"panel": "new",
... | I found a solution for this, my task looks something like this
```js
"tasks": [
{
"label": "start server",
"type": "shell",
"command": "RUN='cd backend && npm run dev' bash",
"problemMatcher": [],
},
]
```
and at the end of my .bashrc I have `eval "$... |
141,905 | How could one force [ogr2ogr](/questions/tagged/ogr2ogr "show questions tagged 'ogr2ogr'") to use a specific format to read input files?
Out of the box ogr2ogr automatically chooses from it's long list of formats, which most of the time is great. However today I'm troubleshooting data files which won't convert, but s... | 2015/04/08 | [
"https://gis.stackexchange.com/questions/141905",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/108/"
] | A python solution is fairly simple using `ogr.GetDriverByName(in_format).Open(in_file)`.
```
import sys
from osgeo import ogr
def main(in_file, in_format, out_file, out_format):
in_ds = ogr.GetDriverByName(in_format).Open(in_file)
out_ds = ogr.GetDriverByName(out_format).CopyDataSource(in_ds, out_file)
if __... | As of GDAL-2.3.0 ([commit](https://github.com/OSGeo/gdal/commit/fda181a6120e69ada9bf5bcadaf7fe9cfff62033)), you can give a hint for a few of the JSON drivers by prefixing a special string to the filename. The strings to prefix filename are:
* `ESRIJSON:`
* `GEOJSON:`
* `TOPOJSON:`
For example:
```
ogrinfo -ro -so ES... |
141,905 | How could one force [ogr2ogr](/questions/tagged/ogr2ogr "show questions tagged 'ogr2ogr'") to use a specific format to read input files?
Out of the box ogr2ogr automatically chooses from it's long list of formats, which most of the time is great. However today I'm troubleshooting data files which won't convert, but s... | 2015/04/08 | [
"https://gis.stackexchange.com/questions/141905",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/108/"
] | A python solution is fairly simple using `ogr.GetDriverByName(in_format).Open(in_file)`.
```
import sys
from osgeo import ogr
def main(in_file, in_format, out_file, out_format):
in_ds = ogr.GetDriverByName(in_format).Open(in_file)
out_ds = ogr.GetDriverByName(out_format).CopyDataSource(in_ds, out_file)
if __... | For certain file extensions (e.g. .MDB), there may be multiple compatible drivers (PGeo, ODBC, MDB). In this case, to choose a specific driver (e.g. [MDB](https://gdal.org/drivers/vector/mdb.html#vector-mdb)) out of the three, it is necessary to set the `OGR_SKIP` environment variable for the GDAL command line tools (e... |
141,905 | How could one force [ogr2ogr](/questions/tagged/ogr2ogr "show questions tagged 'ogr2ogr'") to use a specific format to read input files?
Out of the box ogr2ogr automatically chooses from it's long list of formats, which most of the time is great. However today I'm troubleshooting data files which won't convert, but s... | 2015/04/08 | [
"https://gis.stackexchange.com/questions/141905",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/108/"
] | As of GDAL-2.3.0 ([commit](https://github.com/OSGeo/gdal/commit/fda181a6120e69ada9bf5bcadaf7fe9cfff62033)), you can give a hint for a few of the JSON drivers by prefixing a special string to the filename. The strings to prefix filename are:
* `ESRIJSON:`
* `GEOJSON:`
* `TOPOJSON:`
For example:
```
ogrinfo -ro -so ES... | For certain file extensions (e.g. .MDB), there may be multiple compatible drivers (PGeo, ODBC, MDB). In this case, to choose a specific driver (e.g. [MDB](https://gdal.org/drivers/vector/mdb.html#vector-mdb)) out of the three, it is necessary to set the `OGR_SKIP` environment variable for the GDAL command line tools (e... |
7,029,059 | I'm using linq-to-sql to create a join between a table of prescriptions that's in the db and a list of patient call PatientList.
Let's say that the table and the list contain an int called PatientID that I'll be using to create the join to filter the patient list by past prescription status.
I'm having a challenge wi... | 2011/08/11 | [
"https://Stackoverflow.com/questions/7029059",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/565968/"
] | It's the code within the .tooltip:hover img class - If you remove it, it works well:
<http://jsfiddle.net/RyRRM/> | it's probably because the event is triggered by the tooltip's non-text-node parent. When you hover over the image, it detects a mouseout event for the parent. You could try making the image a css background and setting the width of the element instead of embedding the `<img>`
Your markup could then be
```
<a class="... |
38,387,638 | For example, I have the following C++ structure...
```
struct dleaf_t
{
int contents; // OR of all brushes (not needed?)
short cluster; // cluster this leaf is in
short area : 9; // area this leaf is in
short flags... | 2016/07/15 | [
"https://Stackoverflow.com/questions/38387638",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1938929/"
] | Merge the two bit fields into a single `int` field, and then write member methods to extract the values for the individual fields which have been combined, e.g.
```
public int area_flags;
public int getArea() { return area_flags & 0x1FF; }
public int getFlags() { return (area_flags >> 9) & 0x3F; }
```
You may need t... | I don't know if this is possible with JNA. Please look through the documentation and see if you can find something about your problem. |
74,195,982 | I have a database. These database has two tables.
One table is `music`.
| name | Date | Edition | Song\_ID | Singer\_ID |
| --- | --- | --- | --- | --- |
| LA | 01.05.2009 | 1 | 1 | 1 |
| Second | 13.07.2009 | 1 | 2 | 2 |
| Mexico | 13.07.2009 | 1 | 3 | 1 |
| Let's go | 13.09.2009 | 1 | 4 | 3 |
| Hello | 18.09.2009 |... | 2022/10/25 | [
"https://Stackoverflow.com/questions/74195982",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Do you want a count query here:
```sql
SELECT COUNT(DISTINCT Song_ID) FROM music;
```
Assuming that every `Song_ID` be unique in the `music` table, you don't even need a distinct count; a regular count will also work:
```sql
SELECT COUNT(Song_ID) FROM music;
``` | I would also try
SELECT DISTINCT COUNT(Song\_ID) from music; |
266,340 | Because I am reading lots of pdfs from the screen, the white background make my eyes tired. Is there a decent lightweight pdf reader that can invert colors of everything on the page?
I have tried Adobe Reader and Foxit Reader but they only allow to change document colors, if a document is a scanned document everything... | 2011/04/04 | [
"https://superuser.com/questions/266340",
"https://superuser.com",
"https://superuser.com/users/19707/"
] | Try [Evince](http://projects.gnome.org/evince/). It can `View > Inverted Colors` even for scanned documents. | Press `Ctrl+Option+Command+8` to invert the colors of the whole screen.
Alternatively, you can go to `System Preferences > Universal Access > Seeing > White on Black`
*[Source](http://www.wikihow.com/Invert-Colors-on-a-Mac)* |
266,340 | Because I am reading lots of pdfs from the screen, the white background make my eyes tired. Is there a decent lightweight pdf reader that can invert colors of everything on the page?
I have tried Adobe Reader and Foxit Reader but they only allow to change document colors, if a document is a scanned document everything... | 2011/04/04 | [
"https://superuser.com/questions/266340",
"https://superuser.com",
"https://superuser.com/users/19707/"
] | Try [Evince](http://projects.gnome.org/evince/). It can `View > Inverted Colors` even for scanned documents. | download free app: [Foxit Reader](http://www.foxitsoftware.com/Secure_PDF_Reader/)
then:
1. go to:Edit >> Preferences >> Accessibility
2. check "Replace Document Colors"
3. select "custom color" and select colors that you need.
4. uncheck "Only change the content in Black/White color"
5. "OK"
by this works you ... |
266,340 | Because I am reading lots of pdfs from the screen, the white background make my eyes tired. Is there a decent lightweight pdf reader that can invert colors of everything on the page?
I have tried Adobe Reader and Foxit Reader but they only allow to change document colors, if a document is a scanned document everything... | 2011/04/04 | [
"https://superuser.com/questions/266340",
"https://superuser.com",
"https://superuser.com/users/19707/"
] | This is the Windows version of Cory's answer. This assumes you use Windows 7.
* Launch the Magnifier. Search for it in the Start Menu.
* Click on the Gear icon to enter the options. In the Options, check "Turn on color inversion".
* Click OK to go back to the main window of the Magnifier.
* Click on the "Minus" button... | [Sumatra reader](http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html) got this right (what a surprise! It is one of the smallest pdf reader out there)
```
View > Settings > Replace document colors with Windows color scheme
```
worked for me while in high-contrast mode in windows.
There is also a flag... |
266,340 | Because I am reading lots of pdfs from the screen, the white background make my eyes tired. Is there a decent lightweight pdf reader that can invert colors of everything on the page?
I have tried Adobe Reader and Foxit Reader but they only allow to change document colors, if a document is a scanned document everything... | 2011/04/04 | [
"https://superuser.com/questions/266340",
"https://superuser.com",
"https://superuser.com/users/19707/"
] | [Sumatra reader](http://blog.kowalczyk.info/software/sumatrapdf/free-pdf-reader.html) got this right (what a surprise! It is one of the smallest pdf reader out there)
```
View > Settings > Replace document colors with Windows color scheme
```
worked for me while in high-contrast mode in windows.
There is also a flag... | Press `Ctrl+Option+Command+8` to invert the colors of the whole screen.
Alternatively, you can go to `System Preferences > Universal Access > Seeing > White on Black`
*[Source](http://www.wikihow.com/Invert-Colors-on-a-Mac)* |
266,340 | Because I am reading lots of pdfs from the screen, the white background make my eyes tired. Is there a decent lightweight pdf reader that can invert colors of everything on the page?
I have tried Adobe Reader and Foxit Reader but they only allow to change document colors, if a document is a scanned document everything... | 2011/04/04 | [
"https://superuser.com/questions/266340",
"https://superuser.com",
"https://superuser.com/users/19707/"
] | Try [Evince](http://projects.gnome.org/evince/). It can `View > Inverted Colors` even for scanned documents. | 1. Make sure you are using Google Chrome as your browser.
2. Go to the Chrome webstore and add the following extension: [Invert Page Colors](https://chrome.google.com/webstore/detail/invert-page-colors/hjhdnhiofjddcapmffbllcpaodjmdphn)
3. Upload your PDF to Google Drive.
4. Once there, open the PDF in the Google Drive ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.