qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
67,821,806
I have the following code: ``` handleFile(files) { var file = files[0]; var reader = new FileReader(); var dataSet; reader.onload = function(file) { var arrayBuffer = reader.result; var byteArray = new Uint8Array(arrayBuffer); var kb = byteArray.length / 1024; var mb = kb / ...
2021/06/03
[ "https://Stackoverflow.com/questions/67821806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3703783/" ]
I may stand corrected here, but I don't think the TCPDF barcode API can embed logos into QR codes. I recommend using the [endroid/qr-code](https://github.com/endroid/qr-code) library. Build your QR code as per the examples, then embed the result into your PDF using a base 64 encoded data URI, something like this ``` ...
If you have the GD library (which it looks like you do), roll your own logo/qr combo using [getBarcodePNGData()](https://tcpdf.org/docs/srcdoc/TCPDF/classes-TCPDF2DBarcode/#method_%getBarcodePNGData), and applying your logo on top of it using [imagecopymerge](https://www.php.net/manual/en/function.imagecopymerge.php) ...
67,821,806
I have the following code: ``` handleFile(files) { var file = files[0]; var reader = new FileReader(); var dataSet; reader.onload = function(file) { var arrayBuffer = reader.result; var byteArray = new Uint8Array(arrayBuffer); var kb = byteArray.length / 1024; var mb = kb / ...
2021/06/03
[ "https://Stackoverflow.com/questions/67821806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3703783/" ]
I may stand corrected here, but I don't think the TCPDF barcode API can embed logos into QR codes. I recommend using the [endroid/qr-code](https://github.com/endroid/qr-code) library. Build your QR code as per the examples, then embed the result into your PDF using a base 64 encoded data URI, something like this ``` ...
If you use `endroid/qr-code` library as "Prof" suggest above you can also use `$pdf->Image` from data stream: ``` // Render to data as string $data = $qr->getString(); // The '@' character is used to indicate that follows an image data stream and not an image file name $pdf->Image('@'.$data); ```
24,592,310
I am having an issue on OS X Maverick when trying to install the rmagick gem. Following are some details ImageMagic details ``` mairs-MacBook-Pro:social-login-in-rails umair$ convert --version Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-07-06 http://www.imagemagick.org Copyright: Copyright (C) 1999-2014 ImageMagick ...
2014/07/06
[ "https://Stackoverflow.com/questions/24592310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/842782/" ]
For anyone having issues with this on OSX Sierra with homebrew installing imagemagick version 7+ You need to install version 6 of imagemagick in order for rmagick to work properly. These 3 commands worked for me. Install the version 6 of imagemagick and then force it to link. bundle installing rmagick should work prop...
I had the exact same problem, and running these on the command line fixed it (using mac): ``` $ brew uninstall pkg-config $ brew install pkg-config $ brew unlink pkg-config && brew link pkg-config ```
24,592,310
I am having an issue on OS X Maverick when trying to install the rmagick gem. Following are some details ImageMagic details ``` mairs-MacBook-Pro:social-login-in-rails umair$ convert --version Version: ImageMagick 6.8.9-1 Q16 x86_64 2014-07-06 http://www.imagemagick.org Copyright: Copyright (C) 1999-2014 ImageMagick ...
2014/07/06
[ "https://Stackoverflow.com/questions/24592310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/842782/" ]
For anyone having issues with this on OSX Sierra with homebrew installing imagemagick version 7+ You need to install version 6 of imagemagick in order for rmagick to work properly. These 3 commands worked for me. Install the version 6 of imagemagick and then force it to link. bundle installing rmagick should work prop...
For a clean install of `imagemagick@6` required for `rmagic 2.16` you need to run: ``` $ brew uninstall imagemagick $ brew install imagemagick@6 && brew link imagemagic@6 --force $ brew install pkg-config ``` Then you yould be able to run `bundle install` without issues.
20,999,167
I'm trying to deal with it all day but I can't find out how to parse my table items.. I have table: ``` <table> <tbody> <tr> <td> <img title="this is img which I need also" /> </td> <td> <div> TEXT WHICH I NEED <div> <d...
2014/01/08
[ "https://Stackoverflow.com/questions/20999167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2904134/" ]
I corrected your html example unless you'll say it wasnt an error ! Then based on that, we have: * Only one `img` tag, so we can directly search for it and get the title `$table->find('img',0)->title` * All the other wanted texts are withing a `div` tag, so we can search for all divs, then, using a loop, print their ...
This worked for me: ``` $inbox = imap_open($hostname,$username,$password) or die('Cannot connect: ' . imap_last_error()); $emails = imap_search($inbox,'ALL'); if($emails) { foreach($emails as $email_number) { $message = base64_decode(imap_fetchbody($inbox, $email_number, 1)); $html = new ...
261,512
I hope everyone had a great start to the New Year! I want to create a `NumberLinePlot`. Naturally, I have tried to utilise `NumberLinePlot`, but it did not serve my purpose as the duplicate values would present themselves as a single point. 1. I want to stack duplicate values; 2. and I want to use `Callout` to label ...
2022/01/03
[ "https://mathematica.stackexchange.com/questions/261512", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/18696/" ]
You may use[`SplitBy`](https://reference.wolfram.com/language/ref/SplitBy.html), [`MapIndexed`](https://reference.wolfram.com/language/ref/MapIndexed.html), and [`MapAt`](https://reference.wolfram.com/language/ref/MapAt.html). With ``` data = {1000, 5000, 5000, 5000, 4000, 3344, 2500, 2500} ``` then ``` ListPlot[ ...
``` data = {1000, 5000, 5000, 5000, 4000, 3344, 2500, 2500}; pts = Table[{First@#, i}, {i, 1, Length@#}]~ Join~{Callout[{First@#, Length@#}, First@#, Above]} & /@ Split@data // Catenate; ListPlot[pts, Axes -> {True, False}] ``` ![Mathematica graphics](https://i.stack.imgur.com/onMuF.png)
261,512
I hope everyone had a great start to the New Year! I want to create a `NumberLinePlot`. Naturally, I have tried to utilise `NumberLinePlot`, but it did not serve my purpose as the duplicate values would present themselves as a single point. 1. I want to stack duplicate values; 2. and I want to use `Callout` to label ...
2022/01/03
[ "https://mathematica.stackexchange.com/questions/261512", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/18696/" ]
``` data = {1000, 5000, 5000, 5000, 4000, 3344, 2500, 2500}; pts = Table[{First@#, i}, {i, 1, Length@#}]~ Join~{Callout[{First@#, Length@#}, First@#, Above]} & /@ Split@data // Catenate; ListPlot[pts, Axes -> {True, False}] ``` ![Mathematica graphics](https://i.stack.imgur.com/onMuF.png)
A way to add `Callout` labels to `NumberLinePlot`: Pre-process input data to add `Tooltip`s and post-process `NumberLinePlot` output to replace tooltips with callout labels: ``` raggedTranspose = Join[## & @@ Map[List, #, {-1}], 2] &; addTooltips = MapAt[List @* Tooltip, #, {All, -1}] &; preProcess = ReplaceAll[Tool...
261,512
I hope everyone had a great start to the New Year! I want to create a `NumberLinePlot`. Naturally, I have tried to utilise `NumberLinePlot`, but it did not serve my purpose as the duplicate values would present themselves as a single point. 1. I want to stack duplicate values; 2. and I want to use `Callout` to label ...
2022/01/03
[ "https://mathematica.stackexchange.com/questions/261512", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/18696/" ]
You may use[`SplitBy`](https://reference.wolfram.com/language/ref/SplitBy.html), [`MapIndexed`](https://reference.wolfram.com/language/ref/MapIndexed.html), and [`MapAt`](https://reference.wolfram.com/language/ref/MapAt.html). With ``` data = {1000, 5000, 5000, 5000, 4000, 3344, 2500, 2500} ``` then ``` ListPlot[ ...
A way to add `Callout` labels to `NumberLinePlot`: Pre-process input data to add `Tooltip`s and post-process `NumberLinePlot` output to replace tooltips with callout labels: ``` raggedTranspose = Join[## & @@ Map[List, #, {-1}], 2] &; addTooltips = MapAt[List @* Tooltip, #, {All, -1}] &; preProcess = ReplaceAll[Tool...
16,958,237
I'm have XML data in the shape of String and i want to convert it to XML document in order to make some process in it, and i'm using the following method to make that: ``` private Document convert(String xml) throws ParserConfigurationException, SAXException, IOException { // convert String into I...
2013/06/06
[ "https://Stackoverflow.com/questions/16958237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638739/" ]
I think it makes much more sense to stub this at a service level with Jasmine spies, as you suggested. You're unit testing the controller at this point, not the service -- the exact way in which an http request is made should not be a concern for this test. You can do something in your spec like this: ``` var Users =...
The best thing you can do is make a fake resource with the methods that were suppose to be called: ``` var queryResponse = ['mary', 'joseph'], Users = function() { this.query = function() { return queryResponse; }, scope, HomeCtrl; }; beforeEach(inject(function($rootScope, $controller) { scope...
16,958,237
I'm have XML data in the shape of String and i want to convert it to XML document in order to make some process in it, and i'm using the following method to make that: ``` private Document convert(String xml) throws ParserConfigurationException, SAXException, IOException { // convert String into I...
2013/06/06
[ "https://Stackoverflow.com/questions/16958237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638739/" ]
I think it makes much more sense to stub this at a service level with Jasmine spies, as you suggested. You're unit testing the controller at this point, not the service -- the exact way in which an http request is made should not be a concern for this test. You can do something in your spec like this: ``` var Users =...
I'm a newbie at this stuff. I've been writing my tests using coffeescript using a dsl, but I've ran into a similar problem today. The way I solved it was by creating a jasmine spy for my resource. Then I created a promise. When the promise is resolved, it will call the 'success' function that you pass in in the control...
16,958,237
I'm have XML data in the shape of String and i want to convert it to XML document in order to make some process in it, and i'm using the following method to make that: ``` private Document convert(String xml) throws ParserConfigurationException, SAXException, IOException { // convert String into I...
2013/06/06
[ "https://Stackoverflow.com/questions/16958237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1638739/" ]
The best thing you can do is make a fake resource with the methods that were suppose to be called: ``` var queryResponse = ['mary', 'joseph'], Users = function() { this.query = function() { return queryResponse; }, scope, HomeCtrl; }; beforeEach(inject(function($rootScope, $controller) { scope...
I'm a newbie at this stuff. I've been writing my tests using coffeescript using a dsl, but I've ran into a similar problem today. The way I solved it was by creating a jasmine spy for my resource. Then I created a promise. When the promise is resolved, it will call the 'success' function that you pass in in the control...
96,917
I have a Banach Space $X$ and an linear continuous operator $T\colon X\to X$ that has finite rank (i.e. $\dim {T(X)}<\infty$). Then, $I-T$ is injective if and only if $I-T$ is surjective?
2012/01/06
[ "https://math.stackexchange.com/questions/96917", "https://math.stackexchange.com", "https://math.stackexchange.com/users/22448/" ]
If $T$ has finite rank, then $T$ is a compact operator. If $X$ is infinite dimensional, then the spectrum of $T$ is formed by a sequence of eigenvalues converging to zero. One implication goes like this: If $I-T$ is injective, then $1$ is not an eigenvalue of $T$. But the point spectrum of $T$ equals the spectrum o...
Since $T$ is injective, then you write $$T=-\lambda(I-\dfrac{1}{\lambda}T)$$ since $\dfrac{1}{\lambda}T$ is compact then $$I-\dfrac{1}{\lambda}T$$ is invertible and therefore surjective. --- Remember that for $T\colon E\to E$ compact and E banach if $(I-T)$ is inyective then $(I-T)$ is inversible. That's all my work...
15,067,147
I want to apply validation on multiple check boxes but question is how to do it? ``` <?php mysql_connect("localhost","root","thisis"); mysql_select_db("my_database"); if(isset($_GET["q"])) { $my_q = $_GET['q']; $q="select * from subjects where subj_code='$my_q'"; $rs=mysql_query($q); for($i=0;$i<mysql_num_rows($...
2013/02/25
[ "https://Stackoverflow.com/questions/15067147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2099666/" ]
You'll need to go through the wizard once to make your specification file. TO do this import your text file like normal but before you get too deep into the wizard click on the bottom left, the "Advanced..." button. This is where you make your spec file. ![enter image description here](https://i.stack.imgur.com/f22HE....
With the import wizard the downside is that for even the slightest change in file format, you'll have to click through all those steps *yet again* to get the import working. Check out @Remou's answer in [ms Access import table from file in a query](https://stackoverflow.com/questions/3660377/ms-access-import-table-fro...
33,953,289
I have this controller for AngularJS Framework. ``` var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $http) { var locations =[]; var map; var markers = []; $scope.mappa = function(){ map = new google.maps.Map(document.getElementById('map'), { center: {lat: 37.507033, lng:...
2015/11/27
[ "https://Stackoverflow.com/questions/33953289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491092/" ]
I found out how to do this with Predicates. Firstly, I must use the JPA method findAll in my repository : ``` Page<Employee> findAll(Specification<Employee> spec, Pageable pageable); ``` Then, I've created a custom class which implements the **Specification Spring Boot object** : ``` public class EmployeeSpecificat...
It can also be done using specs. It seems a lot more cleaner and correct. Please check this article: <https://blog.tratif.com/2017/11/23/effective-restful-search-api-in-spring/> It also shows how to solve 'join' issues and others. In general you can add filters to query like this (taken from the above link): ``` @Get...
33,953,289
I have this controller for AngularJS Framework. ``` var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $http) { var locations =[]; var map; var markers = []; $scope.mappa = function(){ map = new google.maps.Map(document.getElementById('map'), { center: {lat: 37.507033, lng:...
2015/11/27
[ "https://Stackoverflow.com/questions/33953289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491092/" ]
I found out how to do this with Predicates. Firstly, I must use the JPA method findAll in my repository : ``` Page<Employee> findAll(Specification<Employee> spec, Pageable pageable); ``` Then, I've created a custom class which implements the **Specification Spring Boot object** : ``` public class EmployeeSpecificat...
You can just add a new method in your repository which extends the JpaRepository and write the fields by which you want to filter: ``` public Page<SomeClass> findByNameContaining(String searchString, Pageable pageable); ```
33,953,289
I have this controller for AngularJS Framework. ``` var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $http) { var locations =[]; var map; var markers = []; $scope.mappa = function(){ map = new google.maps.Map(document.getElementById('map'), { center: {lat: 37.507033, lng:...
2015/11/27
[ "https://Stackoverflow.com/questions/33953289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4491092/" ]
It can also be done using specs. It seems a lot more cleaner and correct. Please check this article: <https://blog.tratif.com/2017/11/23/effective-restful-search-api-in-spring/> It also shows how to solve 'join' issues and others. In general you can add filters to query like this (taken from the above link): ``` @Get...
You can just add a new method in your repository which extends the JpaRepository and write the fields by which you want to filter: ``` public Page<SomeClass> findByNameContaining(String searchString, Pageable pageable); ```
32,019,384
My stored procedure is taking too long just to update one column with a value from another column but from a value of a previous row (ordered by an INT and secondly a STR) The code I'm using: ``` DECLARE @ITERg INT; SET @ITERg = 1 WHILE @ITERg < 6131 BEGIN UPDATE Avg14RSI SET Avg14GreenP = (SELECT TOP 1 Avg...
2015/08/14
[ "https://Stackoverflow.com/questions/32019384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4725046/" ]
First off, it looks like you really do have SQL Server 2014. Confusingly, the first SQL Server 2014 release is version number 12.0.2000.8 (SP1 is 12.whatever), which is why you're seeing the 12.\* versions for SSMS and the analysis services. If you're at all unsure, just do a `SELECT @@VERSION` and you'll get the full ...
Turns out the `lag` function to be very useful: ``` UPDATE UpdateTarget SET Avg14GreenP = Displaced FROM (SELECT a.Avg14GreenP, LAG(a.Avg14Green) OVER (PARTITION BY a.Ticker ORDER BY a.[Date]) AS Displaced FROM Avg14RSI a) AS UpdateTarget; ```
151,400
Consider a deterministic finite automaton $M(k) = (Q, Σ, \delta, 0, F)$, with $k ≥ 2$ and $Q = \{0,1,...,k-1\}$ $Σ = \{0,1\}$ $\delta(q,a) = (q+a) \space mod \space k$ $F = \{0\}$ If $L$ is the language recognised by $M(k)$, describe a deterministic finite automaton that recognises the concatenation $L ⋅ L ⋅ L ⋅ L...
2022/05/09
[ "https://cs.stackexchange.com/questions/151400", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/147051/" ]
Looks like a trick question. $L^7 = L$, so you already have a DFA for it. The words in $L$ are those where the symbol $1$ occurs a multiple of $k$ times. If you concatenate seven of them, the total number of $1$ symbols is still a multiple of $k$. So $L^7 \subseteq L$. On the other hand, $\epsilon \in L$, so you have ...
It turns out that the same DFA given for $L$ also accepts the language $L^7$ because $L=L^7$. Note that while a DFA $M$ can accept many strings, it accepts only one language, called the language accepted by $M$, and denoted $L(M)$. It was possible for the given DFA to accept both $L$ and $L^7$ because these two languag...
151,400
Consider a deterministic finite automaton $M(k) = (Q, Σ, \delta, 0, F)$, with $k ≥ 2$ and $Q = \{0,1,...,k-1\}$ $Σ = \{0,1\}$ $\delta(q,a) = (q+a) \space mod \space k$ $F = \{0\}$ If $L$ is the language recognised by $M(k)$, describe a deterministic finite automaton that recognises the concatenation $L ⋅ L ⋅ L ⋅ L...
2022/05/09
[ "https://cs.stackexchange.com/questions/151400", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/147051/" ]
It would be the case that $L = L^i$, for $i \ge 1$ (in your case $i=7$). Say you have a DFA $M\_i$ for $L^i$. We prove that $w$ is accepted by $M\_i$ if and only if $w$ is accepted by $M$. * **If $w$ is accepted by $M\_i$ then $w$ is accepted by $M$.** Observe that once a string is accepted by $M$, $M$ must be at the...
It turns out that the same DFA given for $L$ also accepts the language $L^7$ because $L=L^7$. Note that while a DFA $M$ can accept many strings, it accepts only one language, called the language accepted by $M$, and denoted $L(M)$. It was possible for the given DFA to accept both $L$ and $L^7$ because these two languag...
16,603,697
Can anyone help me explaining in 'easy words' 1. When should I use dependency injection. 2. Why should I use it? ( Should I use it in combination OR not with MVC?) 3. What does in it easy words ? How is it working 4. Is it like creating a factory for recycling your code/scripts? 5. How does it interact and how do I c...
2013/05/17
[ "https://Stackoverflow.com/questions/16603697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1063823/" ]
> > 1 When should I use dependency injection? > > > You should use dependency injection when you want to have control over which dependencies you class/method will use at runtime. The best example of this is when you might want to replace a dependency that accesses a database with one that uses memory for unit tes...
Basically by using dependency injection, you will get rid of static dependencies. E.g. framework or w/e will handle dependencies for you. Its desing pattern used to prevent loose coupling and similar issues. For more detailed info try wiki. Regards Inty
1,620,198
The winform: [![alt text](https://i.stack.imgur.com/gCTWf.png)](https://i.stack.imgur.com/gCTWf.png) The code: ``` using System; using System.Windows.Forms; namespace DemoApp { public partial class Form1 : Form { public Form1() { InitializeComponent(); } privat...
2009/10/25
[ "https://Stackoverflow.com/questions/1620198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191860/" ]
I usually like to do two things differently compared to your code sample: * Instead of creating a coupled dependency between controls, create a value describing the state instead * Collect code that alters the UI state of controls (such as `Visible` and `Enabled`) into one single method, and call that whenever needed....
in Form.Loaded handler set groupBox2.Enabled = Properties.Settings.Default.userproxy;
28,876,630
Is it possible to get data from a memory address that memory leak by other program? Like the below code: ``` struct Person { char *name; int age; int height; int weight; }; struct Person *who = malloc(sizeof(struct Person)); who->name = "STACK"; who->age = 23; who->height = 72; who->weight = 55; ``` ...
2015/03/05
[ "https://Stackoverflow.com/questions/28876630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3132311/" ]
Memory leaks and accessing data from other processes are two unrelated things. Leaking or not, memory is confined by the operating system to a single process. To access other process memory, you need to ask the operating system with specific functions like `ReadProcessMemory()` on windows. Usually it will require ad...
If you don't initialise the memory/structure that 'who' points at it will contain whatever already exists at that memory location, If you use the structure's member variables to examine that memory you most likely will get very strange results as the memory could contain anything. That memory could contain values from ...
3,604,918
I tried to use induction and I got $\displaystyle \sum\_{k=m}^{n+1}\left(\begin{array}{c}n\\ k\end{array}\right)\left(\begin{array}{n}k\\ m\end{array}\right) = \left(\begin{array}{c}n+1\\ m\end{array}\right) 2^{n-1-m}$ So $\displaystyle \sum\_{k=m}^{n+1}\left(\begin{array}{c}n\\ k\end{array}\right)\left(\begin{array}...
2020/04/01
[ "https://math.stackexchange.com/questions/3604918", "https://math.stackexchange.com", "https://math.stackexchange.com/users/764607/" ]
Consider the following scenario: > > You have $n$ numbered, white balls. You want to color $m$ of them blue, and some number of the remaining balls (anywhere form $0$ to $n-m$) red. > > > You could do this by first picking out $k$ balls that will get a color at all, and then from among those choose $m$ to make bl...
Use $${n \choose k}{k \choose m}={n \choose m}{n-m \choose k-m}$$ Then $$S=\sum\_{k=m}^{n}{n \choose k}{k \choose m}= {n \choose m} \sum\_{k=m}^{n} {n-m \choose k-m}= {n \choose m} \sum\_{p=0}^{n-m} {n-m \choose p}={n \choose m} 2^{n-m}$$
3,604,918
I tried to use induction and I got $\displaystyle \sum\_{k=m}^{n+1}\left(\begin{array}{c}n\\ k\end{array}\right)\left(\begin{array}{n}k\\ m\end{array}\right) = \left(\begin{array}{c}n+1\\ m\end{array}\right) 2^{n-1-m}$ So $\displaystyle \sum\_{k=m}^{n+1}\left(\begin{array}{c}n\\ k\end{array}\right)\left(\begin{array}...
2020/04/01
[ "https://math.stackexchange.com/questions/3604918", "https://math.stackexchange.com", "https://math.stackexchange.com/users/764607/" ]
Consider the following scenario: > > You have $n$ numbered, white balls. You want to color $m$ of them blue, and some number of the remaining balls (anywhere form $0$ to $n-m$) red. > > > You could do this by first picking out $k$ balls that will get a color at all, and then from among those choose $m$ to make bl...
If you want to try completing your attempt using induction, try double induction on $m$ and $n$. Both sides of the identity equal $1$ when $n=m$. Now suppose the identity holds for a particular $m$ and for all $n\ge m$. Furthermore, suppose it holds for $m+1$ and a particular $n$. We now show that it also holds for $m+...
28,027,730
Below is a snippet from [FBKVOController](https://github.com/facebook/kvocontroller). ``` _FBKVOInfo *info; { // lookup context in registered infos, taking out a strong reference // only if it exists OSSpinLockLock(&_lock); info = [_infos member:(__bridge id)context]; OSSpinLockUnlock(&_lock);...
2015/01/19
[ "https://Stackoverflow.com/questions/28027730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/544504/" ]
Sometimes I group statements into blocks, too, to simply show a strong linkage. Likely the programmer did it to show the scope of the lock.
There is no advantage to using a compound statement there, as far as I can see. If it was C++ and the lock object was defined within the block and used RAII semantics (where is was automatically unlocked on destruction), it would make sense. However as it stands, it doesn't make sense.
28,027,730
Below is a snippet from [FBKVOController](https://github.com/facebook/kvocontroller). ``` _FBKVOInfo *info; { // lookup context in registered infos, taking out a strong reference // only if it exists OSSpinLockLock(&_lock); info = [_infos member:(__bridge id)context]; OSSpinLockUnlock(&_lock);...
2015/01/19
[ "https://Stackoverflow.com/questions/28027730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/544504/" ]
Sometimes I group statements into blocks, too, to simply show a strong linkage. Likely the programmer did it to show the scope of the lock.
Compound statement is a sequence of statements surrounded by braces, in this construct, parentheses go around the braces. As i can see, in your example parentheses is only for code readability.
49,143,929
I'm really new to programming and my professor wants us to write a dice game. At first, it was working correctly now it keeps repeating the same answer every roll. Please help! ``` import random turns = 0 dice1 = random.randint(1, 6) dice2 = random.randint(1, 6) total = dice1 + dice2 while turns < 4: turns = tu...
2018/03/07
[ "https://Stackoverflow.com/questions/49143929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9454565/" ]
You are not re-rolling dice move the `random.randint` in while loop ``` import random turns = 0 while turns < 4: dice1 = random.randint(1, 6) // dice1 & dice2 should be assigned every iteration dice2 = random.randint(1, 6) total = dice1 + dice2 turns = turns + 1 print("Presss enter to roll.") ...
You'll need to define the dice on each iteration of the loop. As it is currently, the dice are defined once and then reused on each iteration. Your "press enter" input is a little funky as well. You can just put the message in the input method. Here's a working example: ``` import random turns = 0 while turns < 4: ...
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
Of course you can use a router to cut through wood! It's done all the time. But, using a router to cut through wood is typically reserved to a [CNC router](https://en.wikipedia.org/wiki/CNC_wood_router). For humans, a jigsaw would be easier to control.
You can use a router to cut wood, but it's not typically used the same way a jigsaw is. A jigsaw is often used freehand. A router is always used with a jig or pattern, except when doing edge work where the router bit will have a guide bearing, or you'll use a fence.
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
It can be done, but to use a router to cut wood is not optimum. Jigging a router can be more complex and a router will usually cut out a much wider swath and create way more sawdust and wood chips. The router will also cut much slower in thicker materials and has big learning curve issues regarding proper direction of ...
Yes a router can be used to cut right through wood and sometimes it makes sense to do so. It leaves nice clean edges, can cut sharp curves and can follow a template. No I don't think it's a replacement for a jigsaw. A jigsaw is usually used freehand and can successfully be used freehand even under sub-optimal conditio...
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
It can be done, but to use a router to cut wood is not optimum. Jigging a router can be more complex and a router will usually cut out a much wider swath and create way more sawdust and wood chips. The router will also cut much slower in thicker materials and has big learning curve issues regarding proper direction of ...
The router is primarily used in conjunction with fences, jigs, held in place (router table) but hardly ever freehand. A jigsaw is primarily used freehand following some outline, but hardly ever using a jig or held in place. Just because you can doesn't mean you should. Using a router freehand is difficult to control a...
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
The router is primarily used in conjunction with fences, jigs, held in place (router table) but hardly ever freehand. A jigsaw is primarily used freehand following some outline, but hardly ever using a jig or held in place. Just because you can doesn't mean you should. Using a router freehand is difficult to control a...
Yes a router can be used to cut right through wood and sometimes it makes sense to do so. It leaves nice clean edges, can cut sharp curves and can follow a template. No I don't think it's a replacement for a jigsaw. A jigsaw is usually used freehand and can successfully be used freehand even under sub-optimal conditio...
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
Of course you can use a router to cut through wood! It's done all the time. But, using a router to cut through wood is typically reserved to a [CNC router](https://en.wikipedia.org/wiki/CNC_wood_router). For humans, a jigsaw would be easier to control.
The router is primarily used in conjunction with fences, jigs, held in place (router table) but hardly ever freehand. A jigsaw is primarily used freehand following some outline, but hardly ever using a jig or held in place. Just because you can doesn't mean you should. Using a router freehand is difficult to control a...
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
It can be done, but to use a router to cut wood is not optimum. Jigging a router can be more complex and a router will usually cut out a much wider swath and create way more sawdust and wood chips. The router will also cut much slower in thicker materials and has big learning curve issues regarding proper direction of ...
You can use a router to cut wood, but it's not typically used the same way a jigsaw is. A jigsaw is often used freehand. A router is always used with a jig or pattern, except when doing edge work where the router bit will have a guide bearing, or you'll use a fence.
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
You can use a router to cut wood, but it's not typically used the same way a jigsaw is. A jigsaw is often used freehand. A router is always used with a jig or pattern, except when doing edge work where the router bit will have a guide bearing, or you'll use a fence.
Yes a router can be used to cut right through wood and sometimes it makes sense to do so. It leaves nice clean edges, can cut sharp curves and can follow a template. No I don't think it's a replacement for a jigsaw. A jigsaw is usually used freehand and can successfully be used freehand even under sub-optimal conditio...
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
The router is primarily used in conjunction with fences, jigs, held in place (router table) but hardly ever freehand. A jigsaw is primarily used freehand following some outline, but hardly ever using a jig or held in place. Just because you can doesn't mean you should. Using a router freehand is difficult to control a...
You can use a router to cut wood, but it's not typically used the same way a jigsaw is. A jigsaw is often used freehand. A router is always used with a jig or pattern, except when doing edge work where the router bit will have a guide bearing, or you'll use a fence.
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
It's entirely possible, and often reasonable. Without going as far as buying a CNC router (handy, but expensive) simple **jigs** and **sleds** permit cutting precisely circular holes (eat your heart out, jigsaws) and precisely straight edges (like a tablesaw with no need to use a jointer afterwards - indeed, many peopl...
The router is primarily used in conjunction with fences, jigs, held in place (router table) but hardly ever freehand. A jigsaw is primarily used freehand following some outline, but hardly ever using a jig or held in place. Just because you can doesn't mean you should. Using a router freehand is difficult to control a...
106,583
Can one use a router to cut wood in a similar way that a jigsaw would cut wood? What are the upsides and downsides of using a router to cut wood? It seems simple enough, but then again, I've never used either machine. I would think that you could just set the router to a deeper threshold than you usually would, in ord...
2017/01/15
[ "https://diy.stackexchange.com/questions/106583", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/64398/" ]
It's entirely possible, and often reasonable. Without going as far as buying a CNC router (handy, but expensive) simple **jigs** and **sleds** permit cutting precisely circular holes (eat your heart out, jigsaws) and precisely straight edges (like a tablesaw with no need to use a jointer afterwards - indeed, many peopl...
I am using a router to cut out a pattern on dozens of 4' by 8'plywood. It works great but it shreds and is tough going through. I broke a top bearing bit yesterday after 15 minutes. I am going to continue this way for the small area because it will be quicker (and can plunge) than a jigsaw, but based on the advice here...
40
Inspired by [this question](https://literature.stackexchange.com/q/25/90). In many translated works (the first to come to mind are translations by Richard Pevear and the English versions of Isaac Bashevis Singer's writings) there are elements of the original language which is kept, while the bulk of the text is render...
2017/01/18
[ "https://literature.stackexchange.com/questions/40", "https://literature.stackexchange.com", "https://literature.stackexchange.com/users/90/" ]
The purpose of keeping parts of the *source langue* no-translated, or using some variant or dialect of the *target language* for some elements (eg: dialog, a specific character talk, ...), depends on the work, its creators (author, translator), and the languages involved. But, here is some general reasons and uses that...
@yaitloutou has a great answer, but there's three reasons they've miss out on that I'd like to include here: * **To convey a change in language in the original text**: possibly the most famous example of this is Shakespeare's [*Et tu, Brute?*](https://en.wikipedia.org/wiki/Et_tu,_Brute%3F) from *Julius Caesar*. Shakes...
5,985,979
I have no problem with SQL, but I'm finding Linq a little confusing. C#, .NET4, Silverlight, RIA services, Oracle DB (v?), VS2010 running Devart dotConnect 6.10.121. I have a RIA Entity ``` public sealed partial class ProcessLogHdr : Entity { DateTime JobDate; string InterfaceName; int SuccessfulCount; ...
2011/05/13
[ "https://Stackoverflow.com/questions/5985979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476420/" ]
Question was answered in the jQuery forum. Funny, the answer was related to my comments above, and I still didn't think to look at the image files! palm2forehead > > had to go in the jquery mobile css file and remove the references to the "images" directory. IOS doesn't handle directories like normal systems so once ...
It did not solve my issue chaning the path. I had to look up in the mobile.css, i found that the icon were first set with an image, an then moved with classes, i had to set the the full background property on the classes that moved the background image. Like so: ``` .ui-icon-plus { background:#9c9c9c url(icons-18-whi...
5,985,979
I have no problem with SQL, but I'm finding Linq a little confusing. C#, .NET4, Silverlight, RIA services, Oracle DB (v?), VS2010 running Devart dotConnect 6.10.121. I have a RIA Entity ``` public sealed partial class ProcessLogHdr : Entity { DateTime JobDate; string InterfaceName; int SuccessfulCount; ...
2011/05/13
[ "https://Stackoverflow.com/questions/5985979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476420/" ]
Question was answered in the jQuery forum. Funny, the answer was related to my comments above, and I still didn't think to look at the image files! palm2forehead > > had to go in the jquery mobile css file and remove the references to the "images" directory. IOS doesn't handle directories like normal systems so once ...
Put everything (js,css) to www folder along with index.html file, and include file like this `<script src="jquery-mobile-min.js">``, it has solved my problem.
5,985,979
I have no problem with SQL, but I'm finding Linq a little confusing. C#, .NET4, Silverlight, RIA services, Oracle DB (v?), VS2010 running Devart dotConnect 6.10.121. I have a RIA Entity ``` public sealed partial class ProcessLogHdr : Entity { DateTime JobDate; string InterfaceName; int SuccessfulCount; ...
2011/05/13
[ "https://Stackoverflow.com/questions/5985979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476420/" ]
It did not solve my issue chaning the path. I had to look up in the mobile.css, i found that the icon were first set with an image, an then moved with classes, i had to set the the full background property on the classes that moved the background image. Like so: ``` .ui-icon-plus { background:#9c9c9c url(icons-18-whi...
Put everything (js,css) to www folder along with index.html file, and include file like this `<script src="jquery-mobile-min.js">``, it has solved my problem.
566,329
I want to use a bunch of SN754410 chips to control some electromagnetic valves. MCU is ATmega64A running at 3.3V. I'll be using 5V for powering SN754410 (VCC1). According to the datasheets low-level output voltage for 3V operation of AVR chip is 0.6V at max and high-level output voltage is 2.2V at least. At the same ti...
2021/05/21
[ "https://electronics.stackexchange.com/questions/566329", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/184276/" ]
Since the gate driver is there to drive enough current to quickly turn the FET on or off, the R1 of 1kohm seems a bit too large and defeats the purpose of a fast FET control with a gate driver. It might not matter a lot with slow signals if a load is turned on and off at slow rate, but if the load is driven with fast P...
Given that the IXDI602 is a 40V ~2 ohm switch and the FET must be a lower resistance switch, it’s gate resistance will be relatively on the same order of magnitude as the ‘602 . Depending on the path length and parasitic ESL and rise time, you must consider matching the resistance of driver and gate with a small R when...
72,869,161
I have the following query ``` SELECT DISTINCT a.uid AS uid, a.creation_date as creation_date, a.activity_date as activity_date, feature1 as feature1, feature2 as feature2, feature3 as feature3, FROM ( table a INNER JOIN table b ON a.uid=b.uid INNER JOIN table c ON c.uid=a.uid ...
2022/07/05
[ "https://Stackoverflow.com/questions/72869161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18526703/" ]
Here's my solution. I know it can be simplified a lot, but it works for what I need. Feel free to post any modifications. ``` public List<List<Part>> RotatePartList(List<Part> partList, List<List<Part>> rotatedList, int initialCounter = 0, int position = 0, int secondCounter = 1) { List<Part> tempP...
If you don't focus on time complexity (the code will has n\*n recursively), it can be solved using a simple approach like this: ``` PROCEDURE CombinateAttributes(lastIndex, lengthOfList) BEGIN IF lastIndex==-1 BEGIN return END FOR i=lastIndex TO i<lengthOfList BEGIN partList[i].Length, partList[i].Widt...
72,869,161
I have the following query ``` SELECT DISTINCT a.uid AS uid, a.creation_date as creation_date, a.activity_date as activity_date, feature1 as feature1, feature2 as feature2, feature3 as feature3, FROM ( table a INNER JOIN table b ON a.uid=b.uid INNER JOIN table c ON c.uid=a.uid ...
2022/07/05
[ "https://Stackoverflow.com/questions/72869161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18526703/" ]
From what I understand, you only need to extract available widths ans lengths and then enumerate all possible combinations: ```csharp public List<Part> GetPerumatations(IReadOnlyList<Part> parts) { // get all possible distinct length (that are actually the width because you need to swap L&W) var lengths = part...
If you don't focus on time complexity (the code will has n\*n recursively), it can be solved using a simple approach like this: ``` PROCEDURE CombinateAttributes(lastIndex, lengthOfList) BEGIN IF lastIndex==-1 BEGIN return END FOR i=lastIndex TO i<lengthOfList BEGIN partList[i].Length, partList[i].Widt...
72,869,161
I have the following query ``` SELECT DISTINCT a.uid AS uid, a.creation_date as creation_date, a.activity_date as activity_date, feature1 as feature1, feature2 as feature2, feature3 as feature3, FROM ( table a INNER JOIN table b ON a.uid=b.uid INNER JOIN table c ON c.uid=a.uid ...
2022/07/05
[ "https://Stackoverflow.com/questions/72869161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18526703/" ]
Here's my solution. I know it can be simplified a lot, but it works for what I need. Feel free to post any modifications. ``` public List<List<Part>> RotatePartList(List<Part> partList, List<List<Part>> rotatedList, int initialCounter = 0, int position = 0, int secondCounter = 1) { List<Part> tempP...
I will give my solution: With n part you can have 2^n cases, accordingly, let's do it: ```cs for (int i = 0; i < 2^n; i++) { //do something } ``` For each case, you can transpose one or more parts, so by converting int to binary, we get all of those combinations. Example, with 0, binary is `000` (bit length i...
72,869,161
I have the following query ``` SELECT DISTINCT a.uid AS uid, a.creation_date as creation_date, a.activity_date as activity_date, feature1 as feature1, feature2 as feature2, feature3 as feature3, FROM ( table a INNER JOIN table b ON a.uid=b.uid INNER JOIN table c ON c.uid=a.uid ...
2022/07/05
[ "https://Stackoverflow.com/questions/72869161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18526703/" ]
Here's my solution. I know it can be simplified a lot, but it works for what I need. Feel free to post any modifications. ``` public List<List<Part>> RotatePartList(List<Part> partList, List<List<Part>> rotatedList, int initialCounter = 0, int position = 0, int secondCounter = 1) { List<Part> tempP...
From what I understand, you only need to extract available widths ans lengths and then enumerate all possible combinations: ```csharp public List<Part> GetPerumatations(IReadOnlyList<Part> parts) { // get all possible distinct length (that are actually the width because you need to swap L&W) var lengths = part...
72,869,161
I have the following query ``` SELECT DISTINCT a.uid AS uid, a.creation_date as creation_date, a.activity_date as activity_date, feature1 as feature1, feature2 as feature2, feature3 as feature3, FROM ( table a INNER JOIN table b ON a.uid=b.uid INNER JOIN table c ON c.uid=a.uid ...
2022/07/05
[ "https://Stackoverflow.com/questions/72869161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18526703/" ]
From what I understand, you only need to extract available widths ans lengths and then enumerate all possible combinations: ```csharp public List<Part> GetPerumatations(IReadOnlyList<Part> parts) { // get all possible distinct length (that are actually the width because you need to swap L&W) var lengths = part...
I will give my solution: With n part you can have 2^n cases, accordingly, let's do it: ```cs for (int i = 0; i < 2^n; i++) { //do something } ``` For each case, you can transpose one or more parts, so by converting int to binary, we get all of those combinations. Example, with 0, binary is `000` (bit length i...
263,300
Situation: * There is a crack on my bathtub that ants are coming in and out of. The ant traffic seems to increases significantly after a shower. * Immediately above the crack there is what appears to be small gap. [![enter image description here](https://i.stack.imgur.com/MIat4.jpg)](https://i.stack.imgur.com/MIat4.jp...
2022/12/25
[ "https://diy.stackexchange.com/questions/263300", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/144603/" ]
The top one looks like either a manufacturing flaw in the bathtub or a chip during installation. The bottom one is simply a gap that used to be covered by caulk but isn't well covered any more. In both cases, the solution is to caulk the gaps. The big unknowns are: * Is there significant water damage in the wall due ...
The repair would be expensive and time consuming. You would need to replace the tub and remove at least part of the tile to check for damage. The easiest solution would be to put ant poison in the cracks before sealing. You may be able to get a borescope in the hole and see what is happening on the inside. They may sim...
59,467
I was wondering if anyone has been successful with incorporating an Image field `'type'=>'managed_file'` into a ctools plugin. I created a custom ctools plugin but am having some difficulty with the image field as I am getting an error upon upload. After some searching, it seems like this error could be caused from a f...
2013/02/02
[ "https://drupal.stackexchange.com/questions/59467", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/13247/" ]
You should try to put this line: ``` form_load_include($form_state, 'inc', 'my_module','plugins/content_types/my_file'); ``` at the top of your content\_image\_pane\_edit\_form function, replacing my\_module and my\_file with your module and plugin include file. Ctools panes are generated in a separate modal from b...
If you still get the same error message, try move the form function into .module file.
33,419
This is not "home" improvement per se, but it fits the spirit of this stack exchange. While waiting for my train I was peeking into a ceiling that had all of its slats removed for some kind of installation. I noticed there was a lot of new electrical conduit being laid which was made of copper. This struck me as really...
2013/11/03
[ "https://diy.stackexchange.com/questions/33419", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/14970/" ]
I'm guessing it's plumbing, not conduit. Unless you actually see wires running through the tubing, I'm not convinced it's conduit. In the US only certain types of conduit are listed for use, and I'm sure they are similar in Canada. Copper is not among those listed, so it's not likely it would be approved by an inspecto...
I can think of two possible explanations: 1. It could be brass conduit. These were once used to wire submerged swimming pool light fixtures. Maybe an electrician had some left over and used it where it wasn't necessarily required. 2. It could actually be copper plumbing in a water-related use, such as to provide hot w...
33,419
This is not "home" improvement per se, but it fits the spirit of this stack exchange. While waiting for my train I was peeking into a ceiling that had all of its slats removed for some kind of installation. I noticed there was a lot of new electrical conduit being laid which was made of copper. This struck me as really...
2013/11/03
[ "https://diy.stackexchange.com/questions/33419", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/14970/" ]
Alright, I took another look and it was definitely electrical. There were junction boxes branching off to the ceiling lights. Turns out it's original 60's era conduit and not new; just in good shape. Since then, buildings standards and material costs have changed drastically making it uneconomical to use.
I can think of two possible explanations: 1. It could be brass conduit. These were once used to wire submerged swimming pool light fixtures. Maybe an electrician had some left over and used it where it wasn't necessarily required. 2. It could actually be copper plumbing in a water-related use, such as to provide hot w...
33,419
This is not "home" improvement per se, but it fits the spirit of this stack exchange. While waiting for my train I was peeking into a ceiling that had all of its slats removed for some kind of installation. I noticed there was a lot of new electrical conduit being laid which was made of copper. This struck me as really...
2013/11/03
[ "https://diy.stackexchange.com/questions/33419", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/14970/" ]
I'm guessing it's plumbing, not conduit. Unless you actually see wires running through the tubing, I'm not convinced it's conduit. In the US only certain types of conduit are listed for use, and I'm sure they are similar in Canada. Copper is not among those listed, so it's not likely it would be approved by an inspecto...
It's most likely something like Pyrotenax. Copper covered fireproof cable.
33,419
This is not "home" improvement per se, but it fits the spirit of this stack exchange. While waiting for my train I was peeking into a ceiling that had all of its slats removed for some kind of installation. I noticed there was a lot of new electrical conduit being laid which was made of copper. This struck me as really...
2013/11/03
[ "https://diy.stackexchange.com/questions/33419", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/14970/" ]
Alright, I took another look and it was definitely electrical. There were junction boxes branching off to the ceiling lights. Turns out it's original 60's era conduit and not new; just in good shape. Since then, buildings standards and material costs have changed drastically making it uneconomical to use.
It's most likely something like Pyrotenax. Copper covered fireproof cable.
2,139,755
This works: **XAML:** ``` <Window x:Class="Test239992.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <StackPanel> <TextBlock Tag="1" Text="Customers" MouseDown="Handle_C...
2010/01/26
[ "https://Stackoverflow.com/questions/2139755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
Try [EventSetter](http://msdn.microsoft.com/en-us/library/system.windows.eventsetter.aspx) :) ``` <Style TargetType="{x:Type TextBlock}" x:Key="ClickableTextBlockStyle"> <EventSetter Event="MouseDown" Handler="Handle_Click" /> </Style> ```
Have a look at Triggers in WPF: <http://mark-dot-net.blogspot.com/2007/07/creating-custom-wpf-button-template-in.html>
4,106,201
Are there specific js libraries or techniques for querying json objects in the browser - i.e. 'get all People where person.name = "Joe"'. Something similar to what linq does in .NET.....
2010/11/05
[ "https://Stackoverflow.com/questions/4106201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4398/" ]
You may take a look at [LINQ to Javascript](http://jslinq.codeplex.com/). There are also [many others](http://www.google.com/#hl=en&expIds=25657,26637,27356,27404,27447&sugexp=ldymls&xhr=t&q=linq+for+javascript&cp=15&pf=p&sclient=psy&safe=active&aq=0&aqi=g4g-o1&aql=&oq=linq+for+javasc&gs_rfai=&pbx=1&fp=f436bf9c73b5ce9d...
There are several options: * [jsonpath](http://code.google.com/p/jsonpath/) * [Dojo jsonquery](http://docs.dojocampus.org/dojox/json/query) * There are several others listed at the bottom of the Wikipedia [linq](http://en.wikipedia.org/wiki/Linq) page.
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
You can add this callback and in a result "pop-out" button will be removed. ``` @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mWebView.loadUrl("javascript:(function() { " + "document.querySelector('[role=\"toolbar\"]').remove();})...
``` //initialze WebView webview = (WebView) findViewById(R.id.fullscree_webview); //set the javascript enable to your webview webview.getSettings().setJavaScriptEnabled(true); //set the WebViewClient webview.setWebViewClient(new WebViewClient() { //once the page is loaded get the html element by class or id and thro...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
``` mWebview = (WebView) findViewById(R.id.your_web_view_id); //do the javascript enable to your webview mWebview .getSettings().setJavaScriptEnabled(true); //set the WebViewClient mWebview .setWebViewClient(new WebViewClient() { //add this line to Hide pop-out tool bar of pdfview in pagLoadFinish @Override ...
Here is the code to disable that: ``` <div style="width: 640px; height: 480px; position: relative;"> <iframe src="https://drive.google.com/file/d/0ByzS..." width="640" height="480" frameborder="0" scrolling="no" seamless="" allowfullscreen="allowfullscreen"></iframe> <div style="width: 80px; height: 80px; position: ab...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
You can add this callback and in a result "pop-out" button will be removed. ``` @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mWebView.loadUrl("javascript:(function() { " + "document.querySelector('[role=\"toolbar\"]').remove();})...
> > 100% working solution, i am using below ans > > > ``` binding!!.webView.webViewClient = object : WebViewClient() { override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { if(url.contains("https")){ // idea1 : back button to exit! // finish() ...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
``` //initialze WebView webview = (WebView) findViewById(R.id.fullscree_webview); //set the javascript enable to your webview webview.getSettings().setJavaScriptEnabled(true); //set the WebViewClient webview.setWebViewClient(new WebViewClient() { //once the page is loaded get the html element by class or id and thro...
Here is the code to disable that: ``` <div style="width: 640px; height: 480px; position: relative;"> <iframe src="https://drive.google.com/file/d/0ByzS..." width="640" height="480" frameborder="0" scrolling="no" seamless="" allowfullscreen="allowfullscreen"></iframe> <div style="width: 80px; height: 80px; position: ab...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
``` //initialze WebView webview = (WebView) findViewById(R.id.fullscree_webview); //set the javascript enable to your webview webview.getSettings().setJavaScriptEnabled(true); //set the WebViewClient webview.setWebViewClient(new WebViewClient() { //once the page is loaded get the html element by class or id and thro...
``` mWebview = (WebView) findViewById(R.id.your_web_view_id); //do the javascript enable to your webview mWebview .getSettings().setJavaScriptEnabled(true); //set the WebViewClient mWebview .setWebViewClient(new WebViewClient() { //add this line to Hide pop-out tool bar of pdfview in pagLoadFinish @Override ...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
``` mWebview = (WebView) findViewById(R.id.your_web_view_id); //do the javascript enable to your webview mWebview .getSettings().setJavaScriptEnabled(true); //set the WebViewClient mWebview .setWebViewClient(new WebViewClient() { //add this line to Hide pop-out tool bar of pdfview in pagLoadFinish @Override ...
To strictly not allow anyone to click on "pop-out" 1. Keep the WebView hidden from the beginning by using ``` webview.setVisibility(View.GONE) ``` 2. Inside the webview ``` webView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { s...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
``` mWebview = (WebView) findViewById(R.id.your_web_view_id); //do the javascript enable to your webview mWebview .getSettings().setJavaScriptEnabled(true); //set the WebViewClient mWebview .setWebViewClient(new WebViewClient() { //add this line to Hide pop-out tool bar of pdfview in pagLoadFinish @Override ...
> > 100% working solution, i am using below ans > > > ``` binding!!.webView.webViewClient = object : WebViewClient() { override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { if(url.contains("https")){ // idea1 : back button to exit! // finish() ...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
You can add this callback and in a result "pop-out" button will be removed. ``` @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mWebView.loadUrl("javascript:(function() { " + "document.querySelector('[role=\"toolbar\"]').remove();})...
``` mWebview = (WebView) findViewById(R.id.your_web_view_id); //do the javascript enable to your webview mWebview .getSettings().setJavaScriptEnabled(true); //set the WebViewClient mWebview .setWebViewClient(new WebViewClient() { //add this line to Hide pop-out tool bar of pdfview in pagLoadFinish @Override ...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
You can add this callback and in a result "pop-out" button will be removed. ``` @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mWebView.loadUrl("javascript:(function() { " + "document.querySelector('[role=\"toolbar\"]').remove();})...
Here is the code to disable that: ``` <div style="width: 640px; height: 480px; position: relative;"> <iframe src="https://drive.google.com/file/d/0ByzS..." width="640" height="480" frameborder="0" scrolling="no" seamless="" allowfullscreen="allowfullscreen"></iframe> <div style="width: 80px; height: 80px; position: ab...
27,717,214
I am loading the pdf documents in WebView through appending the pdf url to google doc api `http://docs.google.com/gview?embedded=true&url=myurl` Pdf is loading just fine but the webpage displays two options - `Zoom-in` and `Pop-Out`. Is there any way to disable/hide pop-out option by sending some param? Any help woul...
2014/12/31
[ "https://Stackoverflow.com/questions/27717214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2868352/" ]
You can add this callback and in a result "pop-out" button will be removed. ``` @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); mWebView.loadUrl("javascript:(function() { " + "document.querySelector('[role=\"toolbar\"]').remove();})...
To strictly not allow anyone to click on "pop-out" 1. Keep the WebView hidden from the beginning by using ``` webview.setVisibility(View.GONE) ``` 2. Inside the webview ``` webView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { s...
48,642,488
I want to get the date and time in UTC format but whenever I am trying to get date that is giving me GMT format as follows (My System Time Zone is Pacific Time zone): ``` var dNow:Date = new Date(); trace(dNow); // Tue Feb 6 03:47:04 GMT-0800 2018 ``` And I tried many ways to convert that to UTC format but unable to...
2018/02/06
[ "https://Stackoverflow.com/questions/48642488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5713709/" ]
`performSelectorOnMainThread:withObject:waitUntilDone:` queues the message with common run loop modes. According to Apple's "Concurrency Programming Guide", the main queue will interleave queued tasks with other events from the app's run loop. Thus, if there are other events to be processed in the event queue, the queu...
Do like following way in swift 4: ``` performSelector(onMainThread: #selector(self.removeSource), with: nil, waitUntilDone: false) @objc func removeSource() { print("removeSource") } ```
48,642,488
I want to get the date and time in UTC format but whenever I am trying to get date that is giving me GMT format as follows (My System Time Zone is Pacific Time zone): ``` var dNow:Date = new Date(); trace(dNow); // Tue Feb 6 03:47:04 GMT-0800 2018 ``` And I tried many ways to convert that to UTC format but unable to...
2018/02/06
[ "https://Stackoverflow.com/questions/48642488", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5713709/" ]
`performSelectorOnMainThread:withObject:waitUntilDone:` queues the message with common run loop modes. According to Apple's "Concurrency Programming Guide", the main queue will interleave queued tasks with other events from the app's run loop. Thus, if there are other events to be processed in the event queue, the queu...
Instead of playing with selectors you can just wrap the content of `removeSource` in `DispatchQueue.main.sync` or `DispatchQueue.main.async` ``` class func removeSource() { DispatchQueue.main.sync { // Your code } } ``` **EDIT:** then you can call your function like this `AppDelegate.removeSource()...
25,402,232
I have a method like this: ``` public Date getCurrentUtcDateTime() { // Return UTC time } ``` I want to create a unit test with JUnit for it. ``` assertEquals( ?????? ``` What's the right approach? 1. If I write unit test code to calculate the UTC current time, it's not good because I would essentially ...
2014/08/20
[ "https://Stackoverflow.com/questions/25402232", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1883212/" ]
> > If I write unit test code to calculate the UTC current time, it's not good because I would essentially be rewriting the entire function > > > Sometimes that's the only way you can test something. Perhaps there is another approach you can use to get the same time? I.e. use Joda-time not standard Java classes, o...
So I have come across this multiple times. And in a lot of cases getting the before and after time (as suggested) works well. However, I have had problems with this in cases where the time is converted to a String or some such where I need the exact time to be able to create a good test. For this reason I created a mec...
4,944,870
I had to take over an MVC 3 project from another developer. One of the first things he did was to stop the yellow screen of death so that all exceptions are only logged to a file. You now only get a generic message saying an error has occurred. I would like to switch it back on (since it gets really annoying having to...
2011/02/09
[ "https://Stackoverflow.com/questions/4944870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121531/" ]
Normally you set this in web.config in the `customErrors` element under `system.web`. Just try to set mode=Off: ``` <customErrors mode="Off" /> ```
None of this worked for me. Check if someone might have added code to clear the error in the application error event handler. ``` protected void Application_Error(object sender, EventArgs e) { Exception lastException = Server.GetLastError().GetBaseException(); Log.Error("Global.asax: WebApplic...
4,944,870
I had to take over an MVC 3 project from another developer. One of the first things he did was to stop the yellow screen of death so that all exceptions are only logged to a file. You now only get a generic message saying an error has occurred. I would like to switch it back on (since it gets really annoying having to...
2011/02/09
[ "https://Stackoverflow.com/questions/4944870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121531/" ]
In `Global.asax` you can remove `filters.Add(new HandleErrorAttribute());` from `public static void RegisterGlobalFilters(GlobalFilterCollection filters)`. As pointed out in the comments - the problem was with a Custom Base controller overriding the OnException Method.
None of this worked for me. Check if someone might have added code to clear the error in the application error event handler. ``` protected void Application_Error(object sender, EventArgs e) { Exception lastException = Server.GetLastError().GetBaseException(); Log.Error("Global.asax: WebApplic...
4,944,870
I had to take over an MVC 3 project from another developer. One of the first things he did was to stop the yellow screen of death so that all exceptions are only logged to a file. You now only get a generic message saying an error has occurred. I would like to switch it back on (since it gets really annoying having to...
2011/02/09
[ "https://Stackoverflow.com/questions/4944870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121531/" ]
This question is a little old, but maybe this will help someone. In addition to setting `<customerErrors mode="Off" />`, also set this under `<system.webServer>`: `<httpErrors errorMode="Detailed" />` ``` <system.webServer> <httpErrors errorMode="Detailed"/> </system.webServer> ```
None of this worked for me. Check if someone might have added code to clear the error in the application error event handler. ``` protected void Application_Error(object sender, EventArgs e) { Exception lastException = Server.GetLastError().GetBaseException(); Log.Error("Global.asax: WebApplic...
12,989,719
I have a very simple process running where after each round of a simple game the scores are calculated, labels updated and all the normal, very simple stuff. I have a UIAlertView that informs the player of how s/he performed. I use a UIAlertViewDelegate to postpone all the updates, resetting of controls etc. till after...
2012/10/20
[ "https://Stackoverflow.com/questions/12989719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1570908/" ]
Change your code like this, ``` if (round == 10){ UIAlertView *endGame = [[UIAlertView alloc] initWithTitle: @"End of Game" message: endMessage delegate:self cancelButtonTitle:@"N...
You cant have two delegate method for dismisswithbuttonindex, you need to handle this situation with tag. Give both alert view a different tag and check it on delegate object. Thus you can differentiat the both alert view.
2,071,305
Let $D = \{P \in \mathbb{R}\_3[X] | P'(1) = 0\}$ Find a basis for $D$. I already figured that $\{1, X^2 -2X , X^3 - 3X\}$ might be a basis, but I'm struggling to prove it. I already showed that it is linear independent, but I don't know how to show that it spans $D$. I also figured that we can rewrite $D$ as: $D = \...
2016/12/25
[ "https://math.stackexchange.com/questions/2071305", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
You pretty much have it right there. $$aX^3 + bX^2 - (3a + 2b)X + d=a(X^3-3X)+b(X^2-2X)+d(1).$$ Right side is the linear combination of your suspected basis set. This shows your set spans $D$.
Your system of polynomials has rank $3=\dim D$. This ensures the system spans $D$, without having to compute the coefficients. It has rank $3$ because in the matrix of column vectors: $\;\begin{bmatrix}1&0&0\\0&-2&-3\\0&1&0\\0&0&1\end{bmatrix}\;$ there is the unit submatrix of dimension $3$ (remove the 2nd row). *Ano...
2,071,305
Let $D = \{P \in \mathbb{R}\_3[X] | P'(1) = 0\}$ Find a basis for $D$. I already figured that $\{1, X^2 -2X , X^3 - 3X\}$ might be a basis, but I'm struggling to prove it. I already showed that it is linear independent, but I don't know how to show that it spans $D$. I also figured that we can rewrite $D$ as: $D = \...
2016/12/25
[ "https://math.stackexchange.com/questions/2071305", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
You pretty much have it right there. $$aX^3 + bX^2 - (3a + 2b)X + d=a(X^3-3X)+b(X^2-2X)+d(1).$$ Right side is the linear combination of your suspected basis set. This shows your set spans $D$.
Consider the “standard” basis $\{1,X,X^2,X^3\}$; then $P(X)\mapsto P'(1)$ is a linear map $\mathbb{R}\_3[X]\to\mathbb{R}$ and its matrix relative to the standard basis and the basis $\{1\}$ on $\mathbb{R}$ is $$ [0\;1\;2\;3] $$ A basis of the null space can be obtained in the usual way: $$ \begin{bmatrix}1 \\ 0 \\ 0 \\...
2,071,305
Let $D = \{P \in \mathbb{R}\_3[X] | P'(1) = 0\}$ Find a basis for $D$. I already figured that $\{1, X^2 -2X , X^3 - 3X\}$ might be a basis, but I'm struggling to prove it. I already showed that it is linear independent, but I don't know how to show that it spans $D$. I also figured that we can rewrite $D$ as: $D = \...
2016/12/25
[ "https://math.stackexchange.com/questions/2071305", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Consider the “standard” basis $\{1,X,X^2,X^3\}$; then $P(X)\mapsto P'(1)$ is a linear map $\mathbb{R}\_3[X]\to\mathbb{R}$ and its matrix relative to the standard basis and the basis $\{1\}$ on $\mathbb{R}$ is $$ [0\;1\;2\;3] $$ A basis of the null space can be obtained in the usual way: $$ \begin{bmatrix}1 \\ 0 \\ 0 \\...
Your system of polynomials has rank $3=\dim D$. This ensures the system spans $D$, without having to compute the coefficients. It has rank $3$ because in the matrix of column vectors: $\;\begin{bmatrix}1&0&0\\0&-2&-3\\0&1&0\\0&0&1\end{bmatrix}\;$ there is the unit submatrix of dimension $3$ (remove the 2nd row). *Ano...
3,388,829
I am primarily a PHP developer, and I have been browsing the source code of a few open-source applications recently(Mozilla Bespin in particular), to find that some of them use a Python "back-end." I was just wondering what the purpose of this back-end is. I am assuming it is the same thing as the model in an MVC frame...
2010/08/02
[ "https://Stackoverflow.com/questions/3388829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364604/" ]
A "Python backend" is simply server-side software written in Python, no different in general terms than server-side software written in PHP. It does all the same things, just with a different programming language.
It looks like Bespin uses Python in the same way it would use PHP, if the autors chose PHP and not Python. If you are a PHP developer, you already are a "back-end" programmer and you already know what it does, the only difference is the programming language that was used to do that. Some web sites, mostly the huge on...
50,275,020
i have js ```js $(document).ready(function() { $("body").on("click", "#responds .del_button", function(e) { e.preventDefault(); var clickedID = this.id.split("-"); var DbNumberID = clickedID[1]; var myData = 'recordToDelete='+ DbNumberID; jQuery.ajax({ ...
2018/05/10
[ "https://Stackoverflow.com/questions/50275020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9718730/" ]
You are misusing the `for( in )` loop. As it iterates it chokes on the length property - which is not a Blob Object. This happens because the `for( in )` iterates over all (enumerable) object properties and not just "own properties". [Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statemen...
Good example of few issues together. 1. Exception you get - is because files isn't real array, so `for ... in` - iterates over "0", "1"... "item","length" keys. 2. You can't use async function inside loop without isolating the scope 3. My personal opinion: don't use jQuery if you can :-) ```js $('#image-upload-input'...
50,275,020
i have js ```js $(document).ready(function() { $("body").on("click", "#responds .del_button", function(e) { e.preventDefault(); var clickedID = this.id.split("-"); var DbNumberID = clickedID[1]; var myData = 'recordToDelete='+ DbNumberID; jQuery.ajax({ ...
2018/05/10
[ "https://Stackoverflow.com/questions/50275020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9718730/" ]
You are misusing the `for( in )` loop. As it iterates it chokes on the length property - which is not a Blob Object. This happens because the `for( in )` iterates over all (enumerable) object properties and not just "own properties". [Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statemen...
I would have ditched the FileReader for `URL.createObjectURL` and just use a regular for loop ``` $('#image-upload-input').on('change', function() { var files = document.getElementById('image-upload-input').files; for (var i = 0; i < files.length; i++) { var url = URL.createObjectURL(files[i]); $('.image-...
4,962,662
Im trying to compile a binary of an open-source project so that our users do not have to compile it themselves. I've noticed that some binaries created on one 32-bit ubuntu machine "A" don't work on 32-bit machine "B", with errors regarding missing .so files being reported. However, if I compile from scratch on machi...
2011/02/10
[ "https://Stackoverflow.com/questions/4962662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276949/" ]
I guess the issue is called "binary compatibility" (there's [a tag](https://stackoverflow.com/questions/tagged/binary-compatibility) on stack overflow devoted to these problems). When you link a binary on a machine, the surrounding environment affects the binary, and, having been run on another machine, it still tries ...
You can use a project like [Ermine](http://magicermine.com/) to create distributions of dynamically linked native binaries with the shared libraries included. Outside of that, you could compile your code static. This would require that you obtain the source code for your entire dependency tree, compile them, and refer...
4,962,662
Im trying to compile a binary of an open-source project so that our users do not have to compile it themselves. I've noticed that some binaries created on one 32-bit ubuntu machine "A" don't work on 32-bit machine "B", with errors regarding missing .so files being reported. However, if I compile from scratch on machi...
2011/02/10
[ "https://Stackoverflow.com/questions/4962662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276949/" ]
You can use a project like [Ermine](http://magicermine.com/) to create distributions of dynamically linked native binaries with the shared libraries included. Outside of that, you could compile your code static. This would require that you obtain the source code for your entire dependency tree, compile them, and refer...
Instead of the error prone `LD_LIBRARY_PATH` approach (which also requires user interaction) or static linking (not always possible or prohibited by GPL) you can try to use a relative path as library search path (offered in windows by standard since DOS times). Use the `$ORIGIN` flag with the linker. The complete appr...
4,962,662
Im trying to compile a binary of an open-source project so that our users do not have to compile it themselves. I've noticed that some binaries created on one 32-bit ubuntu machine "A" don't work on 32-bit machine "B", with errors regarding missing .so files being reported. However, if I compile from scratch on machi...
2011/02/10
[ "https://Stackoverflow.com/questions/4962662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276949/" ]
I guess the issue is called "binary compatibility" (there's [a tag](https://stackoverflow.com/questions/tagged/binary-compatibility) on stack overflow devoted to these problems). When you link a binary on a machine, the surrounding environment affects the binary, and, having been run on another machine, it still tries ...
If you compile code on a machine, you will most likely not get any errors regarding missing libs if you execute the program on this machine. During the configure run all needed libraries are detected (this is the main reason configure, autotools etc. exist) and appropriate flags, like -lsomelib and -I/some/include/patc...
4,962,662
Im trying to compile a binary of an open-source project so that our users do not have to compile it themselves. I've noticed that some binaries created on one 32-bit ubuntu machine "A" don't work on 32-bit machine "B", with errors regarding missing .so files being reported. However, if I compile from scratch on machi...
2011/02/10
[ "https://Stackoverflow.com/questions/4962662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276949/" ]
If you compile code on a machine, you will most likely not get any errors regarding missing libs if you execute the program on this machine. During the configure run all needed libraries are detected (this is the main reason configure, autotools etc. exist) and appropriate flags, like -lsomelib and -I/some/include/patc...
Instead of the error prone `LD_LIBRARY_PATH` approach (which also requires user interaction) or static linking (not always possible or prohibited by GPL) you can try to use a relative path as library search path (offered in windows by standard since DOS times). Use the `$ORIGIN` flag with the linker. The complete appr...
4,962,662
Im trying to compile a binary of an open-source project so that our users do not have to compile it themselves. I've noticed that some binaries created on one 32-bit ubuntu machine "A" don't work on 32-bit machine "B", with errors regarding missing .so files being reported. However, if I compile from scratch on machi...
2011/02/10
[ "https://Stackoverflow.com/questions/4962662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276949/" ]
I guess the issue is called "binary compatibility" (there's [a tag](https://stackoverflow.com/questions/tagged/binary-compatibility) on stack overflow devoted to these problems). When you link a binary on a machine, the surrounding environment affects the binary, and, having been run on another machine, it still tries ...
Instead of the error prone `LD_LIBRARY_PATH` approach (which also requires user interaction) or static linking (not always possible or prohibited by GPL) you can try to use a relative path as library search path (offered in windows by standard since DOS times). Use the `$ORIGIN` flag with the linker. The complete appr...
31,727,813
For example; I have this number `20420450901590` and I want to write a query that will update it to the `204/2045090/1/59/0`. The following `STUFF` function will do that on `MS SQL` but not on `ACCESS` DB. ``` DECLARE @Acct_No nvarchar(100),@Acct_No nvarchar(50) set @Acct_No = '20420450901590 ' select STUFF (STUFF(S...
2015/07/30
[ "https://Stackoverflow.com/questions/31727813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5174336/" ]
Quick answer: Don't do that. All functions and variables should be explicitly declared before use. Earlier versions of C let you get away with implicit declarations, but you shouldn't take advantage of that. In C89/C90 (sometimes called "ANSI C", but that's not strictly accurate), if you call a function with no visibl...
In C, calling an un-declared function triggers some rules for making up a the types of the return value and arguments. This is a terrible idea, and you should always enable compiler warnings that catch this mistake. You will get breakage when passing or returning a floating point value instead of an int, or when passin...
31,727,813
For example; I have this number `20420450901590` and I want to write a query that will update it to the `204/2045090/1/59/0`. The following `STUFF` function will do that on `MS SQL` but not on `ACCESS` DB. ``` DECLARE @Acct_No nvarchar(100),@Acct_No nvarchar(50) set @Acct_No = '20420450901590 ' select STUFF (STUFF(S...
2015/07/30
[ "https://Stackoverflow.com/questions/31727813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5174336/" ]
Quick answer: Don't do that. All functions and variables should be explicitly declared before use. Earlier versions of C let you get away with implicit declarations, but you shouldn't take advantage of that. In C89/C90 (sometimes called "ANSI C", but that's not strictly accurate), if you call a function with no visibl...
In K&R C, functions are implicitly declared returning `int` and accepting any arguments when they are used without being declared. Omitting the return type also defaults to `int` as return type, so the definition does not conflict with the implicit declaration.
31,727,813
For example; I have this number `20420450901590` and I want to write a query that will update it to the `204/2045090/1/59/0`. The following `STUFF` function will do that on `MS SQL` but not on `ACCESS` DB. ``` DECLARE @Acct_No nvarchar(100),@Acct_No nvarchar(50) set @Acct_No = '20420450901590 ' select STUFF (STUFF(S...
2015/07/30
[ "https://Stackoverflow.com/questions/31727813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5174336/" ]
Quick answer: Don't do that. All functions and variables should be explicitly declared before use. Earlier versions of C let you get away with implicit declarations, but you shouldn't take advantage of that. In C89/C90 (sometimes called "ANSI C", but that's not strictly accurate), if you call a function with no visibl...
When the source file is parsed top-down, compiler needs to see the declaration for all identifier before their use. The "implicit int" rule for functions without an explicit return type is valid only in C89/90. It has been removed from the standard in C99. So the `func()` needs an prototype in C99 and later. If you ar...
61,847,197
I am trying to read a string of three number using sstream but when I try to print them, I am getting a wrong output with four numbers. Code: ``` #include <iostream> #include <sstream> using namespace std; int main() { string a("1 2 3"); istringstream my_stream(a); int n; while(my_stream) { ...
2020/05/17
[ "https://Stackoverflow.com/questions/61847197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11009630/" ]
Here ``` while ( my_stream ) ``` `my_stream` is convertible to `bool` and returns `true` if there's no I/O error. See: <https://en.cppreference.com/w/cpp/io/basic_ios/operator_bool> So, after the last reading, there's no I/O error yet, so it iterates again and there's an error and nothing is read into `n` in this ...
You are printing the data before checking if readings are successful. ``` while(my_stream) { my_stream >> n; ``` should be ``` while(my_stream >> n) { ``` Related (doesn't seem duplicate because `eof()` isn't used here): [c++ - Why is iostream::eof inside a loop condition (i.e. `while (!stream....
34,630,340
My class takes a row of a dataframe to construct an object and I would like to create an array of objects by applying init to every row of a dataframe. Is there a way to vectorize this? My class definition looks like ``` class A(object): def __init__(self,row): self.a = row['a'] self.b = row['b'] ...
2016/01/06
[ "https://Stackoverflow.com/questions/34630340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1313793/" ]
Just use a lambda function? `xxx = df.apply(lambda x: A(x),axis=1)` edit: Another solution is to directly pass the class, the apply-function then calls the constructor: `xxx = df.apply(A,axis=1)` this works: ``` import pandas as pd class C(object): def __init__(self,dat): return A = pd.DataFrame({'a...
I think the best course of action IMO (I do feel this is subjective) would be to create a wrap function on your class. I do not know if this is really the best solution but it is a better practice than the answer accepted. ``` def wrap_class(row_element): c = MyClass(arg=row_element) return c.DoStuff() ``` ...
14,194,312
I have a parent process and n child processes that wait so receive something from the network.The thing is that for every message received by the child from the network I need to tell the father what the message contains.If I try to make a pipe or a socketpair between the father and the children then then the father do...
2013/01/07
[ "https://Stackoverflow.com/questions/14194312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1950704/" ]
You are using stream oriented pipes/socket pair. So you lose message boundaries. Use datagram oriented sockets for keeping message boundaries. See mapage [unix(7)](http://www.kernel.org/doc/man-pages/online/pages/man7/unix.7.html) for more information about datagram based unix sockets and socketpairs. There are func...
Before writing into pipe or socketpair use some delimeter so that every child adds that delimeter to the message before sending to the father
401,705
The `\footnote{text goes in here}` command takes an optional argument for numbering, so if I want to skip straight to footnote #5 or override the default numbering, I can do that: ``` \documentclass{article} \begin{document} Polaris\footnote[5]{i.e. the North Star}. \end{document} ``` However, what I am trying t...
2017/11/16
[ "https://tex.stackexchange.com/questions/401705", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/148393/" ]
footnotetext is ``` \def\footnotetext{% \@ifnextchar [\@xfootnotenext {\protected@xdef\@thefnmark{\thempfn}% \@footnotetext}} \def\@xfootnotenext[#1]{% \begingroup \csname c@\@mpfn\endcsname #1\relax \unrestored@protected@xdef\@thefnmark{\thempfn}% \endgroup \@footnotetext} ``` so it ...
For your setup it seems more advisable to use an automated approach that doesn't require you to set a `\linelabel` and then use it in the `\footnotetext[.]` immediately. Just define something like `\footnoteline{<footnote>}`: [![enter image description here](https://i.stack.imgur.com/9gPD2.png)](https://i.stack.imgur....
27,578,534
I use the Sqoop 1.4.4 to export data from hdfs into mysql. And got the following error: ``` bin/sqoop export --connect jdbc:mysql://127.0.0.1:3306/rec --username root --password root --table rec_temp --export-dir hdfs://127.0.0.1:9000//user/hdfs/part-r-00000 input-lines-terminated-by ' ' 14/12/20 17:14:04 INFO ma...
2014/12/20
[ "https://Stackoverflow.com/questions/27578534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4176366/" ]
There is a similar bug in sqoop reported [here](https://issues.apache.org/jira/browse/SQOOP-1400) .Please verify the correct MySQL connector version and sqoop version that you are using and update the version as required.Hope this will solve your problem. Thanks.
Try to use another mysql driver version as @Sachin said. It doesnt't worker with sqoop-1.6.1 + mysql-connector-java-5.0.8.tar, but works fine when I change to mysql-connector-java-5.1.17.jar
27,578,534
I use the Sqoop 1.4.4 to export data from hdfs into mysql. And got the following error: ``` bin/sqoop export --connect jdbc:mysql://127.0.0.1:3306/rec --username root --password root --table rec_temp --export-dir hdfs://127.0.0.1:9000//user/hdfs/part-r-00000 input-lines-terminated-by ' ' 14/12/20 17:14:04 INFO ma...
2014/12/20
[ "https://Stackoverflow.com/questions/27578534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4176366/" ]
There is a similar bug in sqoop reported [here](https://issues.apache.org/jira/browse/SQOOP-1400) .Please verify the correct MySQL connector version and sqoop version that you are using and update the version as required.Hope this will solve your problem. Thanks.
Add --driver com.mysql.jdbc.Driver --direct For example, this works for me: ``` sqoop export --connect jdbc:mysql://sandbox.hortonworks.com:3306/retail_db --username retail_dba --password hadoop --driver com.mysql.jdbc.Driver --direct --export-dir /user/horton/weather --table weather ```
36,567,917
I made a custom validation annotation for unique email (When user registers itself, program checks if email is already in database). Everything works just fine, but when I need to modify user's info and not to create a new one I run into a problem that says "Email is already in use" Can I somehow turn off only `@Uniq...
2016/04/12
[ "https://Stackoverflow.com/questions/36567917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6131368/" ]
I'm going to assume that you are using `javax.validation`. First you need an `interface OnUpdate`: ``` javax.validation.groups.Default public interface OnUpdate extends Default {} ``` Now you need to set *all* the annotations that need to **only** run on `UPDATE`: ``` @NotNull(groups = OnUpdate.class) ``` Now, ...
Further to Boris The Spider's answer, if you want to do this in code rather than with persistence.xml you can create the following bean: ``` @Bean public HibernatePropertiesCustomizer hibernatePropertiesCustomizer(final Validator validator) { return new HibernatePropertiesCustomizer() { @Override ...
59,262,953
I am developing a new android app but I am getting the following exception ``` java.lang.ClassCastException: kotlinx.coroutines.CompletableDeferredImpl cannot be cast to java.util.List at yodgorbek.komilov.musobaqayangiliklari.viewmodel.MainViewModel$loadNews$1.invokeSuspend(MainViewModel.kt:42) at kotlin.cor...
2019/12/10
[ "https://Stackoverflow.com/questions/59262953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12183825/" ]
Incorrect: ``` val result = sportsNewsApi.getNewsAsync() ``` Correct: ``` val result = sportsNewsApi.getNewsAsync().await() ```
``` val result = sportsNewsApi.getNewsAsync() UseCaseResult.Success(result) as UseCaseResult<List<Article>> ``` That cast is very suspicious since it should work even without it. That means your cast is invalid, causing the error you're seeing.
59,262,953
I am developing a new android app but I am getting the following exception ``` java.lang.ClassCastException: kotlinx.coroutines.CompletableDeferredImpl cannot be cast to java.util.List at yodgorbek.komilov.musobaqayangiliklari.viewmodel.MainViewModel$loadNews$1.invokeSuspend(MainViewModel.kt:42) at kotlin.cor...
2019/12/10
[ "https://Stackoverflow.com/questions/59262953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12183825/" ]
Incorrect: ``` val result = sportsNewsApi.getNewsAsync() ``` Correct: ``` val result = sportsNewsApi.getNewsAsync().await() ```
So you already made some changes Now getNewsAsync must return UseCaseResult not a list of it, since that's what The endpoint is returning. Then you can get the articles inside this object
59,262,953
I am developing a new android app but I am getting the following exception ``` java.lang.ClassCastException: kotlinx.coroutines.CompletableDeferredImpl cannot be cast to java.util.List at yodgorbek.komilov.musobaqayangiliklari.viewmodel.MainViewModel$loadNews$1.invokeSuspend(MainViewModel.kt:42) at kotlin.cor...
2019/12/10
[ "https://Stackoverflow.com/questions/59262953", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12183825/" ]
Incorrect: ``` val result = sportsNewsApi.getNewsAsync() ``` Correct: ``` val result = sportsNewsApi.getNewsAsync().await() ```
in `NewsRepository` in this 2 lines ``` val result = sportsNewsApi.getNewsAsync() UseCaseResult.Success(result) as UseCaseResult<List<Article>> ``` you are trying to cast `result` to `UseCaseResult<List<Article>>` , but in `SportNewsInterface` the `getNewsAsync()` fun returns `Deferred<SportNewsResponse>` thus you...
427,223
I want to say "[Rieger](https://en.wikipedia.org/wiki/Joerg_Rieger) coined the notion of *deep solidarity*." However, I'm not sure about several aspects of this: 1. Can you *coin* a notion, or only a phrase? 2. Can I say he coined the phrase, even if other people used these words with their typical meanings, but he fi...
2018/01/20
[ "https://english.stackexchange.com/questions/427223", "https://english.stackexchange.com", "https://english.stackexchange.com/users/232549/" ]
> > [coin (v.)](https://www.etymonline.com/word/coin) ...General sense of "**make, fabricate, invent**" (words) is from 1580s; phrase coin a phrase is attested from 1940 (to coin phrases is from 1898)... [from *Etymonline*] > > > As mentioned in both of the previous answers, the phrase **to coin** originally meant...
"To coin" did originally mean to invent but it's come more often to mean almost the opposite: "to use a well-known phrase…" However, "more often" doesn't mean exclusively or even instead. To "first define them in a technical sense…" seems to combine both uses; perhaps to introduce a third. <https://www.phrases.org.uk...
427,223
I want to say "[Rieger](https://en.wikipedia.org/wiki/Joerg_Rieger) coined the notion of *deep solidarity*." However, I'm not sure about several aspects of this: 1. Can you *coin* a notion, or only a phrase? 2. Can I say he coined the phrase, even if other people used these words with their typical meanings, but he fi...
2018/01/20
[ "https://english.stackexchange.com/questions/427223", "https://english.stackexchange.com", "https://english.stackexchange.com/users/232549/" ]
"To coin" did originally mean to invent but it's come more often to mean almost the opposite: "to use a well-known phrase…" However, "more often" doesn't mean exclusively or even instead. To "first define them in a technical sense…" seems to combine both uses; perhaps to introduce a third. <https://www.phrases.org.uk...
**1.** No. To coin means to create or stamp a phrase as your own e.g. 'shall I compare thee to a summer's day? Thou art more lovely and more temperate.'-William Shakespeare or Arnold Schwarzenegger's phrase-'I'll be back'. **2.** As I just said-no. It would have to be their own phrase or their catchphrase. **3.** Rieg...
427,223
I want to say "[Rieger](https://en.wikipedia.org/wiki/Joerg_Rieger) coined the notion of *deep solidarity*." However, I'm not sure about several aspects of this: 1. Can you *coin* a notion, or only a phrase? 2. Can I say he coined the phrase, even if other people used these words with their typical meanings, but he fi...
2018/01/20
[ "https://english.stackexchange.com/questions/427223", "https://english.stackexchange.com", "https://english.stackexchange.com/users/232549/" ]
"To coin" did originally mean to invent but it's come more often to mean almost the opposite: "to use a well-known phrase…" However, "more often" doesn't mean exclusively or even instead. To "first define them in a technical sense…" seems to combine both uses; perhaps to introduce a third. <https://www.phrases.org.uk...
> > Can you coin a notion, or only a phrase? > > > You coin a phrase, not a notion. > > Can I say he coined the phrase, > > > I wouldn't call that particular phrase novel enough for anyone to say they coined it. You could say he developed an idea or methodology or whatever which he called *deep solidarity*,...
427,223
I want to say "[Rieger](https://en.wikipedia.org/wiki/Joerg_Rieger) coined the notion of *deep solidarity*." However, I'm not sure about several aspects of this: 1. Can you *coin* a notion, or only a phrase? 2. Can I say he coined the phrase, even if other people used these words with their typical meanings, but he fi...
2018/01/20
[ "https://english.stackexchange.com/questions/427223", "https://english.stackexchange.com", "https://english.stackexchange.com/users/232549/" ]
> > [coin (v.)](https://www.etymonline.com/word/coin) ...General sense of "**make, fabricate, invent**" (words) is from 1580s; phrase coin a phrase is attested from 1940 (to coin phrases is from 1898)... [from *Etymonline*] > > > As mentioned in both of the previous answers, the phrase **to coin** originally meant...
To "coin" means to take a piece of nondescript metal and stamp it with a pattern that makes it a recognizable piece of money. In other words, create something of clear, discernible value out of raw materials. Other meanings are metaphors on that concept.