qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
241,822
I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform. My primary concern is to teach my students the best practices for developing in .NET, and I am wondering about whether to consider the use of the VB runtime functions VB.NET legitimate or not. I have read t...
2008/10/28
[ "https://Stackoverflow.com/questions/241822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26396/" ]
There's already a lot for VB6 programmers to learn in moving to VB.NET. Why not let them use the VB functions at first, but do teach them the .NET framework versions. Later they could switch to the .NET framework functions, particularly if they are likely to need to use C# too. EDIT (much later): two renowned VB guru...
If you're teaching VB, those functions are part of VB. If you're teaching the .Net Framework, those functions aren't part of the Framework. If you're trying to get your work done and you have tools available, use your tools.
261,825
How would I prevent OS X even *looking* for a swap file? I killed the swap file on my MBP. This is dead easy: just change the default swap file location so the system can't find it (goto /System/Library/LaunchDaemons/com.apple.dynamic\_pager.plist, change the last `<string>` in the `ProgramArguments` section.) This a...
2011/03/24
[ "https://superuser.com/questions/261825", "https://superuser.com", "https://superuser.com/users/73239/" ]
Use nmap. example: `nmap -sn 10.10.10.0/24` The arp cache will only tell you those that you have tried to contact recently.
If your network is `192.168.0.0/24`, make an executable file with the following code; Change the `192.168.0` to your actual network. ``` #!/bin/bash for ip in 192.168.0.{1..254}; do ping -c 1 -W 1 $ip | grep "64 bytes" & done ```
23,105,709
I have have some trouble in understanding what is needed to fetch a JSON file with mantle.h from a URL. Can someone give me an example of how it works? For example: -I have a URL www.example.com with a JSONFile as follows: ``` { "name": "michael" } ``` How could I fetch it?
2014/04/16
[ "https://Stackoverflow.com/questions/23105709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2906041/" ]
I use this process for fetching JSON: ``` NSURL *s = url;//Put your desird url here NSURLRequest *requestURL = [NSURLRequest requestWithURL:s cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.00]; NSHTTPURLResponse *response; NSError *error = [[NSError alloc]init]; NSData *apiData = [NSURLConnection se...
Call it with following method ``` [super getRequestDataWithURL:urlString andRequestName:sometext]; ``` You will get response in the following method if successful ``` - (void)successWithRequest:(AFHTTPRequestOperation *)operation withRespose:(id)responseObject withRequestName:(NSString *)requestNam...
3,831,510
If $a$ is a constant, what is the name of a curve of the form $a\*(x+y) = x\*y$? And how is this equation related to more this curve's more general equations/characteristics? Plotting this curve, I would risk calling it a hyperbola, but I'm not sure it is, or why it would be one. This equation is similiar to the equiva...
2020/09/18
[ "https://math.stackexchange.com/questions/3831510", "https://math.stackexchange.com", "https://math.stackexchange.com/users/826560/" ]
$$xy=a(x+y)$$ $$xy-ax-ay=0$$ $$xy-ax-ay+a^2=a^2$$ $$(x-a)(y-a)=a^2$$ The curve is an hyperbola.
Every 2-degree equation in x and y represents a conic. So, if you see two branches in its graph, it is always going to be a hyperbola.
60,312,824
I want to `console.log` the result of my query using ajax, but it outputs the CI Landing page in the HTML Code. **JS:** ``` function getRouters(data) { $.ajax({ type: 'POST', url: "http://localhost/ldcm/Main_controller/getRouters", data: data, success: function (data) { console...
2020/02/20
[ "https://Stackoverflow.com/questions/60312824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11188851/" ]
A typical way to handle the order of execution for two different asynchronous operations would be to use promises. ```js var d = $.Deferred(); (function whileLoop(n) { setTimeout(function () { let hashArr = Array.apply(null, Array(n)).map(() => { return '#' }); console.log(hashArr); if ...
You are almost there. I see that you understand that the recursive call to `setTimeout` emulates a while loop asynchronously. And I see that you understand how to decide when to continue the "loop" and when to stop: ``` if (--n) whileLoop(n); ``` You just need to realize that the loop ends when the `if` condition is...
34,547,154
How to change the default icon of my Processing `appIconTest.exe` exported application in windows ? **The default one :** [![app icon to change](https://i.stack.imgur.com/u114Y.png)](https://i.stack.imgur.com/u114Y.png)
2015/12/31
[ "https://Stackoverflow.com/questions/34547154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3745908/" ]
After some research, the easiest solution i could find is : 1. Go into `...\processing-3.0.1-windows64\processing-3.0.1\modes\java\application` 2. Save `sketch.ico` somewhere you can find (renaming it will help). 3. Place the icon you want to use in the same folder with the same name `sketch.ico` (which you might crea...
I would recommend Resource Hacker to change the icon of your programs. 1. Install Resource Hacker (latest build). 2. Go to your executable file. 3. Open it with Resource Hacker (right mouseclick, and there should be an option to do that or else you could just click open with). 4. It will open and show some directories...
27,401
Is there any theoretical or practical limit to the maximum number of passengers - and therefore size - one can build an airplane for?
2016/05/06
[ "https://aviation.stackexchange.com/questions/27401", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/14811/" ]
It is no accident that the biggest birds are flightless. The ability to fly goes down with increasing size, so there is also an upper limit for aircraft. The main reason is that as size increases, masses go up with the cube of the size increase while the load-carrying structures like wing spar cross sections only grow ...
Theoretically, unlimited (well bigger than is practically necessary)... TL;DR Airplanes scale fairly well and it would be *physically* possible to build and airplane of just about any size. Granted there are some things that come into play from a structure standpoint but there are surely ways around that. You may hav...
5,806,943
In my Ruby (1.9.2) Rails (3.0.x) I would like to render a web page as PDF using wicked\_pdf, and I would like to control where the page breaks are. My CSS code to control page breaks is as follows: ``` <style> @media print { h1 {page-break-before:always} } </style> ``` However, when I render the page with ...
2011/04/27
[ "https://Stackoverflow.com/questions/5806943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33890/" ]
Tried Jay's solution but could not get it to work (maybe a conflict with other css) I got it to work with this: ``` <p style='page-break-after:always;'></p> ```
None of these solutions worked for me. I did find a solution that worked for many people in the gem issues here - <https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1524> you want to add CSS on the element that needs the page break. In my case, it was table rows, so I added: ``` tr { page-break-inside: avoid; } ```
1,274,940
So assuming that in our work environment we've decided that the One True Faith forbids this: ``` if (something) doSomething(); ``` And instead we want: ``` if (something) { doSomething(); } ``` Is there a tool that will do that automagically? Awesomest would be to have eclipse just do it, but since we're...
2009/08/13
[ "https://Stackoverflow.com/questions/1274940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/409/" ]
I think you can set this in Eclipse's formatting rules and run the built-in formatter.. e.g. the "Use blocks" option: ![Code Style Tab](https://www.ibm.com/developerworks/library/os-eclipse-clean/CodeStyle.jpg) Of course, you need the rest of the formatting options to be set how you want them, since I don't think yo...
I believe that [GreatCode](http://sourceforge.net/projects/gcgreatcode/) can do this for you (along with a ton of other options)
16,706,622
i need to count/group/select product on base of attribute 'country\_of\_manufacture'. like this > > India => 10, Shrilanka => 5, > > > how can achieve it in magento?
2013/05/23
[ "https://Stackoverflow.com/questions/16706622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/767517/" ]
``` $collection = $this->getLoadedProductCollection() ->addAttributeToSelect('*') ->addExpressionAttributeToSelect('total_country_of_manufacture',"COUNT({{entity_id}})",'entity_id') ->groupByAttribute('country_of_manufacture'); ``` for count ``` Mage::getModel('catalog/product')->getColle...
Instead of using ``` count($collection) ``` you can try ``` $collection->getSelect()->count(); ```
186,080
I submitted an assignment in February and I recently received an email accusing me of academic misconduct. I have just finished my second year of university and this is the first time that I have ever been accused of something this serious. The accusation says that I plagiarised the algorithm from someone else. Howeve...
2022/06/14
[ "https://academia.stackexchange.com/questions/186080", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/157527/" ]
We can’t read folks minds or predict the future, but if everything you say is true, this seems like a case where your defense would be accepted. This is just my opinion as a faculty member. I have served on academic grievance committees but not our misconduct committee. Note here that I agree with Bryan Krause below- ...
These are serious accusations, and if one is considering a career in academia a finding of plagiarism may look bad for some time in your career. I am not familiar with the details in a university setting, so this advice is from experience in other workplaces. 1. Get some help from real people not the internet. I am no...
46,552,571
I'm trying to use auto-generated advancedDataGrid - ADGV ([adgv.codeplex.com](https://adgv.codeplex.com)). Current question is similar to the solved question before: [my previous stackoverflow.com question](https://stackoverflow.com/questions/46513792/adgv-c-sharp-datagridview-update-query-bug/46514435#46514435) I hav...
2017/10/03
[ "https://Stackoverflow.com/questions/46552571", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5519686/" ]
You can also call cell's EndEdit() method. Something like this: ``` this.BeginInvoke((Action)(() => levDGV.CurrentCell.EndEdit())); ```
Found a workaround... It does not answer my question, but works for me. ``` this.BindingContext[levDGV.DataSource].EndCurrentEdit(); //does not call CellLeave currentRowSave(); ```
1,083,683
I get no keyboard feedback on any java application I run with Java 6 (64-bit) on OSX Leopard 10.5.7. It happens with any swing application, or even with eclipse 3.5 64-bit (which is a SWT-cocoa application). Did't find any reference to this problem on the web...
2009/07/05
[ "https://Stackoverflow.com/questions/1083683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54623/" ]
This is a stab in the dark, but do you mean that it should read an existing text file to get the lines of text? ``` #include <string> #include <fstream> #include <iostream> int main() { std::ifstream inputFile("c:\\input.txt"); std::ofstream outputFile("c:\\output.txt"); std::string line; while (std:...
Just use a prefix variable: ``` #include <fstream> using namespace std; ofstream file; string prefix = "1. "; out_file.open("test.txt"); out_file << prefix << "some text" << endl; out_file << prefix << "some other text" << endl; out_file.close(); ``` Or you could write a little convenience function to do this: ...
45,375,164
How do I convert a string like ``` string a = "hello"; ``` to it's bit representation which is stored in a int ``` int b = 0110100001100101011011000110110001101111 ``` here `a` and `b` being equivalent.
2017/07/28
[ "https://Stackoverflow.com/questions/45375164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5536095/" ]
Seems like a daft thing to do, bit I think the following (untested) code should work. ``` #include <string> #include <climits> int foo(std::string const & s) { int result = 0; for (int i = 0; i < std::min(sizeof(int), s.size()); ++i) { result = (result << CHAR_BIT) || s[i]; } return result; } ```
``` int output[CHAR_BIT]; char c; int i; for (i = 0; i < CHAR_BIT; ++i) { output[i] = (c >> i) & 1; } ``` More info in this link: [how to convert a char to binary?](https://stackoverflow.com/questions/4892579/how-to-convert-a-char-to-binary)
17,221,254
I'm attempting to calculate 30 days by multiplying milliseconds however the result continually ends up being a negative number for the value of days\_30 and I'm not sure why. Any suggestions are greatly appreciated! CODE SNIPPET: ``` // check to ensure proper time has elapsed SharedPreferences pref...
2013/06/20
[ "https://Stackoverflow.com/questions/17221254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2493722/" ]
You are multiplying `ints` together, and overflow occurs because [the maximum integer is `2^31 - 1`](http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html#MAX_VALUE). Only after the multiplications does it get converted to a `long`. Cast the first number as a `long`. ``` long days_30 = (long) 1000 * 60 * 60 ...
Just change your multiplication to `long days_30 = 1000L * 60 * 60 * 24 * 30;`
8,937,714
I created a collection by adding items to a Varien\_Data\_Collection collection object. ``` $collection = new Varien_Data_Collection(); foreach($array_of_products as $productId){ $collection->addItem(Mage::getModel('catalog/product')->load($productId)); } ``` However when this object is passed on to Magento p...
2012/01/20
[ "https://Stackoverflow.com/questions/8937714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1002400/" ]
The pager is calling [`setPageSize`](http://docs.magentocommerce.com/Varien/Varien_Data/Varien_Data_Collection.html#setPageSize) on your collection which - if you trace it - is only used by [`getLastPageNumber`](http://docs.magentocommerce.com/Varien/Varien_Data/Varien_Data_Collection.html#getLastPageNumber). This mean...
I just doubt on(may be i am wrong): ``` $collection->addItem(Mage::getModel('catalog/product')->load($productId)); ``` which should be like this: ``` $collection->addItem(Mage::getModel('catalog/product')->load($productId)->getData()); ``` Let me know if that works for you. Thanks **EDIT:** Finally i figured...
81,827
Asking this one for a friend located in the United States. She's currently experiencing significant stress coming directly from her place of employment. All attempts to mediate this with her coworkers and boss have apparently failed and one of the benefits of her employment is a series of free optional visits to a ps...
2016/12/21
[ "https://workplace.stackexchange.com/questions/81827", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/53202/" ]
There would be very little incentive for a psychological professional to violate patient confidentiality, risk getting sued for malpractice and lose his/her license to practice. Most of the time, these professionals are contracted to the company through a third party and do not work exclusively for that company. They...
In such a situation, I would absolutely not trust someone who has ties to the company in question. While the psychiatrist's legal requirement to uphold confidentiality is true, if the psychiatrist violates it, there's no way to prove that. If managers at the company want to fire OP's friend, they can make up any sort o...
61,041,739
I am working with Ag-Grid version 21.1.0 and Angular 8. I am trying row-grouping in ag-grid following the tutorial: <https://www.ag-grid.com/javascript-grid-grouping/> I have a field in my data-model as "Short Name" field and I am trying to group by this field by setting "rowGroup"="true" property of corresponding colu...
2020/04/05
[ "https://Stackoverflow.com/questions/61041739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4449595/" ]
Probably you're using two different python interpreters on your pycharm and on your terminal. Please, * check the python version on the terminal by `python3 --version` * And then go to pycharm -> file -> settings -> project -> project interpreter and check if both python are the same.
```sh sudo easy_install-3.8 pygame ``` (This will install the dependencies.) ```sh sudo pip3 install pygame ```
21,572
En uno de los [translation-golf](/questions/tagged/translation-golf "show questions tagged 'translation-golf'") recientes, era necesario traducir la típica locución inglesa «*nothing but*», que normalmente se traduce como «nada excepto» o «nada salvo». Sin embargo, [una de las respuestas](https://spanish.stackexchange...
2017/07/22
[ "https://spanish.stackexchange.com/questions/21572", "https://spanish.stackexchange.com", "https://spanish.stackexchange.com/users/-1/" ]
Yo interpreto que es un adjetivo. Está afinando el significado de "nosotros" para asegurar que son todos los posibles. "Todo" como adverbio es un caso menos frecuente, como en: "Soy todo oídos" Aquí puedes ver una explicación muy detallada de las diferentes posibilidades. <http://zonaele.com/todo-toda-todos-y-todas/...
A primera vista me parece un pronombre. Del mismo modo que puede haber un doble determinante, como en "todos los participantes", al omitir el sustantivo y usar pronombres ninguno de los dos debería ser "privilegiado" como para ser uno pronombre y otro adjetivo. Lo cierto es que es complicado decidir.
8,662,436
I got confused on `volatile` for reference type . I understand that for primitive type, `volatile` can reflect value changes from another thread immediately. For reference type, it can reflect the address changes immediately. However, what about the content of the object. Are they still cached? (Assuming `List.Add()`...
2011/12/28
[ "https://Stackoverflow.com/questions/8662436", "https://Stackoverflow.com", "https://Stackoverflow.com/users/299230/" ]
> > I understand that for primitive type, volatile can reflect value changes from another thread immediately > > > You understand incorrectly in at least three ways. You should not attempt to use volatile until you deeply understand *everything* about weak memory models, acquire and release semantics, and how they...
Look at <http://www.albahari.com/threading/part4.aspx#_The_volatile_keyword> for a good explanation about what volatile actually does and how it impacts fields. The entire part of threading on that site is a must read anyway, it contains huge amounts of useful information that have proved very useful for me when I was...
133,571
> > Consider the real function $f$ defined on the real line $\mathbb{R}$ by $f(x)=x^2$. If $b$ is a given positive real number, show that the restriction of $f$ to the closed interval $[0,b]$ is uniformly continuous by starting with an $e\gt 0$ and exhibiting a $d\gt 0$ which satisfies the requirement of the definitio...
2012/04/18
[ "https://math.stackexchange.com/questions/133571", "https://math.stackexchange.com", "https://math.stackexchange.com/users/29386/" ]
A better way to prove this fact comes in the form of the following theorem. > > **Theorem.** Let $K \subseteq \mathbb{R}^N$ compact, and $f:K \to \mathbb{R}$ continuous. Then $f$ is uniformly continuous. > > > **Proof.** Let $\epsilon > 0$ be given. By continuity of $f$, for every $x\_0 \in K$ choose $\delta(x\_0)$...
If a continuous function f satisfies the property $|f(x\_1)-f(x\_2)|\le M|x\_1-x\_2|$ is said to be Lipschitz with constant $M$, and $f$ must be uniformly continuous as in this case you will get $\delta=\frac{\epsilon}{M}$ all the time which will allow your continuous function to be uniformly continuous. For your funct...
27,526,146
I am getting this error: ![enter image description here](https://i.stack.imgur.com/02jMx.jpg) I have installed ADT and SDK using install new software in Eclipse. I am using `Eclipse Java EE IDE for Web Developers. Version: Kepler Service Release 2`. I used this link <https://dl-ssl.google.com/android/eclipse/> I do ...
2014/12/17
[ "https://Stackoverflow.com/questions/27526146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1650891/" ]
> > I do not know where the SDK is getting installed as it being done through Eclipse. > > > Not if you installed the ADT plugin separately. You need to [download and install the Android SDK](http://developer.android.com/sdk/index.html#Other) (see "SDK Tools Only"), then teach the ADT plugin where you installed i...
I have deleted folder .android in my user folder (c:/users/xyz/.android) and relaunched Eclipse - dialog box "Android SDK installation" (not exact name) has came up - then install of SDK.
6,303,648
I need HTML parser for PHP that can use CSS selectors to select elements, in Java we have jsuop. Is there such a library for PHP?
2011/06/10
[ "https://Stackoverflow.com/questions/6303648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/159793/" ]
Try [phpQuery](http://code.google.com/p/phpquery/); it uses CSS-style selection similar to jQuery, which by the sound of your description is similar to jsoup.
I use this one: <http://simplehtmldom.sourceforge.net/>
43,920,739
I have this problem with image displaying. Image should display on **top** of the card, but it keeps displaying on *bottom*. ``` $(document).ready(function() { $("li:first").click(function () { $(".card").show(); $(".card").append('<img class="card-img-top" src=' + (filmi.Movies[0].Poster) + '/>') ``` Even...
2017/05/11
[ "https://Stackoverflow.com/questions/43920739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7231441/" ]
You just need to update the `src` attribute: ``` $("li:first").click(function () { $($(".card").find('.card-img-top')).attr('src',filmi.Movies[0].Poster) $(".card").show(); }); ``` ### Working fiddle: <https://jsfiddle.net/x3jem2fb/2/> **Final Update, working sample for all the movies:** > > **The...
Modify your javascript to use **prepend()** rather than **append()** *Append()* will append the element **after** the previous element whereas *prepend()* does the opposite. ``` $("li:first").click(function () { $(".card").prepend('<img class="card-img-top" src=' + (filmi.Movies[0].Poster) + '/>'); $(".car...
70,151,308
How to check which number is a power in this array? `arr = [16, 32, 72, 96]` output: `[16, 32]` because `16 = 4^2` and `32 = 2^5` It's not a solution about power of 2, it's about power of n. This is my actual code : ```js let array1 = [16, 32, 72]; function findPowofNum(array1) { // var result = []; if (arr...
2021/11/29
[ "https://Stackoverflow.com/questions/70151308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17016390/" ]
You can use a custom boolean function to iterate through the elements and append to an empty array as you check like this.. ``` function isPowerofTwo(n){ return (Math.ceil((Math.log(n) / Math.log(2)))) == (Math.floor(((Math.log(n) / Math.log(2))))); } let arr= [16, 32, 72, 96]; let values=[] for(let...
I think it is 2^4 not 4^2 and what I believe is you want to check if the number is and root of 2 or not Solution ``` let arr=[16,32,72,96]; let i=1; for(i=1;i<=10;i++){ // this loop will run up to 2^10 let k=Math.pow(2,i);if(k==arr[i-1]){ //do whatever you want to do with the number } } ```
28,666,080
I'm trying to understand how executables can be run after installing a module using the [JSPM](http://jspm.io/). For instance if I run `jspm install gulp`, then I would expect to be able to run the following command: ``` ./jspm_packages/npm/gulp\@3.8.11/bin/gulp.js ``` Actually it would be better if jspm would handl...
2015/02/23
[ "https://Stackoverflow.com/questions/28666080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2316606/" ]
Yes `character_limiter()` function does not work for longer word to prevent word break and/or distort meaning. According to codeigniter documentation, it will not try to break long word to maintain its integrity. As per documentation of [character\_limiter](https://www.codeigniter.com/user_guide/helpers/text_helper.ht...
Try this,it will fix your issue. ``` $this->load->helper('text'); $string = "your text here"; $string = character_limiter($string, 10); echo $string; ``` Output:your text…
17,324,057
I have **textbox** and I'm changing the text inside it when `lostFocus` is fired but that also fires up the `textChanged` event, which I'm handling but I don't want it to be fired in this one case, how can I disable it here? UPDATE: ------- The idea with `bool` is good but I have couple of textboxes and I use the sam...
2013/06/26
[ "https://Stackoverflow.com/questions/17324057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2296407/" ]
I feel.. We can do this in Best way and easy way..! ``` //My textbox value will be set from other methods txtNetPayAmount.Text = "Ravindra.pc"; //I wanted to avoide this to travel in my complex logic in TextChanged private void txtNetPayAmount_TextChanged(object sender, EventArgs e) { _strLoanPaym...
I think you could also simply use the "IsFocused" bool built into the UI. ``` private void mytextbox_TextChanged(object sender, TextChangedEventArgs e) { TextBox textbox = sender as TextBox; if (!textbox.IsLoaded || !textbox.IsFocused) return; if(textbox.Text.ToString().Contains('.')) { ...
1,135,208
Context ------- I have a personal server that I use for the web. I sometimes need to SSH/SFTP to it. Disclamer: I have very little experience with `nginx` internals. Problem ------- This morning, I figured out that the free wifi in a well-know cafe chain was blocking SSH (actually, they are blocking anything that'...
2016/10/08
[ "https://superuser.com/questions/1135208", "https://superuser.com", "https://superuser.com/users/622051/" ]
This question is slightly related to another one I've answered a while ago: <https://stackoverflow.com/questions/34741571/nginx-tcp-forwarding-based-on-hostname/34958192#34958192> Yes, it is technically possible to differentiate between `ssh` and `https` traffic, and route the connection appropriately; however, nginx...
As far as I know, currently nginx doesn't support it. In [SSH-2](https://www.rfc-editor.org/rfc/rfc4253), client will send a hello message to server: > > When the connection has been established, both sides MUST send an identification string. This identification string MUST be > > > > ``` > SSH-protoversion-soft...
24,910,972
I am using serial port communication, there is a `DataReceived` Event of Serial Port, in which if the header & footer of received data matches I am executing 2 complex & lengthy functions, here I have used circular buffer for data receive, Out of the 2 functions first function updates a Graph (Area Chart) of 2058 byt...
2014/07/23
[ "https://Stackoverflow.com/questions/24910972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3837157/" ]
I have managed it successfully with timers and background worker synchronization. The only important thing I noted is you need a good processor, at least 'core - i3'. The solutions proposed by Mr.SKleanthous is also acceptable. Thanks. And thanks Mr. Andreas Müller, yes I got your point. Thank you so much everyb...
You can use 1-5 for complex work (as those are intended for this scenario). You could use 6 to inject your results into the graph, because the purpose of Dispatcher.Invoke is processing work in the UI-Thread and is required for the majority of controls. I hope that helps.
40,975,934
I want to change background image of a div, depending on what image is currently hovered by mouse. I want to create a gallery, so I have a list of images. I want to display the exact same url dynamically (hovered thumbnail) as hovered as a background of the main div (hero image). ``` <div id="background"> <ul> ...
2016/12/05
[ "https://Stackoverflow.com/questions/40975934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7142790/" ]
My first try ``` $('ul img').on('hover', function(e){ $('#background').css('background-image','url('+ $(this).attr('src')+')'); }); ``` Or if you have problems with selectors ``` $('body').on('hover','ul img', function(e){ $('#background').css('background-image','url('+ $(this).attr('src')+')'); }); ``...
Try this ``` $("ul li").on({ mouseenter: function () { $('#background').css('background-image', $(this).attr('src')); //stuff to do on mouse enter }, mouseleave: function () { $('#background').css('background-image', 'default.png'); //stuff to do on mouse leave } }); `...
60,378,861
I want to know if there is any possibility to add on an Azure DevOps(TFS) dashboard the start time of the tests. Currently I have a pie chart with all the test runned over night,(passed, fail and not run) and I want to know if there is any possibility to add the time when the test were executed on this dashboard. Th...
2020/02/24
[ "https://Stackoverflow.com/questions/60378861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3664679/" ]
Use `return words.some(...)` instead of `forEach`. Returning in a `forEach` doesn't do anything for the result of the function passed to the `filter`. The return in the `forEach` just returns from one iteration of the `forEach` and the `true`/`false` value is thrown away. It does not return a result immediately to the...
The reason is that you used `startswith()` function which checks if the word starts with the given string which obviously `name` does not start with `ame`. Whereas `James` starts with `ja` and `name` starts with `nam` The `includes()` function just checks if the word contains the given string no matter where it is.
52,782,751
I have a Cordova app using Vue.js, and lots of logging using the standard Javascript/browser console.log(). Up until now I've only been targeting iOS, and those console.log messages appear in the xCode log viewer. Now, however, I'm also targeting Android. I've successfully imported the Cordova project into Android Stu...
2018/10/12
[ "https://Stackoverflow.com/questions/52782751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2943799/" ]
I finally resolved this. I had to enable Developer Options in settings and enable USB Debugging.
If you're not seeing console.log in LogCat, ensure your application is debuggable. This will be true for apps run from Android Studio (I think) but if you're debugging a 3rd party APK like I am, it won't. Maybe this will save someone the 3 hours I wasted on it. So ensure `android:debuggable="true"` is there in the `ap...
3,762
I've been fiddling around a bit with CC-mode lately and figured that since I prefer to comment my functions/classes with javadoc-like syntax, I'd like to use the built-in comment highlighting provided by the corresponding `c-doc-comment-style`. This works rather well, it highlights something like this rather easily: `...
2014/11/20
[ "https://emacs.stackexchange.com/questions/3762", "https://emacs.stackexchange.com", "https://emacs.stackexchange.com/users/2653/" ]
After fiddling a bit longer with this, I think I figured it out. Adding the following snippet to my CC-mode init-configuration fixed this: ``` (defun my-cc-init-hook () "Initialization hook for CC-mode runs before any other hooks." (setq c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) ...
You can just add the mapping to the comment style list: ``` (add-to-list 'c-doc-comment-style '(c++-mode . javadoc)) ``` This is more portable and just extends the list instead of replacing it.
12,074,745
Working with Node.js(monogdb, express and other modules) I'm wondering if there is a mongoose method for database connection, something like if I open a connection `var db = mongoose.connect('mongo://localhost/members');` then I can `db.on('close', function(){ /*do stuffs here*/})`. Basicly, the function below does th...
2012/08/22
[ "https://Stackoverflow.com/questions/12074745", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1326868/" ]
I am sorry to bear bad news, but look here: [Prevent IIS from changing response when Location header is present](https://stackoverflow.com/questions/10594225/prevent-iis-from-changing-response-when-location-header-is-present) > > Edit: Never did find an answer - I ended up switching to Apache > > > And it seems ...
To circumvent this IIS behavior, you can use an outbound rewrite rule. The following will look for status 201, and if so, eliminate all the content lines up to and including the closing body tag: ``` <outboundRules> <rule name="Remove injected 201 content" preCondition="Status 201"> <match filterByTags="None" pa...
5,675,346
Think this is a quickie for someone. I have this markup (generated by ASP.Net)... ``` <A id=anchorO href="javascript:__doPostBack('anchorO','')">O</A> ``` This anchor is in an update panel, and if I click it manually a partial postback takes place. However.... ``` $('[ID$="anchor'+initial+'"]').click() //JavaScri...
2011/04/15
[ "https://Stackoverflow.com/questions/5675346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/395628/" ]
A click and a href are seen as two different things in Javascript, so you can't do `.click()` and call the href, regardless if this is calling `javascript:` or not **Two options:** 1. Just do: > > > ``` > $('#anchor' + initial).click(function() { __doPostBack('anchorO',''); }); > > ``` > > 2. Be evil and use eva...
See this question [here](https://stackoverflow.com/questions/1694595/can-i-call-jquery-click-to-follow-an-a-link-if-i-havent-bound-an-event-handl) It appears that you can't follow the href of an a tag using the click event.
36,905,398
I have implemented this code. <http://www.androidbegin.com/tutorial/android-video-streaming-videoview-tutorial/> but it showing progressdialog to whole activity, but my requirement is to show progressDialog only in videoview, like wise showing in youtube when buffering the video.
2016/04/28
[ "https://Stackoverflow.com/questions/36905398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4068788/" ]
Your code seems to be more or less based on an idea [which is presented at gis.stackexchange.com](https://gis.stackexchange.com/questions/25877/how-to-generate-random-locations-nearby-my-location/) and discussed some more there in [this discussion](https://gis.stackexchange.com/questions/69328/generate-random-locatio...
Longitude and Latitude uses ellipsoidal coordinates so for big radius (hundred meters) the error using this method would become sinificant. A possible trick is to convert to Cartesian coordinates, do the radius randomization and then transform back again to ellipsoidal coordinates for the long-lat. I have tested this u...
46,487,261
One nice feature of DataFrames is that it can store columns with different types and it can "auto-recognise" them, e.g.: ``` using DataFrames, DataStructures df1 = wsv""" parName region forType value vol AL broadL_highF 3.3055628012 vol AL con_highF 2.1360975151 vol ...
2017/09/29
[ "https://Stackoverflow.com/questions/46487261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1586860/" ]
``` mat2df(mat) = DataFrame([[mat[2:end,i]...] for i in 1:size(mat,2)], Symbol.(mat[1,:])) ``` Seems to work and is faster than @dan-getz's answer (at least for this data matrix) :) ``` using DataFrames, BenchmarkTools dataMatrix = [ "parName" "region" "forType" "value"; "vol" "AL" ...
While I didn't find a complete solution, a partial one is to try to convert the individual columns ex-post: ``` """ convertDf!(df) Try to convert each column of the converted df from Any to In64, Float64 or String (in that order). """ function convertDf!(df) for c in names(df) try df[c] ...
6,650
My next task is creating a robotic voice that gives information to the main character. One idea I had was to create an effect much like when a cell phone is breaking up and the voice gets all choppy and digitally distorted. It's kind of hard to explain, but it is what happens when a cell phone is about to disconnect o...
2011/03/18
[ "https://sound.stackexchange.com/questions/6650", "https://sound.stackexchange.com", "https://sound.stackexchange.com/users/18160/" ]
If you have Waves, try the "reflective room" preset on MetaFlanger - my go to when I don't want TOO much effect to distort the actual words (I'm using it on a Kid's show where the dialog needs to be clear). You can also try the Morphoder for the classic "Cylon" effect (The "Robbie" preset is a good start). Finally, if ...
Not exactly along the telephone idea, but definitely a robot-voice go-to, [Sonic Charge's BitSpeek](http://www.soniccharge.com/bitspeek) is an awesome tool and very affordable!
23,042
The Gospel of John describes a scene where John the Baptist saw Jesus coming toward him and he made the following statement: > > “Look, the Lamb of God, who takes away the sin of the world! This is > the one I meant when I said, ‘A man who comes after me has surpassed > me because he was before me.’ I myself did no...
2016/06/23
[ "https://hermeneutics.stackexchange.com/questions/23042", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/8352/" ]
According to the [*Diatessaron* of Tatian](https://www.ccel.org/ccel/schaff/anf09.iv.iii.i.html) - probably the earliest harmony of the Gospels, dating to the late 2nd century - and the [Eusebian Canon](http://earlyenglishbibles.com/specialbibles/UseCanon.html) (early 4th century) the sequence in the Gospels is as foll...
From John passage on this in his First Epistle, I would say you are right. This was at a later date. **6) This is He that came by water and blood, even Jesus Christ; not by water only, but water and blood. And it is the Spirit that beareth witness, because the Spirit is Truth. 7) For there are Three that bear record i...
2,574
The various cultures of the Ancient Near East spoke a wide array of languages and we know that there was plenty of communication between cultures. We even have a language like Akkadian that served as a lingua franca between many different cultures. Diplomats, and others, must have received training in foreign languages...
2012/07/12
[ "https://history.stackexchange.com/questions/2574", "https://history.stackexchange.com", "https://history.stackexchange.com/users/1092/" ]
The [Barbary Pirates](http://en.wikipedia.org/wiki/Barbary_corsairs) raided as far north as Iceland and Scotland to capture slaves. While still Caucasian, North Africans typically have darker skin than northern Europeans.
Fair skinned people are oppressed and lower classes in most fair skinned societies and nations. I'm born Australian and was born in the late 60s. Before multiculuralism took off in the 80s and 90s nearly all of the manual, dirty, dangerous and unpleasant jobs in our society were performed by white people. Most of the ...
11,120,395
I usually use a boolean 'firstTime' like this: in C++: ``` bool firsTime = true; for (int i = 0; i < v.size(); i++) { if (firstTime) { //do something just once firstTime = false; } else { //do the usual thing } } ``` in java it would be the same using a boolean instead a bool...
2012/06/20
[ "https://Stackoverflow.com/questions/11120395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1468942/" ]
If you don't have a count already, you can use one instead of a boolean ``` long counter = 0; for(String arg: args) { if(counter++ == 0) { // first } } ``` An alternative which uses a boolean is ``` boolean first = true; for(String arg: args) { if(first && !(first = false)) { // first ...
``` for (int i = 0, firstTime = 1; i < v.size(); i++, firstTime = 0) { ```
2,159,516
This is a similar problem to [this question](https://stackoverflow.com/questions/688819/deploy-a-linq-to-sql-library-using-different-sql-users) When I deployed my dev app to the prod server I was getting an error: System.Data.SqlClient.SqlException: Invalid object name 'dbo.Login'. The table attribute on the linq ma...
2010/01/29
[ "https://Stackoverflow.com/questions/2159516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/55693/" ]
It sounds like you have have identical tables named differently in your different environments. The simplest way to fix your problem is to use identical schema for all environments (the data can be different, but you are asking for all kinds of problems if the schema is not the same). EDIT: With your further clarific...
If you're using a single schema (i.e. not multiple schemas in a single db), you can just remove the schema prefix on your tables. E.g. change: ``` <Table Name="dbo.person" Member="Persons"> ``` To: ``` <Table Name="person" Member="Persons"> ```
15,664,505
I have Jackrabbit 2.4.0 (deployed as rar into a JBoss AS 7.1.0) on a Red Hat 6 64-bit machine. The JBoss JVM has the max heap size set to 8 GB. The machine has 24GB of RAM. The curious thing is when the JBoss is started it has almost 20 GB of virtual size (statistic taken from top). The Linux page cache (swap cache) is...
2013/03/27
[ "https://Stackoverflow.com/questions/15664505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1517754/" ]
> > My question is: does Lucene use memory mapping for indexes files? > > > Lucene uses memory mapping only [if you ask](http://lucene.apache.org/core/4_2_0/core/org/apache/lucene/store/MMapDirectory.html) for it. You might also want to read [this](http://blog.thetaphi.de/2012/07/use-lucenes-mmapdirectory-on-64bit...
JBOSS total resident memory is comprised of several factors, not all of which are heap: 1. Heap 2. Perm gen 3. JARs and JVM 4. Mapped byte arrays 5. Thread stacks (~1MB per thread) There's your application and the app server itself. So certainly you should profile using something like Visual VM to see the details o...
39,659,777
How can I delete rows of table with eloquent and where ? My code is wrong? the code doesn't work! ``` Mode::where('expired','<=',Carbon::now()->toDateString())->delete(); ```
2016/09/23
[ "https://Stackoverflow.com/questions/39659777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4363830/" ]
Check if `Carbon::now()->toDateString()` format matches with the format of 'expired' column
If your expired timestamp is in format of `Y-m-d H:i:s` then you can use `toDateTimeString()` in place of `toDateString()` You can use ``` Mode::where('expired','<=',Carbon::now()->toDateTimeString())->delete(); ```
5,019,743
Is there a way to insert a horizontal line after a certain number of rows, which may be variable depending upon a property in data provider of a datagrid? Thanks.
2011/02/16
[ "https://Stackoverflow.com/questions/5019743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503510/" ]
In fact, in Java the term **constant** has no defined meaning. It occurs in the JLS only in the larger term **compile time constant expression**, which is an expression which can (and must) be calculated by the compiler instead of at runtime. (And the keyword `const` is reserved to allow compilers to give better error ...
Immutability of the object means it can't transform it's state... i.e. can't mutate... For examle ``` final class Person { private int age = 0; public Person(int age) { this.age = age; } } ``` The object to this type are immutable objects since you can't change it's state.... (forget Reflection for a moment) ...
59,592,356
I have a list of lists and I want to remove all the duplicates so that the similar lists will not appear at all in the new list. ``` k = [[1, 2], [4], [5, 6, 2], [1, 2], [3], [4]] output == [[5,6,2], [3]] ``` So for example, `[1,2]` have a duplicate so it should not appear in the final list at all. This is differen...
2020/01/04
[ "https://Stackoverflow.com/questions/59592356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5433663/" ]
As mentioned in the [firestore issue ticket](https://github.com/flutter/flutter/issues/35670#issuecomment-593422250), fixing the version of the firebase core to 0.4.4 instead of using 0.4.4+2 fixed the issue: ``` dependency_overrides: firebase_core: 0.4.4 ``` Add this along with your existing `firebase_auth` depen...
I found the solution just comment or import and put this code below it should look like this ``` #import "FLTFirebaseCorePlugin.h" // #import "UserAgent.h" // Generated file, do not edit #define LIBRARY_VERSION @"0.4.4-2" #define LIBRARY_NAME @"flutter-fire-core" ```
28,636
I was analyzing the following position for one of the correspondence games that I am playing. In the position, white is up 2 pawns and with my limited understanding, I can't see any real compensation for black. I checked with Stockfish 10 at depth 29 and it evaluated the position as +0.63. I also checked with Komodo 13...
2020/02/24
[ "https://chess.stackexchange.com/questions/28636", "https://chess.stackexchange.com", "https://chess.stackexchange.com/users/21014/" ]
First of all, white's pieces don't have much mobility. The B has one legal move, the queen's rook also only has one move, the king's rook only has four moves and none of them are particularly good. The king is kind of in the way. White is going to have to spend some time coordinating his pieces. Second, black has the...
When you get those results from an engine that shows the game is essentially even while you see a two pawn difference then that means you do not fully understand the value of positions. Black has the two bishops. With Bg4 he will control the file his rook is on and finish his mobilization. White will have problems...
21,507,967
I understand the meaning of this error. I found many similar questions here at stackoverflow.com and I have tried to implement the answers those were suggested but still I am getting this error. What I am trying to do is using php web service I am extracting the data from mysql database server and trying to display it ...
2014/02/02
[ "https://Stackoverflow.com/questions/21507967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2773586/" ]
This type of error will come if your main thread doing so much work. Basically skip frames will happen maximum time when we test our app in emulator, because its already slow and unable to handle huge operation like a device. I saw a simple problem in your code. We know onPostExecute() runs on MainThread, But still yo...
I'm sorry this is not a super informed answer, but I have 2 suggestions. First, eliminate the `runOnUiThread` call, because `onPostExecute` already runs on the ui thread (that is the point of the method). That will not help with any frame skipping, but at least you can get rid of some unneeded code. Second, create the...
1,608,102
Let's say I generate $6$ numbers: $X\_1, \ldots, X\_6$ where $X\_i$ can be any integer between $1$ and $59$ with equal probability (inclusive). For example, the following could have been randomly generated: $$1, 2, 3, 4, 5, 59$$ $$1, 1, 2, 3, 4, 59$$ $$\text{etc}\ldots$$ What is the chance that $1,2,3$ is a subse...
2016/01/11
[ "https://math.stackexchange.com/questions/1608102", "https://math.stackexchange.com", "https://math.stackexchange.com/users/303622/" ]
It should be the latter. By Apollonius Theorem we have, $c^2+b^2=2(BD^2+AD^2)$ Given $a^2=4BD^2<2(AD^2+BD^2)$ So, $c^2+b^2-a^2>0$ So, $\cos A=\frac{c^2+b^2-a^2}{2bc}>0$ So, $ \angle A$ is acute
[![enter image description here](https://i.stack.imgur.com/d4hPQ.jpg)](https://i.stack.imgur.com/d4hPQ.jpg) We are given $BD=CD<AD$. Let angle measures $\alpha, \alpha', \beta, \beta'$ be as indicated. By the exterior angle theorem, $m\angle BDA = \alpha + \alpha'$ and $m\angle CDA = \beta + \beta'$. Since $BD < A...
17,751,570
Consider two tables: ``` house_market_changes date | house_id | market_status --------------------------------- 2013-04-03 | 1 | "on" 2013-04-06 | 1 | "under offer" 2013-04-11 | 1 | "off" 2013-04-02 | 2 | "on" ... ``` `house_market_changes` tells us what the house changed...
2013/07/19
[ "https://Stackoverflow.com/questions/17751570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/339681/" ]
No. This conclusion comes from [the task and backstack documentation](http://developer.android.com/guide/components/tasks-and-back-stack.html) as well as the [activity documentation](http://developer.android.com/reference/android/app/Activity.html#finish%28%29) and a general understanding of how a [stack data structure...
No, i don't think that is possible. Once you finish the Activity it's gone. You could, however, implement and handle your own stack. On back pressed, you would just start the closed Activity again.
236,782
I am not able to write this in latex with the subscript p|n (maybe more than one line) under the product and above the product sign also I need something to be written( say k). Moreover it would be helpful if someone tells me how to display this formula in a neat manner. Thanks in Advance. ![enter image description he...
2015/04/04
[ "https://tex.stackexchange.com/questions/236782", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/75585/" ]
The original picture can be reproduced by ``` \documentclass{article} \usepackage{amsmath} \begin{document} \[ \frac{(-1)^{\varphi(n)/2}n^{\varphi(n)}} {\prod_{p\mid n} p^{\varphi(n)/(p-1)}} \] \end{document} ``` ![enter image description here](https://i.stack.imgur.com/r5unE.png) whereas using `\Pi` instead o...
Exchange \Pi for \prod\limits or \displaystyle\prod Also, you might want to use \begin{equation} or \begin{equation\*} instead of [
81,354
What am I? `03/04/19 13:36 UTC` *This is very abundant* *The most that you'll see* *And its group and number* *Is what you will need* *Now somewhat repetetive* *For you who are us* *You may now start the task* *From now, not before* *You use this to move* *Or choose where to go* *How much am ...
2019/04/03
[ "https://puzzling.stackexchange.com/questions/81354", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/48489/" ]
are you > > international phone number such as the one for Indonesia ( Jakarta) +62 21 xxx xxxx > > > This is very abundant The most that you'll see And its group and number Is what you will need > > It is abundant as almost everyone has a phone number. A phone number has "section" / "groups" of numbers. It...
> > This is very abundant > > The most that you'll see > > And its group and > > number Is what you will need > > > Are you > > hydrogen? oxygen? or H20- group and number derived from periodic table of elements? > > >
51,781,093
I would like to know is it possible to return all value for duplicate column with same ID value for oracle sql My table design would below Table A ``` Name ID Order Year ------ ------ ------- ------ JOHN 1 ORD123 2017 JAKE 2 ORD122 2018 JES 2 ORD111 2017...
2018/08/10
[ "https://Stackoverflow.com/questions/51781093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10206985/" ]
You can use an analytic function to do it in a single table scan: [SQL Fiddle](http://sqlfiddle.com/#!4/1b978/3) **Oracle 11g R2 Schema Setup**: ``` CREATE TABLE TableA ( Name, ID, "Order", Year ) AS SELECT 'JOHN', 1, 'ORD123', 2017 FROM DUAL UNION ALL SELECT 'JAKE', 2, 'ORD122', 2018 FROM DUAL UNION ALL SELEC...
Have a sub-query to return id's that exists more than once. ``` select * from tableA where id in (select id from tableA group by id having count(*) > 1) ```
3,072
Why is "to get" sometimes used where "to be" could be used? Is this usage grammatical? Examples: > > * The video got uploaded to the web site. > * The video was uploaded to the web site. > * He got thrown in the pool. > * He was thrown in the pool. > * We got caught! > * We were caught! > > >
2010/09/15
[ "https://english.stackexchange.com/questions/3072", "https://english.stackexchange.com", "https://english.stackexchange.com/users/212/" ]
This usage is *correct*, but *informal*. It is freely used (and extremely common) in less formal kinds of writing and speaking, but is avoided in the most formal forms of writing. As for "why", I don't think there is any explanation other than the fact that get + <past participle> is slowly displacing be + <past parti...
**Both forms (i.e. *be* and *get* forms followed by past participle) are grammatically correct.** > > The video got uploaded to the website > [by a user]. > > > is passive voice. > > In a sentence using active voice, the > subject of the sentence performs the > action expressed in the verb. > [(source)](htt...
7,088,905
When I commit something to SVN, should I update first my local copy, or the merging is automatically done ? In other words, *should I always update before committing*, or can I just commit ?
2011/08/17
[ "https://Stackoverflow.com/questions/7088905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257022/" ]
**Yes you should.** While its not always necessary, it's a good idea to do so. Imagine someone else changes something that wouldn't result in a conflict but has a reaction on your changes. Then, you would check in and the version on the server is not that what you tested. So, before committing, always do an `svn upd...
The merging is done to your working copy. Therefore, you should update first, in order to avoid conflicts. No harm is done, however, if you try to commit. If there are remote conflicting modifications, the commit will remain undone anyway.
17,641,957
I have a PDF File. When I want to encrypt it using codes below the `Length of the data to encrypt is invalid.` error occurred: ``` string inputFile = @"C:\sample.pdf"; string outputFile = @"C:\sample_enc.pdf"; try { using (RijndaelManaged aes = new RijndaelManaged()) { byte[] key = { 0, 1...
2013/07/14
[ "https://Stackoverflow.com/questions/17641957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/822718/" ]
When you use PaddingMode.None you can wrap the ICrytoTransform and handle final block yourself: ``` new CryptoStream(fsCrypt, new NoPaddingTransformWrapper(encryptor), CryptoStreamMode.Write) ``` The following is a wrapper class itself: ``` public class NoPaddingTransformWrapper : ICryptoTransform { private IC...
A (not ideal) solution I have used in this situation is to place the raw length of the plaintext into the first x bytes of data to be encrypted. The length then is encrypted with the rest of the data. When decrypting using the stream you simply read the first x bytes and convert them using the BitConverter class back t...
3,235,679
Note:I don't mean some theoretical question which don't have any implementation just languages that don't have both!!!!! --- These days there exists a c/c++ interpreter(cint) and a python compiler(to python bytecode). I understand that the simplest definition is that a compiler just converts code from language a to ...
2010/07/13
[ "https://Stackoverflow.com/questions/3235679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259130/" ]
The **ladder language** for programmable logic controllers (PLC) has no compiler or interpreter. The ladders are converted into boolean conditions to manage inputs, outputs and memory states. Ladders are evaluated thousands times a second to actually run the code on the hardware. Good luck! Reference: [Programmable l...
One of my classmates can write a complete mic-in to speaker program on an `APPLE ][` by punching all the hex codes after a `CALL -151`. So the answer can probably be: machine code.
44,752
I have a drive that I cannot boot, but it has an installation of Windows XP on it. I need to know what type of XP it has, and MS's solution (<http://support.microsoft.com/kb/310104>) presupposes I can load the OS. Is there a folder or file I can look at that might give me a clue as to the flavor of XP (Home, Pro, MCE, ...
2009/09/21
[ "https://superuser.com/questions/44752", "https://superuser.com", "https://superuser.com/users/-1/" ]
If you are able to boot to the command prompt you can type in: ``` type c:\windows\system32\prodspec.ini ``` and it should show you what version of XP you have installed. Similar to something like this: ``` ; ;Note to user: DO NOT ALTER OR DELETE THIS FILE. ; [SMS Inventory Identification] Version=1.0 [Product Spe...
Start -> Control Panel -> System Under the General tab. The computer I'm on now says: ``` Microsoft Windows XP Professional Version 2002 Service Pack 3 ```
26,796,707
I'm writing a program in C++ that has to use dynamically allocated arrays from various structures (in separate files). A lot of times, I need to initiate these arrays inside of a function. Usually after initiating them, I write data to the array of a structure, or even an array inside of an array of structures, and the...
2014/11/07
[ "https://Stackoverflow.com/questions/26796707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3427023/" ]
Given your newly posted constraints, I think you could just implement a deletion-function to traverse through the `Student` array and do manual cleanup. First, we create a function that deletes the dynamic objects of **one** single student. Note that we could have used `Student&`as the parameter type, but given the in...
**This answer is obsolete since the owner of this questions specified some constraints that do not allow constructors/destructors.** As far as I unterstand your question, you do not know how to delete the actual dynamically allocated `rawScores` and `finalGrad` objects in your `Student` object, right? If so, the answe...
463,811
I'm trying to clone/pull a repository in another PC using Ubuntu Quantal. I have done this on Windows before but I don't know what is the problem on ubuntu. I tried these: ``` git clone file:////pc-name/repo/repository.git git clone file:////192.168.100.18/repo/repository.git git clone file:////user:pass@pc-name/repo/...
2013/01/07
[ "https://serverfault.com/questions/463811", "https://serverfault.com", "https://serverfault.com/users/144709/" ]
It depends on how you have your server configured to serve content. If over ssh: ``` git clone user@192.168.100.18:repo/repository.git ``` or if a webserver is providing the content (http or https) ``` https://user@192.168.100.18/repo/repository.git ``` or if available via a file path: ``` git clone file://pat...
This issue seems similar to <https://stackoverflow.com/questions/5200181/how-to-git-clone-a-repo-in-windows-from-other-pc-within-the-lan>. Perhaps the administrative share helps alleviate the problem (e.g. //pc-name/c$/path/to/repo)
1,783,494
I need a random number generation algorithm that generates a random number for a specific input. But it will generate the same number every time it gets the same input. If this kind of algorithm available in the internet or i have to build one. If exists and any one knows that please let me know. (c, c++ , java, c# or ...
2009/11/23
[ "https://Stackoverflow.com/questions/1783494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/181272/" ]
Usually the standard implementation of random number generator depends on seed value. You can use standard random with seed value set to some hash function of your input. C# example: ``` string input = "Foo"; Random rnd = new Random(input.GetHashCode()); int random = rnd.Next(); ```
How about.. ``` public int getRandonNumber() { // decided by a roll of a dice. Can't get fairer than that! return 4; } ``` Or did you want a random number each time? :-)
4,464,271
I'm trying to programatically download a file in C# via FTP, here is the relevant code (obviously with fake credntials and URI): ``` try { var request = FtpWebRequest.Create("ftp://ftp.mydomain.com/folder/file.zip"); request.Credentials = new NetworkCredential("username", "password"); using (var response ...
2010/12/16
[ "https://Stackoverflow.com/questions/4464271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/545187/" ]
Turns out the FTP root isn't necessarily the same as the URL root. Perhaps I'm mixing up terminology, so let me explain: in my case, connecting to ftp.mydomain.com already starts at /folder, so my URL needed to just be <ftp://ftp.mydomain.com/file.zip>. IE8 knows how to eliminate the redundant /folder part in the origi...
I recently had this problem and after much testing discovered that some module between here and there did not like a mixed case URI and so my resolution was to use .ToLower() on the URI
457,018
I am including a special font for greek, but when I use it, the `\textbf{}` command does not result in bold letters. I have added a `[FakeBold=3]`, but it has no effect. What's the problem? ``` \documentclass[openany]{book} \usepackage{fontspec} \setmainfont[BoldFont={* Semibold},ItalicFont={* Italic},BoldItalicFont=...
2018/10/27
[ "https://tex.stackexchange.com/questions/457018", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/123001/" ]
The solution is simple: you have to declare the bold font. In the code I choose the font by file name as I'm not going to add SBL Greek to my system fonts. ``` \documentclass[openany]{book} \usepackage{fontspec} \newfontfamily\bgkfamily{SBL_grk}[ Path=./, Extension=.ttf, BoldFont=*, BoldFeatures={FakeBold=4}...
``` \documentclass[a4paper, 12pt]{article} \usepackage{amsfonts, amssymb, amsmath, amsthm} \usepackage[no-math]{fontspec} \setmainfont{ModernMTStd-Extended.otf}[ FakeBold=2, Ligatures=TeX, ] \setsansfont[% FakeBold=2, ItalicFont=NewCMSans10-Oblique.otf,% BoldFont=NewCMSans10-Bold.otf,% BoldItalicFont=NewCMSans10-Bol...
8,616,606
I have the current table data: ``` <table> <tr class="Violão"> <td>Violão</td> <td class="td2 8">8</td> </tr> <tr class="Violão"> <td>Violão</td> <td class="td2 23">23</td> </tr> <tr class="Guitarra"> <td>Guitarra</td> <td class="td2 16">16</td> </tr> </table> ``` What I want to do is gr...
2011/12/23
[ "https://Stackoverflow.com/questions/8616606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/542798/" ]
``` // declare an array to hold unique class names var dictionary = []; // Cycle through the table rows $("table tr").each(function() { var thisName = $(this).attr("class"); // Add them to the array if they aren't in it. if ($.inArray(thisName, dictionary) == -1) { dictionary.push(thisName); } ...
First stick and ID on the table and select that first with jQuery as matching an ID is always the most efficient. Then all you need to do is match the class, parse the string to a number and add them up. I've created a simple example for you below <http://jsfiddle.net/Phunky/Vng7F/> But what you didn't make clear is...
22,927,035
I'm trying to send int data via UDP using protobuf. from visual c++ to Java(Android Studio) **proto file**: ``` message rbr { required int32 rpm = 1; required int32 gear = 2; required int32 speed = 3; } ``` **C++ sending:** ``` telemetry.set_rpm(1200); telemetry.set_speed(120); telemetry.set_gear(4); teleme...
2014/04/08
[ "https://Stackoverflow.com/questions/22927035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3505409/" ]
I agree with Ted Hopp. try this : ``` public void saveCheckBoxState(boolean isChecked){ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); SharedPreferences.Editor editor = prefs.edit(); editor.putBoolean("key",isChecked); editor.commit(); } ``` Call ...
You should persist the checkbox state. For example, you can use [SharedPreferences](http://developer.android.com/guide/topics/data/data-storage.html#pref).
5,115,885
Just started to experiment with HTML5 features and really like the localStorage. And now I wonder if it makes sense to create some libraries which make life easier. Something which easily persists objects from the localStorage to the server-DB. Something like a object.findAllByAttribute(Attribute) etc. So my question...
2011/02/25
[ "https://Stackoverflow.com/questions/5115885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/204769/" ]
just found <http://www.javascriptmvc.com/> . Looks interesting, simpler than backbone.js and closer to Rails or Grails. But have to admit that the focus is not the offline feature. But I guess when you already have a model, offline isn't the big problem anymore.
things advanced and it seems that <http://angularjs.org/> is what I was looking for at the time I asked the question. There is also a great talk about using AngularJs together with Grails for creating SPI Applications: <http://skillsmatter.com/podcast/home/developing-spi-applications-using-grails-and-angularjs>
20,656,521
``` select distinct ani_digit, ani_business_line from cta_tq_matrix_exp limit 5 ``` I want to select top five rows from my resultset. if I used above query, getting syntax error.
2013/12/18
[ "https://Stackoverflow.com/questions/20656521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2654334/" ]
You'll need to use `DISTINCT` *before* you select the "top 5": ``` SELECT * FROM (SELECT DISTINCT ani_digit, ani_business_line FROM cta_tq_matrix_exp) A WHERE rownum <= 5 ```
**LIMIT** clause is not available in Oracle. Seeing your query, you seem to be interested only in a certain number of rows (not ordered based on certain column value) and so you can use **ROWNUM** clause to limit the number of rows being returned. ``` select distinct ani_digit, ani_business_line from cta_tq_matrix_e...
27,382,701
I want to change value of global variable within a function with parameters name,value. All examples that ive read was with no parameter function. Example ``` var one = 100; var change = function(name,value){ // name is the name of the global variable //value is the new value }; change(one,300); ```
2014/12/09
[ "https://Stackoverflow.com/questions/27382701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4237507/" ]
Try this. When you pass it as a parameter, pass as string, not the variable. ``` var one = 100; var change = function(name, value) { window[name] = value; }; change('one', 300); console.log(one); ```
All global variable are set on window object. so you can try the following . ``` window[name] = value; ```
92,331
I left my last employer in the UK end of last year, but he still pays me my monthly salary. (It feels like one of these surreal dreams) In march I told them about it and asked how I should deal with it. But even though I addressed it to my CFO and copied in the CEO, the CFO only replied to some other questions in the s...
2017/06/07
[ "https://workplace.stackexchange.com/questions/92331", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/71112/" ]
Verify all of this with an attorney, but I believe it works like this. Take the money and put it in an escrow account. Leave it there until that appropriate statutes run out. Make a sincere effort to return the money, which means keep trying but put a REASONABLE effort into it. Save all of your correspondence as proof...
No, you cannot keep it. At least, not officially. As Nij commented, **do not spend it**. The best you can do in such a situation is to put this money on a 100% safe investment, like savings products without minimum duration. At least you will be able to keep any interests earn when you will have to give the money back....
18,662,669
I have a method like this ``` public static LinkedList<Object> getListObjectWithConditionInXMLFile(String className){ LinkedList<Object> lstObj = new LinkedList<Object>(); if(className.equals("Customer")){ //read Data from XML File Customer customer = ...; lstObj.add(c...
2013/09/06
[ "https://Stackoverflow.com/questions/18662669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2755074/" ]
You can refactor your method to something like this: ``` public static <E> LinkedList<E> getListObjectWithConditionInXMLFile(Class<E> type){ LinkedList<E> lstObj = new LinkedList<E>(); if (type.equals(Customer.class)) { Customer customer = ... lstObj.add((E)customer); } ...
You will have to create new List and add casted object to the new linked list of Customer. ``` LinkedList<Customer> custList = new LinkedList<>(); for(Object obj: getListObjectWithConditionInXMLFile("Customer")) { custList.add((Customer)obj)); } ``` Or, it is better to use generics if possible as mentioned by "Bo...
53,050,451
I have an Xcode 10 - iOS12 swift project that links against My own framework (also Xcode 10 + iOS12). The app project is referencing my framework project as a sub-project reference. My Framework project references PromiseKit.framework (a universal framework - fat library), made using the following build script: ``...
2018/10/29
[ "https://Stackoverflow.com/questions/53050451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1315512/" ]
Same issue here. The only workaround I've found is to use static library instead of framework. In case you are not able to use static library, you'd better file a bug report to Apple.
This is what worked for me, I have application and 2 in-house built frameworks, say **A $ B.** Application needs A, but A needs B and since Apple doesn't recommend nesting frameworks, so both A and B had to be included in the app. This is what my Xcode project looks like. [![structure of the application in Xcode](ht...
1,329
So, when doing LaTeX, it is absolutely necessary for ones sanity to using a preview program which updates automatically every time you compile. Of course, any previewer designed for DVIs will do this, but as far I can tell, Adobe Acrobat not only does not automatically update, but will not let you change the PDF with i...
2009/10/20
[ "https://mathoverflow.net/questions/1329", "https://mathoverflow.net", "https://mathoverflow.net/users/66/" ]
As noted, SumatraPDF is probably the best solution. Alternatively, look for pdfopen and pdfclose which can be set to automatically close the pdf file before you compile the TeX file and then reopen it. They are built into many TeX frontends. Finally, some versions of Reader (e.g., 6) running on some versions of Windows...
Or use a latex editor with a preview window on the right. LEd has this feature. Every time you compile, the preview window updates. Moreover, you can see your code and output in the same screen, which is nice.
62,030
To what extent does the study of history use hypothesis testing? By Hypothesis testing I mean the usage of p-values and significance levels to dictate how an actual event differs from the event by chance; An example where it could be used in history: To evaluate the change in attitudes of female politicians since law...
2020/11/29
[ "https://history.stackexchange.com/questions/62030", "https://history.stackexchange.com", "https://history.stackexchange.com/users/32011/" ]
It seems to me, you mixed two control methods. One, the practical-level method, is statistics. Yes, it is used, alas, very often, without the understanding of the tool. Historians are seldom good at maths, and the Theory of Probability is one of its most demanding areas. It is known, that even people with good math bac...
Yes, of course. Suppose archaeologists are excavating a region. On average,they find n pottery shards per hectare. At one dig they count 5n pottery shards. They ask themselves "What are the likelihood of finding 5n pottery shards at a random dig?" Since they have estimated the parameters of the pottery shards distribut...
170,664
Am hesitant to ask yet one more embarrassing question, but I can't seem to see the problem with the `\foreach` in the MWE. It should produce several horizontal lines but only produces the one with the `yValue` as specified in the `\newcommand{\yValue}{0.3}`: ![enter image description here](https://i.stack.imgur.com/yy...
2014/04/10
[ "https://tex.stackexchange.com/questions/170664", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/4301/" ]
According to pages 470-471 of the [`pgfplots` documentation](http://texdoc.net/texmf-dist/doc/latex/pgfplots/pgfplots.pdf): (*Note:* in `pgfplots` documentation v1.17, the page range has changed to 544-545.) > > Keep in mind that inside of an axis environment, all loop constructions (including custom loops, `\foreac...
I ran into a similar problem and the answers above didn't work for me. However, I realized that you often want to use `foreach` *inside* an `axis` environment because you want to have access to the `axis cs` coordinate system. I came up with the following workaround which I show here for the original MWE: ``` \documen...
17,458,261
I have an `Activity` with multiple `Fragment`s. I want to show a `DialogFragment` or open another `Fragment` from one of the `Fragment`s. I know that an `Activity` should be the one tasked with opening `Fragment`s so instead I have tried a couple things. **FIRST** I tried to use `getActivity()` and cast it so I can...
2013/07/03
[ "https://Stackoverflow.com/questions/17458261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1215222/" ]
Personally I would say that fragments should be thought as reusable and modular components. So in order to provide this re-usability, fragments shouldn't know much about their parent activities. But in return activities must know about fragments they are holding. So, the first option should never be considered in my ...
Have you tried something like this (from the Fragment): ``` FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction(); Fragment prev = getActivity().getSupportFragmentManager().findFragmentByTag("some_name"); if (prev != null) { ft.remove(prev); } ft.addToBackStack(null); Dia...
6,510,649
I have an image that I upload with a HTTP Post method to my webserver written in PHP. My code compresses a bitmap to a jpeg coded byte array and sends that Base64 encoded to the server which decodes, writes it to a file and opens it as a jpg image. Index.php: ``` <?php $base=$_REQUEST['image']; echo $base; // base64 ...
2011/06/28
[ "https://Stackoverflow.com/questions/6510649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798314/" ]
Every time you refresh the page, it's going to write data to that `test.jpg` file. If you don't submit a base64 image, it'll just write out a blank/null string, which means a 0-byte file. Instead, try this: ``` <?php if (isset($_REQUEST['image'])) { ... your decoding/fopen/fwrite stuff here ... } header('Conten...
Answering question 2: No, it is not safe. You should really probably sign it or outright encrypt it in transit to ensure you can trust the data you get -- it's either yours, or garbage. Check out [`mcrypt()`](http://us2.php.net/manual/en/book.mcrypt.php) for more info on that.
4,854,264
I am getting the following error when trying to send an email message where I give the 'To' parameter a tuple of email addresses. ``` > TypeError: sequence item 0: expected > string, tuple found ``` I have looked at the Django documentation for the [EmailMessage class](http://docs.djangoproject.com/en/dev/topics/ema...
2011/01/31
[ "https://Stackoverflow.com/questions/4854264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/330013/" ]
To generate unique ids for objects you could use the aptly named **ObjectIDGenerator** that we conveniently provide for you: <http://msdn.microsoft.com/en-us/library/system.runtime.serialization.objectidgenerator.aspx> Note that, as the comment points out, the object id generator keeps a reference to the object alive...
Do you need the identifier to be unique across all objects or just within a specific type? You have a couple of options: 1. If you aren't overriding `Object.GetHashCode()`, this will give you a *pretty* (but not 100%) reliable identifier. Note, though, that (per the docs), this is not *guaranteed* to be unique. Your...
19,966,126
Let me explain. I am not looking for a particular attribute of a particular DOM element. I started thinking that if I checked the `background-color` of the **body** element, I would find the background color of a page. But for example for this site: [performance bikes](http://www.performancebike.com/bikes/Product_100...
2013/11/13
[ "https://Stackoverflow.com/questions/19966126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1196150/" ]
What about something like this? Not perfect, but should return you the element with the biggest area and make sure that it is visible. Won't account for it being below other elements, but it's a start... ``` var element={ width:0, height:0, color:'', jQEl:{} } $('*:visible').each(function(){ var ...
Another nice solution is to use browser plug-ins. I use Eye Dropper for chrome. <https://chrome.google.com/webstore/detail/eye-dropper/hmdcmlfkchdmnmnmheododdhjedfccka?hl=en> Or you can use colorPicker for Firefox. To get it, in your firefox browser, goto: Tools -> Add-ons -> top right search bar look for "colorPick...
6,370,318
``` $(document).ready(function () { //Store the sub types StoreSubTypes(); //Set up company Type on Change $("#option").change(CompanyTypeOnChange); $(".status").change(InsuranceTypeChange); ...
2011/06/16
[ "https://Stackoverflow.com/questions/6370318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798992/" ]
Have a look at libpd (Pure Data for embedded applications) <http://download.puredata.info/libpd> (the library has been released very recently, but the code is very mature indeed) <http://createdigitalmusic.com/2010/10/libpd-put-pure-data-in-your-app-on-an-iphone-or-android-and-everywhere-free/>
Audio is often problematic and it is pretty much always a good idea to write your own high-level API that does exactly what you want to do (and nothing else) and to assume you will then be writing a thin layer between it and whatever audio library you are using underneath. If you're lucky and there's a library availabl...
83,200
I'm having issues with a site that has recently moved to a new host. The hosting company say it's not their issue but I'm a bit stuck for ideas. i'm not quite sure how to post a full set of logs here but any help is appreciated! ``` Invalid method Mage_Catalog_Block_Product_View::_isSecure(Array ( ) ) Trace: #0 /var...
2015/09/15
[ "https://magento.stackexchange.com/questions/83200", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/31166/" ]
The `_isSecure` call was introduced in Magento CE 1.9.2.0. * [view.phtml](https://github.com/bragento/magento-core/blob/1.9.2.0/app/design/frontend/base/default/template/catalog/product/view.phtml#L42) * [Mage\_Core\_Block\_Abstract](https://github.com/bragento/magento-core/blob/1.9.2.0/app/code/core/Mage/Core/Block/A...
I assume you understand the error? ``` Invalid method Mage_Catalog_Block_Product_View::_isSecure() ``` The class `Mage_Catalog_Block_Product_View` doesn't have a method `_isSecure`. Therefore it seems like magento creates the wrong object somewhere and calls a method which doesn't exist. Did you change the base te...
36,169,123
My assignment is to convert binary to decimal in a JLabel array without using pre-written methods (there's no user input). I have the right idea but for some reason the output is always a little bit off. I've gone through it countless times but I can't find anything wrong with my algorithm and I'm very confused as to w...
2016/03/23
[ "https://Stackoverflow.com/questions/36169123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6102002/" ]
You are following the binary number from left to right but are grabbing the wrong digit. You want the same digit but to multiply by the right power of two - first index being +n\*128 and not +n\*1 ``` int count = 0; for(int i = 0; i < bits.length; i++) { count += Integer.parseInt(bits[i].getText()) * Math.pow(2, b...
Obviously there is a bug in your snippet. You set the digit[x], but not set the digit[length - 1 - x]. for example, x = 0, you set the digit[0], but not set digit[7]. So there will be an error when you want use the digit[length - 1 -x] here : ``` count= count + digit[digit.length - 1 - x] * (int)(Math.pow(2, x)); ...
139,434
I am working as a TA for a seminar course and class presentations are considered a significant part of the total mark for the course. Some of the students in the class — who mostly happen to be international students — do not perform the best presentation in terms of the communications of ideas with the audience. It ...
2019/11/02
[ "https://academia.stackexchange.com/questions/139434", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/-1/" ]
There are two ways to interpret the issue that is being raised. One is that the people simply have accents and not completely correct grammar in spoken English... but not to the point that it seriously impedes intelligibility. The other is that their English is so poor that it does greatly impede intelligibility. The ...
Some decades ago, my professor summarized it roughly like this: * The professional vocabulary **must** be right. * The grammar **should** be right, but errors are acceptable if they don't affect meaning. * The pronunciation is **optional**. The goal was to train students to write acceptable papers, and to understand ...
22,992,149
With all the chatter going on about the heartbleed bug, it's hard to find information on what exactly the exploited heartbeat extension for OpenSSL is used for. Also, is it possible to disable it for Apache w/ mod\_ssl without recompling with the `-DOPENSSL_NO_HEARTBEATS` flag as suggested @ <http://heartbleed.com/>?
2014/04/10
[ "https://Stackoverflow.com/questions/22992149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2891365/" ]
Heartbeat is an echo functionality where either side (client or server) requests that a number of bytes of data that it sends to the other side be echoed back. The idea appears to be that this can be used as a keep-alive feature, with the echo functionality presumably meant to allow verifying that both ends continue to...
Try this for info on heart beats: <http://www.troyhunt.com/2014/04/everything-you-need-to-know-about.html> I'm not really an apache guy, I gather that the flag works but that there may be a performance hit. The advice is to recompile. Also talk to your devs about sending emails, you may want to consider asking your us...
72,247
Due to misplaced keys, we are going to either rekey or replace an old lock on our front door. The manufacturer was Barrows, which seems to be somewhat rare since our local hardware doesn't carry blanks for new keys. We would replace it only if it is feasible replace only the approx 1" diameter cylinder on the deadbol...
2015/08/22
[ "https://diy.stackexchange.com/questions/72247", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/41735/" ]
Lockpicking is tremendously sensitive to the accuracy of manufacture. A good-quality cylinder really is more secure than a cheap equivalent. (There are good-quality second-source cylinders, but don't expect to find them in a $3 lock set.) Degree and kind of protection from brute-force attacks varies; that's a lot of w...
Number of pins and turns of the tumbler. Some tumblers can turn twice. I'm not sure how they work exactly but I'm assured that they are more difficult to pick. In any case, most burglars who find the front door locked will enter in via a window as they are often easier to open.
6,109,833
I have a 2D space with objects, each object has coordinate vector and an array of vertexes relative to his coordinate, now I need an efficiency way of storing the objects, this store should be able to add and remove objects, also the most important part is the collision detection: I want to get a list of objects which...
2011/05/24
[ "https://Stackoverflow.com/questions/6109833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/620029/" ]
you could use a [quadtree](http://en.wikipedia.org/wiki/Quadtree) for this to check all the nearby objects.
You want to use a spatial index or a quadtree. A quadtree can be simple a space-filling-curve (sfc) or a hilbert curve. A sfc reduce the 2d complexity to a 1d complexity and is used in many maps applications or heat maps. A sfc can be used to store a zipcode search, too. You want to search for Nick's hilbert curve quad...
36,324
**NOTE:** The *Question has been updated*. View *Edit Revisions* to view original question. The scenario. An animal charity that at the moment, track their establishment's costs via a spreadsheet like so: [*broken image link removed*] **1NF:** The above table is already in 1NF because it abides to the definition of...
2013/03/10
[ "https://dba.stackexchange.com/questions/36324", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/20381/" ]
Yes, it's in 1NF. You can't side-step the often hard work of determining *all* the candidate keys by hanging a number off the end of the table and saying, "There. I've got a primary key." One natural candidate key for this table is {Name, Bought from, Date bought}. Consider using "Time bought" instead of "Date bought"...
First, it looks to me like you are building an accounting database. Let me just advise you to reconsider or look at existing open source dbs out there (I maintain LedgerSMB for example). Secondly regarding normalization, you need extra tables. You should break off what you bought and who you bought it from into other...
63,697,495
I am on Windows 10 and I have WSL2 enabled. When I do `docker pull ubuntu` followed by `docker run ubuntu`, a new ubuntu container with a randomly generated name shows up in my dashboard and it starts for half a second, but then immediately stops. If I press the start button the same behaviour is observed. I tried runn...
2020/09/02
[ "https://Stackoverflow.com/questions/63697495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4900292/" ]
You can easily reuse a `String` in a loop by creating it outside the loop and `clear`ing it after using the contents: ``` // Use Kevin's suggestion not to make a new `SmallRng` each time: let mut rng_iter = rand::rngs::SmallRng::from_entropy().sample_iter(rand::distributions::Alphanumeric); let mut...
I (MakotoE) benchmarked Kevin Reid's answer, and it seems their method is faster though memory allocation seems to be the same. Benchmarking time-wise: ``` #[cfg(test)] mod tests { extern crate test; use test::Bencher; use super::*; #[bench] fn bench_write_random_lines0(b: &mut Bencher) { ...
31,176,675
I have a string like this: ``` [{\"ID\":2,\"Text\":\"Capital Good\"},{\"ID\":3,\"Text\":\"General Office Items\"},{\"ID\":1,\"Text\":\"Raw Material Purchase\"}]&@[{\"ID\":2,\"Text\":\"Capital Good\"},{\"ID\":3,\"Text\":\"General Office Items\"},{\"ID\":1,\"Text\":\"Raw Material Purchase\"},{\"ID\":0,\"Text\":\"Approve...
2015/07/02
[ "https://Stackoverflow.com/questions/31176675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4985048/" ]
``` [{\"ID\":2,\"Text\":\"Capital Good\"},{\"ID\":3,\"Text\":\"General Office Items\"},{\"ID\":1,\"Text\":\"Raw Material Purchase\"}] //&@ [{\"ID\":2,\"Text\":\"Capital Good\"},{\"ID\":3,\"Text\":\"General Office Items\"},{\"ID\":1,\"Text\":\"Raw Material Purchase\"},{\"ID\":0,\"Text\":\"Approved\"},{\"ID\":1,\"Text\...
You need regex something like `String mySpitedStr[] = myStr.split("&|@");`
7,093,028
I'm having some problems with exercise 35 in "Learn python the hard way". ``` def bear_room(): print "There is a bear here." print "The bear has a bunch of honey." print "The fat bear is in front of another door." print "How are you going to move the bear?" bear_moved = False while True: ...
2011/08/17
[ "https://Stackoverflow.com/questions/7093028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/898631/" ]
`while` loop executes its body while the boolean condition is true. `TRUE` is always true so it is an infinite loop.
> > a) I don't understand why the While activates. In line 6 we write that the bear\_moved condition is False. So if it's False, and While activates when it's True, it shouldn't activate! > > > while True just means loop indefinitely until a break. Each time the while loop starts, it checks if True is True (and i...
14,482,170
I have a listview with custom adapter which displays names from the contacts . currently its displaying them as > > Rohit > > Rahul > > .... > > > I want it to be like > > 1. Rohit > 2. Rahul > .... > > > i.e, number should be appended automatically . I tried doing that using a count variable in...
2013/01/23
[ "https://Stackoverflow.com/questions/14482170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1662342/" ]
try ``` name = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME)); contactName.setText(cursor.getPosition() + ". " + name); ```
Maybe try :`long count = cursor.getPosition();`
50,713,291
I am having a little issue with my positioning of my buttons in my android app. Bascially if you look at the image below I have three buttons. I want the buttons positioned as they are except with the 'Players 2' button displayed smack bang middle of the screen. I tried setting layout\_parentcenter but this had no ...
2018/06/06
[ "https://Stackoverflow.com/questions/50713291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7740272/" ]
Make your button\_players2 in center of the vertical and put button\_players1 above button\_players2. button\_players1,button\_players2 and button\_how\_to\_play will be in center of the screen. Try to paste below code. ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://s...
You can take group of buttons and wrap it in relativelayout and make that relative layout parent center or vertical and horizontal center ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xml...
22,653,320
Below code gives me outupt as name xxxxx. while as per documentation session\_write\_close closes the session. Kindly help me understanding this. ``` session_start(); $_SESSION['name'] = "xxxxx"; session_write_close(); print_r($_SESSION); ```
2014/03/26
[ "https://Stackoverflow.com/questions/22653320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2715041/" ]
``` session_write_close != session-destroy ``` *Definition*: > > End the current session and store session data. Session data is usually stored after your script terminated without the need to call session\_write\_close(), but as session data is locked to prevent concurrent writes only one script may operate on a ...
Other answers mentioned you by [**session\_destroy()**](http://www.php.net/manual/en/function.session-destroy.php) to destroy the session, but note it does not **unset any of the global variables associated with the session**, or unset the session cookie. You have to use the below: ``` // Unset all of the session va...
42,250,222
I'm using the Windows 10 Home operating system. I have installed Docker toolbox. I have created a docker image of my .net core application by using following command. ``` $ docker build -t helloWorld:core . ``` Now I want to ship this image, to another machine. But I am not getting the image file. Can someone ple...
2017/02/15
[ "https://Stackoverflow.com/questions/42250222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3990660/" ]
1. By using the `docker info` command. 2. In the result - check for **Docker Root Dir** This folder will conatins images, containers, ... [![enter image description here](https://i.stack.imgur.com/oh00c.png)](https://i.stack.imgur.com/oh00c.png)
you can use below command to export your image and can copy same to linux / another machine docker export [OPTIONS] CONTAINER example: ``` docker export --output="latest.tar" red_panda ```
388,435
According to the accepted answer on "*[Rationale to prefer local variables over instance variables?](https://softwareengineering.stackexchange.com/questions/388052/rationale-to-prefer-local-variables-over-instance-variables)*", variables should live in the smallest scope possible. Simplify the problem into my interp...
2019/03/12
[ "https://softwareengineering.stackexchange.com/questions/388435", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/248528/" ]
I would say no, because you should read "smallest scope possible" as "among existing scopes or ones that are reasonable to add". Otherwise it would imply that you should create artificial scopes (e.g. gratuitous `{}` blocks in C-like languages) just to ensure that a variable's scope does not extend beyond the last inte...
Referring to just your title: absolutely, if a variable is unnecessary it should be deleted. But “unnecessary” doesn’t mean that an equivalent program can be written without using the variable, otherwise we’d be told that we should write everything in binary. The most common kind of unnecessary variable is an unused ...
1,816,573
If mysql record with condition exists-update it,else create new record
2009/11/29
[ "https://Stackoverflow.com/questions/1816573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/182671/" ]
Is this what you're looking for? ``` INSERT INTO table (a,b,c) VALUES (1,2,3) ON DUPLICATE KEY UPDATE c=c+1; ``` <http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html>
You can use the `REPLACE INTO` for that with the syntax of `INSERT INTO`. This way MySQL will invoke an `UPDATE` whenever there's a fictive constraint violation. Be aware that this construct is MySQL-specific, so your query ain't going to work whenever you switch from DB.
6,083,465
What's wrong with this SQL statement: ``` ALTER TABLE `tbl_issue` ADD CONSTRAINT `FK_issue_requester` FOREIGN KEY (`requester_id`) REFERENCES `tbl_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT; ``` I have tables called tbl\_issue and tbl\_user within a database called trackstar\_dev. phpMyAdmin said: ``` #...
2011/05/21
[ "https://Stackoverflow.com/questions/6083465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/600873/" ]
The most common reason for this error is that the foreign key constraint have the same name as in another table. Foreign keys' names must be unique in the database (not just on table level). Do you have `requester_id` in another table in your database?
you will get this message if you're trying to add a `constraint` with a name that's already used somewhere else, c you will get this message if you're trying to add a constraint with a name that's already used somewhere else . change it and it will be ok :)
33,785,305
I am trying to make a conditional statement with two "ifs", and it works when I input the correct thing, but when I input an incorrect pokemon and a correct level it still works. I am pretty sure that one of the conditions in my while statement is always true (the first part). Here is the code (sorry about the formatti...
2015/11/18
[ "https://Stackoverflow.com/questions/33785305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5568470/" ]
Pokeman will always be either not X or not Y, it's basic logic since if it's X, then not-Y is true. If it's Y, then not-X is true. If it's neither then **both** will be true. Change `||` to `&&` and think through your logic on paper.
Should be: ``` while ((!(Pokemon.equalsIgnoreCase(Pikachu)) && !(Pokemon.equalsIgnoreCase(Charmander)) && !(Pokemon.equalsIgnoreCase(Squirtle)) && !(Pokemon.equalsIgnoreCase(Bulbasaur))) && !((Level <= 15)&&(Level >= 1 ))) ```
95,828
For a given $n \ge 5$ create every $n$-by-$n$ matrix containing exactly four $1$'s strictly below the diagonal and $0$'s elsewhere.
2015/09/30
[ "https://mathematica.stackexchange.com/questions/95828", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/34197/" ]
``` indices = Flatten[Table[{i, j}, {i, 2, 5}, {j, 1, i - 1}], 1]; allarrays = SparseArray[# -> 1, 5] & /@ Subsets[indices, {4}]; ``` The code generates 210 such matrices (see `Length@allarrays`). Here is a sample of one of them: ``` allarrays[[3]] // Normal (* Out: {{0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {1, 1, 0, 0,...
Eh, what the heck... With `RandomSample` and `ReplacePart`: ``` With[{ss = Subsets[Flatten@ MapIndexed[Range[#1, #2 + #1 - 1] &, Range[6, 21, 5]], {4}]}, Partition[ReplacePart[ConstantArray[0, 25], Thread[# -> 1]], 5] & /@ ss] ``` And... ``` MatrixForm/@% ``` [![enter image description here](https://i.stack.img...
35,844,830
I would like to put a new empty value in my combo ``` <select name="myCombo" id="myCombo"> <option value="1">option5</option>; <option value="2">option4</option>; <option value="3">option3</option>; <option value="4">Other</option>; </select> ``` jquery: ``` $('[name=myCombo]').val(''); ``` doe...
2016/03/07
[ "https://Stackoverflow.com/questions/35844830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5212118/" ]
I think you are looking for this ``` $('#myCombo option:selected').val(''); ```
If I understand, you want to had an option in your select box with an empty value ? Like this ? ``` <select name="myCombo" id="myCombo"> <option value="">-- no value --</option> <option value="1">option5</option> <option value="2">option4</option> <option value="3">option3</option> <option value="4...
78,689
The Problem ----------- Right now, if a post is edited 10 times by its author, it will be automatically converted to CW ([Source](https://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts/11741#11741)). I think that this is flawed logic, and should be removed. The Argument ------------ I'd argue t...
2011/02/09
[ "https://meta.stackexchange.com/questions/78689", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/147370/" ]
I disagree. The current system encourages authors to write high-quality posts the first time around, instead of slapping anything down and editing 50 times to make one typo fix each time. It is quite rare for a post to get ten really substantial edits. For the purposes of this post, I'm defining a "substantial edit" a...
The only strong rationale I can see for caring about multiple edits on one's own post is that it could be bump abuse. Answers that talk about how many edits are or are not excessive are statements of opinion that really should not be brought to bear on how another person chooses to edit their posts. If I want to edit ...