qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
71,401
I am in a position where I might have to prove that I made a certain amount of MB downloads from the Internet including webpages browsed to a court of law. Is there a way of finding this out from Windows Vista Ultimate. If I need to do this in the future is there a way of setting up Ultimate to audit my account to prov...
2009/11/16
[ "https://superuser.com/questions/71401", "https://superuser.com", "https://superuser.com/users/18259/" ]
if you are using Internet Explorer, you may be able to recover information of interest to you from index.dat > > **index.dat** is a file used by the Internet Explorer web browser. The > index.dat file functions as an active > database, which runs as long as a user > is logged on in Windows. It functions > as a re...
It completely depends on what you are using to download. Can you give us a bit more information about your environment? What browser(s)? Do you use download managers? What kind of downloads are you talking about? etc... Your best bet is to set up some kind of logging proxy to run your Internet traffic through. This wo...
71,401
I am in a position where I might have to prove that I made a certain amount of MB downloads from the Internet including webpages browsed to a court of law. Is there a way of finding this out from Windows Vista Ultimate. If I need to do this in the future is there a way of setting up Ultimate to audit my account to prov...
2009/11/16
[ "https://superuser.com/questions/71401", "https://superuser.com", "https://superuser.com/users/18259/" ]
I am not a lawyer... but from what I know of the Windows auditing sub-system, you're not going to be able to track downloads. The particular browser (IE, Firefox, Safari) you used likely contains history that will show these downloads. What will probably be of more value is working with your Internet Service Provider ...
Your ISP should have a log with your visited sites and all of your network transfers. Try contacting them.
71,401
I am in a position where I might have to prove that I made a certain amount of MB downloads from the Internet including webpages browsed to a court of law. Is there a way of finding this out from Windows Vista Ultimate. If I need to do this in the future is there a way of setting up Ultimate to audit my account to prov...
2009/11/16
[ "https://superuser.com/questions/71401", "https://superuser.com", "https://superuser.com/users/18259/" ]
if you are using Internet Explorer, you may be able to recover information of interest to you from index.dat > > **index.dat** is a file used by the Internet Explorer web browser. The > index.dat file functions as an active > database, which runs as long as a user > is logged on in Windows. It functions > as a re...
Your ISP should have a log with your visited sites and all of your network transfers. Try contacting them.
13,040,838
I am trying to update an application for the Apple App Store and when I attempt to validate it it fails with error "iPhone/iPod Touch: application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6". The problem is that I don't reference armv6 that I can ...
2012/10/23
[ "https://Stackoverflow.com/questions/13040838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323868/" ]
The ios deployment target must be set for both the project and the target application.
Add armv6 to the architecture if your deployment target less 4.3
9,629,572
> > **Possible Duplicate:** > > [Printing a string to a temporary stream object in C++](https://stackoverflow.com/questions/8013900/printing-a-string-to-a-temporary-stream-object-in-c) > > [std::ostringstream printing the address of the c-string instead of its content](https://stackoverflow.com/questions/8287188...
2012/03/09
[ "https://Stackoverflow.com/questions/9629572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004211/" ]
I honestly don't understand exactly what's going on (it has something to do with your `StreamWriter` instance being a temporary), but I see the same effect as paxdiablo described in both GCC and MSVC. However, here's something that can work around the problem. Add the following helper to your `StreamWriter` class: ``...
It appears to be a consequence of the way you're instantiating the object. I'm still investigating (and you may get a better answer in the meantime) but explicitly instantiating the object works fine: ``` #include <iostream> #include <sstream> class StreamWriter { public: StreamWriter() {} ~StreamWriter() { s...
9,629,572
> > **Possible Duplicate:** > > [Printing a string to a temporary stream object in C++](https://stackoverflow.com/questions/8013900/printing-a-string-to-a-temporary-stream-object-in-c) > > [std::ostringstream printing the address of the c-string instead of its content](https://stackoverflow.com/questions/8287188...
2012/03/09
[ "https://Stackoverflow.com/questions/9629572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004211/" ]
The problem is indeed that the stream is a temporary. Before C++11, there was no non-member `operator<<` overload that took an rvalue reference as the first parameter (aka, allowing writes to temporary streams). As such, the only valid `operator<<` overloads were the members, since all non-member overloads take a non...
It appears to be a consequence of the way you're instantiating the object. I'm still investigating (and you may get a better answer in the meantime) but explicitly instantiating the object works fine: ``` #include <iostream> #include <sstream> class StreamWriter { public: StreamWriter() {} ~StreamWriter() { s...
9,629,572
> > **Possible Duplicate:** > > [Printing a string to a temporary stream object in C++](https://stackoverflow.com/questions/8013900/printing-a-string-to-a-temporary-stream-object-in-c) > > [std::ostringstream printing the address of the c-string instead of its content](https://stackoverflow.com/questions/8287188...
2012/03/09
[ "https://Stackoverflow.com/questions/9629572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004211/" ]
I honestly don't understand exactly what's going on (it has something to do with your `StreamWriter` instance being a temporary), but I see the same effect as paxdiablo described in both GCC and MSVC. However, here's something that can work around the problem. Add the following helper to your `StreamWriter` class: ``...
I have tried a couple of alternatives, and the only thing I got working is something like this: ``` #define OSRDEBUG(s) \ do \ { \ StreamWriter writer; \ writer.m_stringstream << s; \ } while (0) OSRDEBUG("He...
9,629,572
> > **Possible Duplicate:** > > [Printing a string to a temporary stream object in C++](https://stackoverflow.com/questions/8013900/printing-a-string-to-a-temporary-stream-object-in-c) > > [std::ostringstream printing the address of the c-string instead of its content](https://stackoverflow.com/questions/8287188...
2012/03/09
[ "https://Stackoverflow.com/questions/9629572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004211/" ]
The problem is indeed that the stream is a temporary. Before C++11, there was no non-member `operator<<` overload that took an rvalue reference as the first parameter (aka, allowing writes to temporary streams). As such, the only valid `operator<<` overloads were the members, since all non-member overloads take a non...
I have tried a couple of alternatives, and the only thing I got working is something like this: ``` #define OSRDEBUG(s) \ do \ { \ StreamWriter writer; \ writer.m_stringstream << s; \ } while (0) OSRDEBUG("He...
9,629,572
> > **Possible Duplicate:** > > [Printing a string to a temporary stream object in C++](https://stackoverflow.com/questions/8013900/printing-a-string-to-a-temporary-stream-object-in-c) > > [std::ostringstream printing the address of the c-string instead of its content](https://stackoverflow.com/questions/8287188...
2012/03/09
[ "https://Stackoverflow.com/questions/9629572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1004211/" ]
The problem is indeed that the stream is a temporary. Before C++11, there was no non-member `operator<<` overload that took an rvalue reference as the first parameter (aka, allowing writes to temporary streams). As such, the only valid `operator<<` overloads were the members, since all non-member overloads take a non...
I honestly don't understand exactly what's going on (it has something to do with your `StreamWriter` instance being a temporary), but I see the same effect as paxdiablo described in both GCC and MSVC. However, here's something that can work around the problem. Add the following helper to your `StreamWriter` class: ``...
19,588,622
I am new to unit testing so I might be missing something, but how am I supposed to structure requirejs modules in order to make them fully testable? Consider the elegant revealing module pattern. ``` define([], function () { "use strict"; var func1 = function(){ var data = func2(); }; var func...
2013/10/25
[ "https://Stackoverflow.com/questions/19588622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/642462/" ]
If functions in a module call the module's other functions directly (i.e. by using references that are local to the module), there is no way to intercept *these* calls externally. However, if you change your module so that functions *inside* it call the module's functions in the same way code *outside* it does, then yo...
Are you sure you want to test the private function func2? I think developers are missing the point of unit tests when they try writing tests for private functions. Dependencies are what get us by the balls when developing software. And the more dependencies the tighter the squeeze . So if you have lots of tests dep...
13,085,541
I've a method in a NamesModel which fetches all the names and returns a list of names: ``` public static List<NamesModel> GetAllNames() { List<NamesModel> names = new List<NamesModel>(); // // code to fetch records // return names; } ``` In my controller: ``` public ActionResult Index() { ...
2012/10/26
[ "https://Stackoverflow.com/questions/13085541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1468830/" ]
You could use Ajax and Json for this For your controller: ``` [HttpPost] public JsonResult GetAllNames() { List<NamesModel> names = new List<NamesModel>(); // // code to fetch records // return Json(names); } ``` Or for debugging so you can view the json in browser: ``` public JsonResult GetAllNa...
The "source" options property can be a string wich points to the URL which return json data (<http://api.jqueryui.com/autocomplete/#option-source>)
13,085,541
I've a method in a NamesModel which fetches all the names and returns a list of names: ``` public static List<NamesModel> GetAllNames() { List<NamesModel> names = new List<NamesModel>(); // // code to fetch records // return names; } ``` In my controller: ``` public ActionResult Index() { ...
2012/10/26
[ "https://Stackoverflow.com/questions/13085541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1468830/" ]
The best solution to my problem is in this blog: <http://theycallmemrjames.blogspot.co.uk/2010/03/jquery-autocomplete-with-aspnet-mvc.html> Thanks to everyone who tried to help me.
The "source" options property can be a string wich points to the URL which return json data (<http://api.jqueryui.com/autocomplete/#option-source>)
68,664
Hi all, first, I'd like to apologize if the term "singularity" is being misused. I have the following integral: $\int \_{0}^{\pi/2} \sqrt{ r \left( x \right) ^{2} + \left( {\frac {d}{dx}} r \left( x \right) \right) ^{2}} \left( \ln \left( { \frac {\sin \left( x \right) }{1-\cos \left( x \right) }} \right) + 1 \right) ...
2011/06/23
[ "https://mathoverflow.net/questions/68664", "https://mathoverflow.net", "https://mathoverflow.net/users/15626/" ]
There are very general triangulability results for real (semi)algebraic sets (sets cut out by inequalities of real polynomials), and even for semianalytic and subanalytic sets. Lojasiewicz has some papers from the 60s on semianalytic sets; Hironaka and Hardt also have papers on the subject; and the book Real Algebraic ...
Actually, any complex algebraic variety can be triangulated as a **pseudomanifold**, which is a simplicial complex such that, if the variety has real dimension $n$, then any simplex is contained in an $n$-simplex, any $(n-1)$-simplex is contained in exactly two $n$-simplexes, and any two $n$-simplexes can be connected ...
16,187,932
Im using the jquery load function to refresh the contents of a div. I start by hiding the div ``` $('.dashboard-body').fadeOut(50); ``` Then ajax load - to refresh the content After the load event and while the refreshed div is still hidden id like to click on one of the contents pagination links. Then when the d...
2013/04/24
[ "https://Stackoverflow.com/questions/16187932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/615536/" ]
This might be what you are looking for... <http://www.pinlady.net/PluginDetect/PDFjs/>
This will test for it. I can't get to the other link due to corporate firewall. Dunno what it says. Maybe its the same. [FIDDLE HERE](http://jsfiddle.net/bWstc/) ``` <iframe src="some.pdf" id="iframe" name="iframe"></iframe> ``` . ``` // FireFox test for PDFJS to display PDFs. Works in 20 & 21. // If you don't tes...
8,201,124
In my solution I have WinForms application called JCommander and JCommanderSetupProject. In JCommander Resources folder i have an icon file i want to be placed on Desktop and Start Menu. How i do that?
2011/11/20
[ "https://Stackoverflow.com/questions/8201124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185824/" ]
You can use [Zend\_Registry](http://framework.zend.com/manual/en/zend.registry.using.html) to use the variable throughout application. You can set a variable like this ``` Zend_Registry::set('email', $EMAIL); ``` and later can get it like this ``` $email= Zend_Registry::get('email'); ```
Looks to me like you are making two distinct requests calling, respectively, `checkusernameAction()` and `subscribeAction()`. Since these are distinct requests, the email value you set in the controller during `checkusernameAction()` will be gone on the second request which calls `subscribeAction()`. It's the same cont...
8,201,124
In my solution I have WinForms application called JCommander and JCommanderSetupProject. In JCommander Resources folder i have an icon file i want to be placed on Desktop and Start Menu. How i do that?
2011/11/20
[ "https://Stackoverflow.com/questions/8201124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185824/" ]
You can use [Zend\_Registry](http://framework.zend.com/manual/en/zend.registry.using.html) to use the variable throughout application. You can set a variable like this ``` Zend_Registry::set('email', $EMAIL); ``` and later can get it like this ``` $email= Zend_Registry::get('email'); ```
You can also used a function for set and get a value. ``` // Setter function public function setConsumerKey($key) { $this->_consumerKey = $key; return $this; } // Getter function public function getConsumerKey() { return $this->_consumerKey; } ```
48,048
How would I merge content (e.g. a forum, with nodes, terms and users) from one Drupal site into another? Here's my specific use case: * I have a local site which just contains nodes, terms and users for a forum (these were imported with <http://drupal.org/project/phpbb2drupal> - and before you suggest just using it o...
2012/10/18
[ "https://drupal.stackexchange.com/questions/48048", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/4012/" ]
If it was just for nodes i would say use this: <http://drupal.org/project/node_export> As you need to migrate users and taxonomy terms as well I would use this: <http://drupal.org/project/migrate> Although there will be some php OOP coding to do.
You can use below script to dump into your new drupal 7:<http://goo.gl/GPmG9F>
20,725,377
``` $('body').on('click', 'img', function () { $('<img class="halfsize" src="imgs/logo.png?' + Math.random() + '" alt="" />').appendTo('header'); }); $('img').on('load', function (evt) { console.log(this, evt); }); ``` This code work fine when page first load. But, when click img, new append to header's img n...
2013/12/22
[ "https://Stackoverflow.com/questions/20725377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1659656/" ]
The `click` works because you use the delegated form of `.on()`. You should do the same with the image.. ``` $('header').on('load','img', function( evt ){ console.log(this, evt); } ); ``` --- **Update** Seems that image load events do not bubble up the DOM (*so you cannot handle them through delegated event ha...
For some browsers (IE in particular), you MUST attach the onload handler BEFORE you assign the `.src` attribute. That's because some browsers will load an image immediately when you assign the `.src` attribute if the image is in the image cache. Thus, if you attach the `load` handler afterwards, the event will already ...
23,369,686
For some reason i am getting events back from 2010 that are returning in this API call: `https://www.googleapis.com/calendar/v3/calendars/myEmailHere@gmail.com/events?maxResults=15&key={KEY HERE}` Here is some of the JSON from the response (Inside the Items Array): ``` { "kind":"calendar#event", "etag":"...
2014/04/29
[ "https://Stackoverflow.com/questions/23369686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1366887/" ]
You don't need a loop if you use `reshape`: ``` cols = [1:3]; z1 = reshape(U(:,cols), numel(U(:,cols)), 1); ``` You can also use this for non-consecutive columns, for example: ``` cols = [1 2 4 7]; ``` Example: ``` A = [1 2 3; 4 5 6; 7 8 9] cols = [1:2]; B = reshape(A(:,cols), numel(A(:,cols)), 1) ``...
Try: ``` startRange = 1; StopRange = 5; for ii = startRange:stopRange col=U(:,ii) newmat = [newmat; col] end ```
26,374
Does anyone know how to setup org-mode so that you can write/process applescript from within org source code blocks? I.e., ``` #+BEGIN_SRC applescript tell application "Emacs" [do something amazing] end tell #+END_SRC ``` Thanks!
2016/08/18
[ "https://emacs.stackexchange.com/questions/26374", "https://emacs.stackexchange.com", "https://emacs.stackexchange.com/users/12695/" ]
Not sure if Org Babel supports AppleScript, but it supports bash. You can run applescript from Bash using `osascript` and a bash `heredoc`: ``` #+BEGIN_SRC sh osascript <<'END' display dialog "Hello, World" END #+END_SRC ``` SE doesn't allow proper formatting. The `END` statement should be all the way to the l...
Would a bit of indirection be OK? You can use `noweb` to have an applescript block inserted into a shell block for execution… ``` #+name: hello-apples #+BEGIN_SRC apples display dialog "Hello, World" #+END_SRC #+BEGIN_SRC sh :noweb yes :exports both osascript -e '<<hello-apples>>' #+END_SRC #+RESULTS: : button retur...
26,374
Does anyone know how to setup org-mode so that you can write/process applescript from within org source code blocks? I.e., ``` #+BEGIN_SRC applescript tell application "Emacs" [do something amazing] end tell #+END_SRC ``` Thanks!
2016/08/18
[ "https://emacs.stackexchange.com/questions/26374", "https://emacs.stackexchange.com", "https://emacs.stackexchange.com/users/12695/" ]
It's super rough, but I managed to get a very, very basic integration working last night. Hope it is useful: <https://github.com/stig/ob-applescript.el> -- that should at least give you something to work with.
Not sure if Org Babel supports AppleScript, but it supports bash. You can run applescript from Bash using `osascript` and a bash `heredoc`: ``` #+BEGIN_SRC sh osascript <<'END' display dialog "Hello, World" END #+END_SRC ``` SE doesn't allow proper formatting. The `END` statement should be all the way to the l...
26,374
Does anyone know how to setup org-mode so that you can write/process applescript from within org source code blocks? I.e., ``` #+BEGIN_SRC applescript tell application "Emacs" [do something amazing] end tell #+END_SRC ``` Thanks!
2016/08/18
[ "https://emacs.stackexchange.com/questions/26374", "https://emacs.stackexchange.com", "https://emacs.stackexchange.com/users/12695/" ]
It's super rough, but I managed to get a very, very basic integration working last night. Hope it is useful: <https://github.com/stig/ob-applescript.el> -- that should at least give you something to work with.
Would a bit of indirection be OK? You can use `noweb` to have an applescript block inserted into a shell block for execution… ``` #+name: hello-apples #+BEGIN_SRC apples display dialog "Hello, World" #+END_SRC #+BEGIN_SRC sh :noweb yes :exports both osascript -e '<<hello-apples>>' #+END_SRC #+RESULTS: : button retur...
70,346,654
I've been trying to solve this simple problem, but I cannot make it work. I am using `WebSocketSharp.Server`. The code can be seen below. In my `NetworkClass` I have `someData` I would like to send to the client when a message is received. The problem is the `OnMessage` event gets fired in a different class, and I don...
2021/12/14
[ "https://Stackoverflow.com/questions/70346654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17672596/" ]
I combined the answers of Jeroen van Langen and Jesper. The key was to pass the instance of the `NetworkClass` to the `IndexRoute` class and access the variables from there. `server.AddWebSocketService<IndexRoute>("/", () => new IndexRoute(this));` works but is marked as obsolete. ``` public class IndexRoute : WebSoc...
I don't have any experience with WebSocketSharp, but the docs says you can give an alternate WebSocketBehavior construction function to the `AddWebSocketService<>` Let me know if it works: *(else i'll remove it)* ``` public class IndexRoute : WebSocketBehavior { private string _someData; // define the const...
70,346,654
I've been trying to solve this simple problem, but I cannot make it work. I am using `WebSocketSharp.Server`. The code can be seen below. In my `NetworkClass` I have `someData` I would like to send to the client when a message is received. The problem is the `OnMessage` event gets fired in a different class, and I don...
2021/12/14
[ "https://Stackoverflow.com/questions/70346654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17672596/" ]
I combined the answers of Jeroen van Langen and Jesper. The key was to pass the instance of the `NetworkClass` to the `IndexRoute` class and access the variables from there. `server.AddWebSocketService<IndexRoute>("/", () => new IndexRoute(this));` works but is marked as obsolete. ``` public class IndexRoute : WebSoc...
When you inherit `WebSocketBehavior`, you get methods and properties that allow you to find out information about the connection you are currently talking to. In this case, just use one of the `Send` methods to send to the connection that sent the message: ```cs protected override void OnMessage(MessageEventArgs e) { ...
1,479,152
Does WinForms have support for this? Let's say I want to show a panel containing ListView made of some results. It is shown by clicking on a button in a form corner, and the panel is shown inside the form, above all controls, preferably with shadow in the back to make it more attractive. I want this panel to be always...
2009/09/25
[ "https://Stackoverflow.com/questions/1479152", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155666/" ]
Here's a crude method that will get you started: ``` public Panel CreateFloatingPanel(Panel originalPanel) { Bitmap bmp = new Bitmap(originalPanel.Width, originalPanel.Height); Rectangle rect = new Rectangle(0, 0, bmp.Width, bmp.Height); originalPanel.DrawToBitmap(bmp, rect); foreach ...
Could you just create a hidden Panel at the back of the Form, and then make it visible, and then bring it to front?
44,241,044
I have an application based in the Spring Web model-view-controller (MVC) framework. I have this piece of code in my JSP, but when I click the button the form does not submit ``` <script type="text/javascript"> $('#confirmApplicationProcessButtonId').click(function(){ $('#deviceFormId').attr('metho...
2017/05/29
[ "https://Stackoverflow.com/questions/44241044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7716095/" ]
I'm not sure what equivalent are you looking for, but: * [there is no nanosecond precision](https://www.postgresql.org/docs/current/static/datatype-datetime.html) in PostgreSQL: *The allowed range of p* (precision) *is from 0 to 6 for the `timestamp` and `interval` types.* * some date parts include others: i.e. `milli...
<https://www.postgresql.org/docs/current/static/datatype-datetime.html>, look at the **"Table 8-9. Date/Time Types"** Date type resolution **1 day**. so you can't get none of above, but the weekday: ``` t=# select extract(Dow from now()::date); date_part ----------- 1 (1 row) ``` In case you were looking f...
44,241,044
I have an application based in the Spring Web model-view-controller (MVC) framework. I have this piece of code in my JSP, but when I click the button the form does not submit ``` <script type="text/javascript"> $('#confirmApplicationProcessButtonId').click(function(){ $('#deviceFormId').attr('metho...
2017/05/29
[ "https://Stackoverflow.com/questions/44241044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7716095/" ]
I'm not sure what equivalent are you looking for, but: * [there is no nanosecond precision](https://www.postgresql.org/docs/current/static/datatype-datetime.html) in PostgreSQL: *The allowed range of p* (precision) *is from 0 to 6 for the `timestamp` and `interval` types.* * some date parts include others: i.e. `milli...
As far as I know Postgres doesn't support nanoseconds. For the rest: > > > ``` > select extract(dow from timestamp '2001-02-16 20:38:40.5'); > > ``` > > > ``` > > | date_part | > | :-------- | > | 5 | > > ``` > > > > > ``` > select extract(milliseconds from timestamp '2001-02-16 20:38:40.5'); > > ...
5,465,460
I want to match a number containing 17-23 digits interspersed with spaces or hyphens, then replace all but the last five digits with asterisks. I can match with the following regex: ``` ((?:(?:\d)([\s-]*)){12,18})(\d[\s-]*){5} ``` My problem is that I can't get the regex to group all instances of `[\s-]` in the firs...
2011/03/28
[ "https://Stackoverflow.com/questions/5465460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680736/" ]
How about this: ``` s/\d(?=(?:[ -]*\d){5,22}(?![ -]*\d))/*/g ``` The positive lookahead insures that there are at least 5 digits ahead of the just-matched digit, while the embedded *negative* lookahead insures that aren't more than 22. However, there could still be more digits *before* the first-matched digit. That...
Even assuming that this is feasible with regex alone I'd bet that it would be way slower than using the non-capturing version of your regex and then reverse iterating over the match, leaving the first 5 digits alone and replacing the rest of them with '\*'.
5,465,460
I want to match a number containing 17-23 digits interspersed with spaces or hyphens, then replace all but the last five digits with asterisks. I can match with the following regex: ``` ((?:(?:\d)([\s-]*)){12,18})(\d[\s-]*){5} ``` My problem is that I can't get the regex to group all instances of `[\s-]` in the firs...
2011/03/28
[ "https://Stackoverflow.com/questions/5465460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680736/" ]
Even assuming that this is feasible with regex alone I'd bet that it would be way slower than using the non-capturing version of your regex and then reverse iterating over the match, leaving the first 5 digits alone and replacing the rest of them with '\*'.
To give a [java](/questions/tagged/java "show questions tagged 'java'") [regex](/questions/tagged/regex "show questions tagged 'regex'") variant to [Alan Moore](https://stackoverflow.com/users/20938/alan-moore)'s answer and using all word characters `[a-zA-Z0-9]` as `\w` instead of just digits `\d`. This will also work...
5,465,460
I want to match a number containing 17-23 digits interspersed with spaces or hyphens, then replace all but the last five digits with asterisks. I can match with the following regex: ``` ((?:(?:\d)([\s-]*)){12,18})(\d[\s-]*){5} ``` My problem is that I can't get the regex to group all instances of `[\s-]` in the firs...
2011/03/28
[ "https://Stackoverflow.com/questions/5465460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680736/" ]
How about this: ``` s/\d(?=(?:[ -]*\d){5,22}(?![ -]*\d))/*/g ``` The positive lookahead insures that there are at least 5 digits ahead of the just-matched digit, while the embedded *negative* lookahead insures that aren't more than 22. However, there could still be more digits *before* the first-matched digit. That...
I think your regex is ok, but you might need to have a callback where you can insert the asterisks with another inline regex. The below is a Perl example. `s/((?:\d[\s-]*){12,18})((?:\d[\s-]*){4}\d)/ add_asterisks($1,$2) /xeg` ``` use strict; use warnings; my $str = 'sequence of digits 01-2 3-456-7-190 123-416 78 '...
5,465,460
I want to match a number containing 17-23 digits interspersed with spaces or hyphens, then replace all but the last five digits with asterisks. I can match with the following regex: ``` ((?:(?:\d)([\s-]*)){12,18})(\d[\s-]*){5} ``` My problem is that I can't get the regex to group all instances of `[\s-]` in the firs...
2011/03/28
[ "https://Stackoverflow.com/questions/5465460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680736/" ]
I think your regex is ok, but you might need to have a callback where you can insert the asterisks with another inline regex. The below is a Perl example. `s/((?:\d[\s-]*){12,18})((?:\d[\s-]*){4}\d)/ add_asterisks($1,$2) /xeg` ``` use strict; use warnings; my $str = 'sequence of digits 01-2 3-456-7-190 123-416 78 '...
To give a [java](/questions/tagged/java "show questions tagged 'java'") [regex](/questions/tagged/regex "show questions tagged 'regex'") variant to [Alan Moore](https://stackoverflow.com/users/20938/alan-moore)'s answer and using all word characters `[a-zA-Z0-9]` as `\w` instead of just digits `\d`. This will also work...
5,465,460
I want to match a number containing 17-23 digits interspersed with spaces or hyphens, then replace all but the last five digits with asterisks. I can match with the following regex: ``` ((?:(?:\d)([\s-]*)){12,18})(\d[\s-]*){5} ``` My problem is that I can't get the regex to group all instances of `[\s-]` in the firs...
2011/03/28
[ "https://Stackoverflow.com/questions/5465460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680736/" ]
How about this: ``` s/\d(?=(?:[ -]*\d){5,22}(?![ -]*\d))/*/g ``` The positive lookahead insures that there are at least 5 digits ahead of the just-matched digit, while the embedded *negative* lookahead insures that aren't more than 22. However, there could still be more digits *before* the first-matched digit. That...
To give a [java](/questions/tagged/java "show questions tagged 'java'") [regex](/questions/tagged/regex "show questions tagged 'regex'") variant to [Alan Moore](https://stackoverflow.com/users/20938/alan-moore)'s answer and using all word characters `[a-zA-Z0-9]` as `\w` instead of just digits `\d`. This will also work...
42,022,346
In one scenario I have created linear layout inside `HorizontalScrollView` And problem is I am not able to disable its scroll bar I'v tried `scrollbarstyle` ; `scrollbarsize`, `setHorizontalScrollbarEnabled` but none of these method worked? my xml code is :- ``` <HorizontalScrollView android:id="@+id/horizon...
2017/02/03
[ "https://Stackoverflow.com/questions/42022346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6628748/" ]
This attribute `android:scrollbars` can be used to remove scrollbars Use the below code for reference ``` <HorizontalScrollView android:id="@+id/horizontal_times" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/divider_one" android:layout_marginT...
``` create a custom java files import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.ScrollView; public class CustomScrollView extends ScrollView { private boolean enableScrolling = true; public boolean isEnableScrolling() { return en...
42,022,346
In one scenario I have created linear layout inside `HorizontalScrollView` And problem is I am not able to disable its scroll bar I'v tried `scrollbarstyle` ; `scrollbarsize`, `setHorizontalScrollbarEnabled` but none of these method worked? my xml code is :- ``` <HorizontalScrollView android:id="@+id/horizon...
2017/02/03
[ "https://Stackoverflow.com/questions/42022346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6628748/" ]
Apply this property to scrollView in xml file. ``` android:scrollbars="none" ``` The following will remove the scrollbar in your scrollview programmatically: ``` HorizontalScrollView horizontalScrollView = (HorizontalScrollView) findViewById(R.id.horizontalScrollView); horizontalScro...
This attribute `android:scrollbars` can be used to remove scrollbars Use the below code for reference ``` <HorizontalScrollView android:id="@+id/horizontal_times" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/divider_one" android:layout_marginT...
42,022,346
In one scenario I have created linear layout inside `HorizontalScrollView` And problem is I am not able to disable its scroll bar I'v tried `scrollbarstyle` ; `scrollbarsize`, `setHorizontalScrollbarEnabled` but none of these method worked? my xml code is :- ``` <HorizontalScrollView android:id="@+id/horizon...
2017/02/03
[ "https://Stackoverflow.com/questions/42022346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6628748/" ]
try this in your onCreate(): ``` HorizontalScrollView sView = (HorizontalScrollView)findViewById(R.id.horizontal_times); // Hide the Scollbar sView.setVerticalScrollBarEnabled(false); sView.setHorizontalScrollBarEnabled(false); ```
``` create a custom java files import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.ScrollView; public class CustomScrollView extends ScrollView { private boolean enableScrolling = true; public boolean isEnableScrolling() { return en...
42,022,346
In one scenario I have created linear layout inside `HorizontalScrollView` And problem is I am not able to disable its scroll bar I'v tried `scrollbarstyle` ; `scrollbarsize`, `setHorizontalScrollbarEnabled` but none of these method worked? my xml code is :- ``` <HorizontalScrollView android:id="@+id/horizon...
2017/02/03
[ "https://Stackoverflow.com/questions/42022346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6628748/" ]
Apply this property to scrollView in xml file. ``` android:scrollbars="none" ``` The following will remove the scrollbar in your scrollview programmatically: ``` HorizontalScrollView horizontalScrollView = (HorizontalScrollView) findViewById(R.id.horizontalScrollView); horizontalScro...
``` create a custom java files import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.ScrollView; public class CustomScrollView extends ScrollView { private boolean enableScrolling = true; public boolean isEnableScrolling() { return en...
42,022,346
In one scenario I have created linear layout inside `HorizontalScrollView` And problem is I am not able to disable its scroll bar I'v tried `scrollbarstyle` ; `scrollbarsize`, `setHorizontalScrollbarEnabled` but none of these method worked? my xml code is :- ``` <HorizontalScrollView android:id="@+id/horizon...
2017/02/03
[ "https://Stackoverflow.com/questions/42022346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6628748/" ]
Apply this property to scrollView in xml file. ``` android:scrollbars="none" ``` The following will remove the scrollbar in your scrollview programmatically: ``` HorizontalScrollView horizontalScrollView = (HorizontalScrollView) findViewById(R.id.horizontalScrollView); horizontalScro...
try this in your onCreate(): ``` HorizontalScrollView sView = (HorizontalScrollView)findViewById(R.id.horizontal_times); // Hide the Scollbar sView.setVerticalScrollBarEnabled(false); sView.setHorizontalScrollBarEnabled(false); ```
8,156,399
I'm currently working on an audio recording application, that fetches up to 8 audio streams from the network and saves the data to the disk (simplified ;) ). Right now, each stream gets handled by one thread -> the same thread also does the saving work on the disk. That means I got 8 different threads that perform wri...
2011/11/16
[ "https://Stackoverflow.com/questions/8156399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1050210/" ]
The short answer: Given that you are writing to a Flash disk, I wouldn't expect the number of threads to make much difference one way or another. But if it did make a difference, I would expect multiple threads to be faster than a single thread, not slower. The longer answer: I wrote a similar program to the one you ...
If it's *embedded* linux, I guess your machine has only one processor/core. In this case threads won't improve I/O performance at all. Of course linux block subsystem works well in concurrent environment, but in your case (if my guess about number of cores is right) there can't be a situation when several threads do so...
8,156,399
I'm currently working on an audio recording application, that fetches up to 8 audio streams from the network and saves the data to the disk (simplified ;) ). Right now, each stream gets handled by one thread -> the same thread also does the saving work on the disk. That means I got 8 different threads that perform wri...
2011/11/16
[ "https://Stackoverflow.com/questions/8156399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1050210/" ]
The short answer: Given that you are writing to a Flash disk, I wouldn't expect the number of threads to make much difference one way or another. But if it did make a difference, I would expect multiple threads to be faster than a single thread, not slower. The longer answer: I wrote a similar program to the one you ...
I think that there is no big difference between multithreaded and singlethreaded solution in your case, but in case of multithreading you can syncronize between receiving threads and no one thread can affect on other threads in case of blocking in some system call. I did particulary the same thing on embedded syste...
4,808,374
``` file * fp = fopen() file * fd = ???? ``` I want to use `*fd` to write file which `*fp` opened before. How can I do it? Add some, the key of this question is use another pointer to do it. See, \*fd is the different pointer. Wish i made this clear.
2011/01/26
[ "https://Stackoverflow.com/questions/4808374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
`htmlentities()` is what you're looking for: <http://uk3.php.net/manual/en/function.htmlentities.php>
You are probably looking for [`htmlentities()`](http://fr.php.net/manual/en/function.htmlentities.php)
4,808,374
``` file * fp = fopen() file * fd = ???? ``` I want to use `*fd` to write file which `*fp` opened before. How can I do it? Add some, the key of this question is use another pointer to do it. See, \*fd is the different pointer. Wish i made this clear.
2011/01/26
[ "https://Stackoverflow.com/questions/4808374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
`htmlentities()` is what you're looking for: <http://uk3.php.net/manual/en/function.htmlentities.php>
[`htmlentities()`](http://php.net/htmlentities) does this. Use it like this: ``` $text = htmlentities($text); ``` But this should not be necessary if you provide proper charset information. Try setting the charset of your mail.
4,808,374
``` file * fp = fopen() file * fd = ???? ``` I want to use `*fd` to write file which `*fp` opened before. How can I do it? Add some, the key of this question is use another pointer to do it. See, \*fd is the different pointer. Wish i made this clear.
2011/01/26
[ "https://Stackoverflow.com/questions/4808374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/435645/" ]
`htmlentities()` is what you're looking for: <http://uk3.php.net/manual/en/function.htmlentities.php>
Two issues: (1) Use the htmlentities() located at <http://php.net/manual/en/function.htmlentities.php> Basic usages: ``` $clean = htmlentities($dirty, ENT_QUOTES, "UTF-8"); ``` The "ENT\_QUOTES" will result in both single and double quotes being converted (easy to change) The "UTF-8" forces a UTF-8 char-set (impo...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
There's nothing wrong with using void pointers. You don't even have to cast them when assigning them to a variable of type of pointer since the conversion is done internally. It migtht be worth having a look at this: <http://www.cpax.org.uk/prg/writings/casting.php>
You can efficiently add type information, inheritance and polymorphism to C data structures, that's what C++ does. (<http://www.embedded.com/97/fe29712.htm>)
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
We use OO in C a lot here, but only for encapsulation and abstraction, no polymorphism or so. Which means we have specific types, like FooBar(Foo a, ...) but, for our collection "classes", we use void \*. Just use void \* where multiple types could be used, BUT, by doing so, ensure you don't need the argument to be of...
A generic container can be wrapped with a little work so that it can be instantiated in type-safe versions. Here is an example, full headers linked below: /\* generic implementation \*/ ``` struct deque *deque_next(struct deque *dq); void *deque_value(const struct deque *dq); /* Prepend a node carrying `value` to t...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
We use OO in C a lot here, but only for encapsulation and abstraction, no polymorphism or so. Which means we have specific types, like FooBar(Foo a, ...) but, for our collection "classes", we use void \*. Just use void \* where multiple types could be used, BUT, by doing so, ensure you don't need the argument to be of...
You can use macros, they will work with any type and the compiler will check statically the expanded code. The downside is that the code density (in the binary) will worsen and they are more difficult to debug. I asked this [question about generic functions](https://stackoverflow.com/questions/894167/functional-progra...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
I would say use `void *` so you can re-use the code. It's more work to re-implement e.g. a linked list, than to make sure you get/set the data in the list properly. Take as many hints from [glib](http://library.gnome.org/devel/glib/stable/) as possible, I find their data structures very nice and easy to use, and have ...
You can efficiently add type information, inheritance and polymorphism to C data structures, that's what C++ does. (<http://www.embedded.com/97/fe29712.htm>)
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
Definitely generic `void*`, never duplicate code! Take into account that this dilemma was considered by many a C programmer, and many major C projects. All serious C projects I've ever encountered, whether open-source or commercial, picked the generic `void*`. When used carefully and wrapped into a good API, it is bar...
You can build a (sort of) OO framework using C, but you miss out on a lot of the benefits ... like an OO type system that the compiler understands. If you insist on doing OO in a C-like language, C++ is a better choice. It is more complicated than vanilla C, but at least you get proper linguistic support for OO. EDIT:...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
There's nothing wrong with using void pointers. You don't even have to cast them when assigning them to a variable of type of pointer since the conversion is done internally. It migtht be worth having a look at this: <http://www.cpax.org.uk/prg/writings/casting.php>
Definitely generic `void*`, never duplicate code! Take into account that this dilemma was considered by many a C programmer, and many major C projects. All serious C projects I've ever encountered, whether open-source or commercial, picked the generic `void*`. When used carefully and wrapped into a good API, it is bar...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
Definitely generic `void*`, never duplicate code! Take into account that this dilemma was considered by many a C programmer, and many major C projects. All serious C projects I've ever encountered, whether open-source or commercial, picked the generic `void*`. When used carefully and wrapped into a good API, it is bar...
In Java all collections from `java.util` package in effect hold equivalent of `void*` pointer ( the `Object` ). Yes, generics ( introduced in 1.5 ) add syntactic sugar and prevent you from coding unsafe assignments, however the storage type remains `Object`. So, I think there is no OO crime commited when you use `voi...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
I would say use `void *` so you can re-use the code. It's more work to re-implement e.g. a linked list, than to make sure you get/set the data in the list properly. Take as many hints from [glib](http://library.gnome.org/devel/glib/stable/) as possible, I find their data structures very nice and easy to use, and have ...
You can use macros, they will work with any type and the compiler will check statically the expanded code. The downside is that the code density (in the binary) will worsen and they are more difficult to debug. I asked this [question about generic functions](https://stackoverflow.com/questions/894167/functional-progra...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
There's nothing wrong with using void pointers. You don't even have to cast them when assigning them to a variable of type of pointer since the conversion is done internally. It migtht be worth having a look at this: <http://www.cpax.org.uk/prg/writings/casting.php>
You can build a (sort of) OO framework using C, but you miss out on a lot of the benefits ... like an OO type system that the compiler understands. If you insist on doing OO in a C-like language, C++ is a better choice. It is more complicated than vanilla C, but at least you get proper linguistic support for OO. EDIT:...
1,899,913
If page has .pdf files linked then a message in `<p>` should be add just before end of the `#mainontent` div as a last paragraph `<p>` for example this is default html? ``` <div id="maincontent"> <ul class="cheat_sheet_downloads"> <li><a href="http://www.addedbytes.com/download/css-cheat-sheet-v2.pdf">PDF, 316Kb</a>...
2009/12/14
[ "https://Stackoverflow.com/questions/1899913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84201/" ]
You can efficiently add type information, inheritance and polymorphism to C data structures, that's what C++ does. (<http://www.embedded.com/97/fe29712.htm>)
A generic container can be wrapped with a little work so that it can be instantiated in type-safe versions. Here is an example, full headers linked below: /\* generic implementation \*/ ``` struct deque *deque_next(struct deque *dq); void *deque_value(const struct deque *dq); /* Prepend a node carrying `value` to t...
9,153,788
How can I find out if jPlayer is playing? I tried this `alert($.jPlayer.event.playing);` but it doesn't work.
2012/02/05
[ "https://Stackoverflow.com/questions/9153788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519333/" ]
I've not worked with Jplayer specifically, but playing around, this returned false if the media was playing and true if it wasn't. ``` $('#jquery_jplayer_1').data().jPlayer.status.paused ```
On my setup, I noticed the class "jp-state-playing" was added to the div that included jp-audio. I have not done a lot of research, but querying for a null object or not seemed better than tying myself to jPlayers internals.
9,153,788
How can I find out if jPlayer is playing? I tried this `alert($.jPlayer.event.playing);` but it doesn't work.
2012/02/05
[ "https://Stackoverflow.com/questions/9153788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519333/" ]
I've not worked with Jplayer specifically, but playing around, this returned false if the media was playing and true if it wasn't. ``` $('#jquery_jplayer_1').data().jPlayer.status.paused ```
``` var duration = $('#jquery_jplayer_1').data("jPlayer").status.currentTime; if(duration){ // Source is loaded and playing } ```
9,153,788
How can I find out if jPlayer is playing? I tried this `alert($.jPlayer.event.playing);` but it doesn't work.
2012/02/05
[ "https://Stackoverflow.com/questions/9153788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519333/" ]
Kyle's method works fine, here's a fiddle to demonstrate it in action: <http://jsfiddle.net/75lb/95EPu/> However, ordinarily you wouldn't need to access jPlayer's internals like this, being an event-driven plugin.. would it be cleaner to respond to one of jPlayer's many events (at the appropriate moment)? <http://ww...
On my setup, I noticed the class "jp-state-playing" was added to the div that included jp-audio. I have not done a lot of research, but querying for a null object or not seemed better than tying myself to jPlayers internals.
9,153,788
How can I find out if jPlayer is playing? I tried this `alert($.jPlayer.event.playing);` but it doesn't work.
2012/02/05
[ "https://Stackoverflow.com/questions/9153788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519333/" ]
Kyle's method works fine, here's a fiddle to demonstrate it in action: <http://jsfiddle.net/75lb/95EPu/> However, ordinarily you wouldn't need to access jPlayer's internals like this, being an event-driven plugin.. would it be cleaner to respond to one of jPlayer's many events (at the appropriate moment)? <http://ww...
``` var duration = $('#jquery_jplayer_1').data("jPlayer").status.currentTime; if(duration){ // Source is loaded and playing } ```
34,850,121
Why I can't to use `String` or other module in guard? Code: ``` def foo(s1, s2) when String.length(s1) == String.length(s2) do # something end ``` And how I can elegantly reformat such case, when I wish to use module functions?
2016/01/18
[ "https://Stackoverflow.com/questions/34850121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4798386/" ]
From the [erlang docs](http://erlang.org/doc/reference_manual/expressions.html#id83710): > > The set of valid guard expressions (sometimes called guard tests) is a subset of the set of valid Erlang expressions. The reason for restricting the set of valid expressions is that evaluation of a guard expression must be gu...
``` byte_size(s1) == byte_size(s2) ``` does not have the same meaning of ``` String.length(s1) == String.length(s2) ``` It only does so for characters composed of a single byte. ``` iex(1)> String.length("hello") == String.length("helló") true iex(2)> byte_size("hello") == byte_size("helló") false ``` For the c...
33,264,495
This is a cluster with Hadoop 2.5.0, Spark 1.2.0, Scala 2.10, provided by CDH 5.3.2. I used a [compiled spark-notebook distro](http://spark-notebook.io) It seems Spark-Notebook cannot find the Hive metastore by default. How to specify the location of `hive-site.xml` for spark-notebook so that it can load the Hive met...
2015/10/21
[ "https://Stackoverflow.com/questions/33264495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5240614/" ]
When you start the notebook set the environment variable EXTRA\_CLASSPATH with the path where you have located the hive-site.xml, this works for me:`EXTRA_CLASSPATH=/path_of_my_mysql_connector/mysql-connector-java.jar:/my_hive_site.xml_directory/conf ./bin/spark-notebook` I have also passed the jar of my mysqlconnecto...
Using CDH 5.5.0 Quickstart VM, the solution is the following: You need the reference `hive-site.xml`to the notebook which provides the access information to the hive metastore. By default, spark-notebooks uses an internal metastore. You can the define the following environmental variable in `~/.bash_profile`: ``` HAD...
2,713,075
I have this problem. In table I have column which is nvarcar type. and row in this column is row1= 1;6 row2 = 12 row3 =6;5;67 etc... I try to search this column. for example when i send 1 i try to get only row1. I use LIKE but in result set I get row1 and row2. How can I achieved this, any help is appreciated. Tnx...
2010/04/26
[ "https://Stackoverflow.com/questions/2713075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325932/" ]
Not particulary elegant but this *get's the job done*. ``` DECLARE @Table TABLE (Row NVARCHAR(32)) INSERT INTO @Table VALUES ('1;6') INSERT INTO @Table VALUES ('12') INSERT INTO @Table VALUES ('6;5;67') SELECT * FROM @Table WHERE Row = '1' OR Row LIKE '%;1' OR Row LIKE '1;%' OR Row LIKE...
You have four possibilities for where the key can be: * It could be the entire key * At the start * In the middle * At the end Therefore, you have to select for each distinct possibility, like so: ``` SELECT * FROM MyTable WHERE MyColumn = @Key OR MyColumn LIKE @Key + ';%' OR MyColumn LIKE '%;' + @Key + ';%' ...
2,713,075
I have this problem. In table I have column which is nvarcar type. and row in this column is row1= 1;6 row2 = 12 row3 =6;5;67 etc... I try to search this column. for example when i send 1 i try to get only row1. I use LIKE but in result set I get row1 and row2. How can I achieved this, any help is appreciated. Tnx...
2010/04/26
[ "https://Stackoverflow.com/questions/2713075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325932/" ]
**normalize your tables!**, storing multiple values in a single column will cause you grief as long as you use this design. it might appear easier to store data this way, but as you are seeing it is difficult to query against this data, and the queries you do create will be awful and have no chance of using an index.
You have four possibilities for where the key can be: * It could be the entire key * At the start * In the middle * At the end Therefore, you have to select for each distinct possibility, like so: ``` SELECT * FROM MyTable WHERE MyColumn = @Key OR MyColumn LIKE @Key + ';%' OR MyColumn LIKE '%;' + @Key + ';%' ...
2,713,075
I have this problem. In table I have column which is nvarcar type. and row in this column is row1= 1;6 row2 = 12 row3 =6;5;67 etc... I try to search this column. for example when i send 1 i try to get only row1. I use LIKE but in result set I get row1 and row2. How can I achieved this, any help is appreciated. Tnx...
2010/04/26
[ "https://Stackoverflow.com/questions/2713075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325932/" ]
**normalize your tables!**, storing multiple values in a single column will cause you grief as long as you use this design. it might appear easier to store data this way, but as you are seeing it is difficult to query against this data, and the queries you do create will be awful and have no chance of using an index.
Not particulary elegant but this *get's the job done*. ``` DECLARE @Table TABLE (Row NVARCHAR(32)) INSERT INTO @Table VALUES ('1;6') INSERT INTO @Table VALUES ('12') INSERT INTO @Table VALUES ('6;5;67') SELECT * FROM @Table WHERE Row = '1' OR Row LIKE '%;1' OR Row LIKE '1;%' OR Row LIKE...
50,004,392
I'm trying to write a program similar to the contacts app on an android phone using javafx. In the fxml file I have a VBox which contains three textfields, the first two fields are for first name and last name, and the third one is for a number. Now what I want the program to do is when the textfield for number is fil...
2018/04/24
[ "https://Stackoverflow.com/questions/50004392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5289097/" ]
One of the issues that your users might have is this [![enter image description here](https://i.stack.imgur.com/44jA2.jpg)](https://i.stack.imgur.com/44jA2.jpg) Maybe they disabled the auto-updates of Google Play, but is really weird that they can't see it, maybe it's due the devices. Is your device listed as compati...
If new users are getting the new version installed then it is definitely uploaded to the Play store correctly. If existing users aren't seeing "update" (just open) then it means there is something about the new version of the app that is incompatible with their devices. You can check this by trying uninstalling and re...
19,149
Why G-d had to confuse people's languages in the land of Shinar and scatter them across the Earth with diverse languages? What moral does Genesis 11:5–8 coveny to mankind execept the fact that "in order to initate a huge project and achieve its result, there should be no communication gap". And if this was good then wh...
2012/09/14
[ "https://judaism.stackexchange.com/questions/19149", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/1275/" ]
Ralbag suggests a fascinating approach to understanding the incident. He explains that these people did not sin in any way. They were not dispersed as a punishment. Instead, they were dispersed in order to assure the preservation of humanity. Concentration of the entire human race in a single location created the possi...
The way you've written your question shows that you haven't interpreted the text correctly. [Genesis 11:6-7](http://en.wikisource.org/wiki/Tanakh/Torah/Bereishit/Chapter_11) reads: > > And the Lord said: 'Behold, they are one people, and they have all one language; and this is what they begin to do; and now nothing ...
19,149
Why G-d had to confuse people's languages in the land of Shinar and scatter them across the Earth with diverse languages? What moral does Genesis 11:5–8 coveny to mankind execept the fact that "in order to initate a huge project and achieve its result, there should be no communication gap". And if this was good then wh...
2012/09/14
[ "https://judaism.stackexchange.com/questions/19149", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/1275/" ]
The way you've written your question shows that you haven't interpreted the text correctly. [Genesis 11:6-7](http://en.wikisource.org/wiki/Tanakh/Torah/Bereishit/Chapter_11) reads: > > And the Lord said: 'Behold, they are one people, and they have all one language; and this is what they begin to do; and now nothing ...
I believe that what these people were after is to "build a name for them selves" apart from God, or as someone here said, in defiance of Him. So the question is not if God was helpless, the point is that they were alienated, as godless men ever since Adam's sin are, and as such they commited to "reach the sky". And s...
19,149
Why G-d had to confuse people's languages in the land of Shinar and scatter them across the Earth with diverse languages? What moral does Genesis 11:5–8 coveny to mankind execept the fact that "in order to initate a huge project and achieve its result, there should be no communication gap". And if this was good then wh...
2012/09/14
[ "https://judaism.stackexchange.com/questions/19149", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/1275/" ]
Ralbag suggests a fascinating approach to understanding the incident. He explains that these people did not sin in any way. They were not dispersed as a punishment. Instead, they were dispersed in order to assure the preservation of humanity. Concentration of the entire human race in a single location created the possi...
Sforno suggests that we begin by understanding the motivations of these people. Why did they wish to create a single monolithic society? Sforno seems to say that the objective was to empower a single ruler over all of humanity. This would be accomplished through two steps. * A great capital city would be built. * The ...
19,149
Why G-d had to confuse people's languages in the land of Shinar and scatter them across the Earth with diverse languages? What moral does Genesis 11:5–8 coveny to mankind execept the fact that "in order to initate a huge project and achieve its result, there should be no communication gap". And if this was good then wh...
2012/09/14
[ "https://judaism.stackexchange.com/questions/19149", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/1275/" ]
Sforno suggests that we begin by understanding the motivations of these people. Why did they wish to create a single monolithic society? Sforno seems to say that the objective was to empower a single ruler over all of humanity. This would be accomplished through two steps. * A great capital city would be built. * The ...
I believe that what these people were after is to "build a name for them selves" apart from God, or as someone here said, in defiance of Him. So the question is not if God was helpless, the point is that they were alienated, as godless men ever since Adam's sin are, and as such they commited to "reach the sky". And s...
19,149
Why G-d had to confuse people's languages in the land of Shinar and scatter them across the Earth with diverse languages? What moral does Genesis 11:5–8 coveny to mankind execept the fact that "in order to initate a huge project and achieve its result, there should be no communication gap". And if this was good then wh...
2012/09/14
[ "https://judaism.stackexchange.com/questions/19149", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/1275/" ]
Ralbag suggests a fascinating approach to understanding the incident. He explains that these people did not sin in any way. They were not dispersed as a punishment. Instead, they were dispersed in order to assure the preservation of humanity. Concentration of the entire human race in a single location created the possi...
I believe that what these people were after is to "build a name for them selves" apart from God, or as someone here said, in defiance of Him. So the question is not if God was helpless, the point is that they were alienated, as godless men ever since Adam's sin are, and as such they commited to "reach the sky". And s...
12,994,567
I'm developing audio code for a program that needs to be able to record and playback on a variety of devices, some of them high end, with a variety of different wav and AIFF formats. I expected to be able to use the WASAPI library, but I'm hitting some major problems. The biggest one right now is that, as far as I can ...
2012/10/21
[ "https://Stackoverflow.com/questions/12994567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/792826/" ]
This is new in rails 3.2 due to the security upgrade. you can learn more at [hackers love massignment](http://railscasts.com/episodes/26-hackers-love-mass-assignment) ``` attr_accessible :first_name, :last_name ``` <http://api.rubyonrails.org/classes/ActiveModel/MassAssignmentSecurity/ClassMethods.html>
As of Rails 3.2 we have a new config setting in application.rb: `config.active_record.whitelist_attributes = true` What this is essentially doing is assuming all your models attributes are guilty until proven innocent(whitelisted). If this is set to true you have to explicitly white list any given attribute by either...
15,590,200
I am trying to make a program that organizes punch-ins from an RFID scanner in google sheets... When I go to match scan [i] with employee name [j] it never succeeds. I have a simple if statement: ``` //names[i] is the name of the card for the scan event (card names = employee full name) var name = names[i]; //the j...
2013/03/23
[ "https://Stackoverflow.com/questions/15590200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2202843/" ]
It looks like you're comparing two Array objects rather than two strings. The screenshot claims that name and employee are indexed arrays with a single element. To compare the string data inside each Array object: ``` name[0] == employee[0] // equal value ``` Or the slightly safer: ``` name[0] === employee[0] ...
``` > foo = ['foo']; [ 'foo' ] > bar = ['foo']; [ 'foo' ] > foo == bar false > foo === bar false ``` Comparing array to array- even if they look the same, will not be true unless they are really referencing the same array in memory. ``` > bar = foo; [ 'foo' ] > foo == bar true > foo === bar true ``` So, try compar...
15,590,200
I am trying to make a program that organizes punch-ins from an RFID scanner in google sheets... When I go to match scan [i] with employee name [j] it never succeeds. I have a simple if statement: ``` //names[i] is the name of the card for the scan event (card names = employee full name) var name = names[i]; //the j...
2013/03/23
[ "https://Stackoverflow.com/questions/15590200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2202843/" ]
It looks like you're comparing two Array objects rather than two strings. The screenshot claims that name and employee are indexed arrays with a single element. To compare the string data inside each Array object: ``` name[0] == employee[0] // equal value ``` Or the slightly safer: ``` name[0] === employee[0] ...
Using toString method might help as well: ``` name.toString()==employee.toString() ``` But the other suggestions look cleaner.
15,590,200
I am trying to make a program that organizes punch-ins from an RFID scanner in google sheets... When I go to match scan [i] with employee name [j] it never succeeds. I have a simple if statement: ``` //names[i] is the name of the card for the scan event (card names = employee full name) var name = names[i]; //the j...
2013/03/23
[ "https://Stackoverflow.com/questions/15590200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2202843/" ]
It looks like you're comparing two Array objects rather than two strings. The screenshot claims that name and employee are indexed arrays with a single element. To compare the string data inside each Array object: ``` name[0] == employee[0] // equal value ``` Or the slightly safer: ``` name[0] === employee[0] ...
In your debugger you can see that both `name` and `employee` refer to arrays with a string in it - yet those are two distinct arrays (with different internal ids), which are therefore not equal in terms of `==`. If you want to compare the strings inside them, use ``` var ifsuccess = name[0] == employee[0]; ```
19,230,092
I'm developing client-server application, where client applications will run on mobile devices (Android, iOS) and will communicate with the server via HTTP protocol. Mobile applications will be available for free at the market and multiple users will be using the same application instance on the same device. I need to...
2013/10/07
[ "https://Stackoverflow.com/questions/19230092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2855278/" ]
I'd say the easiest way is splitting the strings into parts first. First delimiter would be spaces, for each word - second would be qoutes (double and single) Then use Uri.IsWellFormedUriString on each token. So something like: ``` foreach(var part in String.Split(new char[]{''', '"', ' '}, someRandomText)) { i...
Try `\w+:\S+` and see how well that fits your purposes.
19,230,092
I'm developing client-server application, where client applications will run on mobile devices (Android, iOS) and will communicate with the server via HTTP protocol. Mobile applications will be available for free at the market and multiple users will be using the same application instance on the same device. I need to...
2013/10/07
[ "https://Stackoverflow.com/questions/19230092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2855278/" ]
U can use : ``` (?<type>[^ ]+?:)(?<path>//[^ ]*|\\.+\\[^ ]*) ``` that will give you 2 groups on each result type : `"http:"` path : `//www.thewebsite.com/NewStuff` and type : `"J:"` path : `\Downloads\NewStuff` out of the string > > "I placed the files on the server at > <http://www.thewebsite.com/NewStuff...
Try `\w+:\S+` and see how well that fits your purposes.
19,230,092
I'm developing client-server application, where client applications will run on mobile devices (Android, iOS) and will communicate with the server via HTTP protocol. Mobile applications will be available for free at the market and multiple users will be using the same application instance on the same device. I need to...
2013/10/07
[ "https://Stackoverflow.com/questions/19230092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2855278/" ]
It was not clear from your earlier question that you wanted to extract URL and file path substrings from larger strings. In that case, neither `Uri.IsWellFormedUriString` nor `rRegex.Match` will do what you want. Indeed, I do not think any simple method can do what you want because you will have to define rules for amb...
Try `\w+:\S+` and see how well that fits your purposes.
47,201
I use Time Machine to backup to an external hard drive. That external drive also has a lot of other photos and unique info on that drive, too. I'm not sure my Time Machine backed up my whole computer because of the computer turned off in the middle of the first time I used it (recently). Questions: 1. Is there a wa...
2012/04/02
[ "https://apple.stackexchange.com/questions/47201", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/20724/" ]
The first question, how can you be sure a backup has completed, is answered by checking the menubar Time Machine item. It will tell you the date of the last completed backup. Secondly if you want to perform another complete Time Machine backup you can stop Time Machine, eject the Time Machine drive, plug in a fresh dr...
When TimeMachine runs if the previous backup was interrupted it will do a check to work out what it needs to do to run a complete backup. Let it run and it will automatically give you a complete backup. Also, in System Prefs - Time Machine, check the options to see if anything has been excluded. You can optionally ex...
52,356,881
I want to declare a pointer, have it hold a custom address and then assign a value to it: ``` void main() { char *ptr; ptr = (char *)0x123123; //the assignment works perfectly with a cast printf("%p\n", ptr); //and the pointer indeed holds the address it's supposed to *ptr = 'a'; //but this breaks ...
2018/09/16
[ "https://Stackoverflow.com/questions/52356881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9807062/" ]
> > 3rd assumption would be that such an address must be unavailable, > > > That is correct: on modern OSes (which all have memory protection) you can't write to arbitrary memory address. It used to be possible to access any memory on OSes that didn't utilize virtual memory (such as `MS-DOS`), but allowing that i...
writing to some arbitrary memory address is dangerous and not allowed by modern operating systems, better to create a memory blob and write to that. e.g. using malloc : ``` ptr = malloc(32); // now you can write to this memory block and it perfectly legal *ptr = 'a'; ```
52,356,881
I want to declare a pointer, have it hold a custom address and then assign a value to it: ``` void main() { char *ptr; ptr = (char *)0x123123; //the assignment works perfectly with a cast printf("%p\n", ptr); //and the pointer indeed holds the address it's supposed to *ptr = 'a'; //but this breaks ...
2018/09/16
[ "https://Stackoverflow.com/questions/52356881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9807062/" ]
> > 3rd assumption would be that such an address must be unavailable, > > > That is correct: on modern OSes (which all have memory protection) you can't write to arbitrary memory address. It used to be possible to access any memory on OSes that didn't utilize virtual memory (such as `MS-DOS`), but allowing that i...
The OP clarified elsewhere, that this is actually an XY problem. The X problem: reading/writing to arbitrary memory locations. The Y problem: implementing a linked list that uses consecutive memory. Of course, the answer to that is: one has to implement his complete own memory management system to get there. As in...
52,356,881
I want to declare a pointer, have it hold a custom address and then assign a value to it: ``` void main() { char *ptr; ptr = (char *)0x123123; //the assignment works perfectly with a cast printf("%p\n", ptr); //and the pointer indeed holds the address it's supposed to *ptr = 'a'; //but this breaks ...
2018/09/16
[ "https://Stackoverflow.com/questions/52356881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9807062/" ]
The OP clarified elsewhere, that this is actually an XY problem. The X problem: reading/writing to arbitrary memory locations. The Y problem: implementing a linked list that uses consecutive memory. Of course, the answer to that is: one has to implement his complete own memory management system to get there. As in...
writing to some arbitrary memory address is dangerous and not allowed by modern operating systems, better to create a memory blob and write to that. e.g. using malloc : ``` ptr = malloc(32); // now you can write to this memory block and it perfectly legal *ptr = 'a'; ```
2,221,371
I’m looking for positive integer solutions to $x^n+y^n+z^n=u^n+v^n+w^n=p$, where $p$ is prime. **Background.** I was looking at “Primes which are the sum of three nonzero 8th powers” <https://oeis.org/A283019> and the like, and wondered if there are rules similar to those for a prime being the sum of two squares. **...
2017/04/06
[ "https://math.stackexchange.com/questions/2221371", "https://math.stackexchange.com", "https://math.stackexchange.com/users/340536/" ]
Taxicab numbers can be generalised to any number of terms. With credit to Duncan Moore, author of [Generalised Taxicab Numbers and Cabtaxi Numbers](http://duncan-moore.netau.net/taxicab/index.htm) where I found suitable solutions, I can contribute: $$809^6+1851^6+2443^6=1277^6+1491^6+2489^6=253089021060516507491$$ $$5...
Using Duncan Moore’s solutions, I’ve found that solutions for $n=5$ are not as rare as I thought earlier. Here are a few of the smallest; many of these also have $x+y+z=u+v+w$. $$80^5+219^5+270^5=132^5+154^5+283^5=1941923897099$$ $$317^5+1008^5+1052^5=413^5+642^5+1172^5=2332329237198157$$ $$195^5+537^5+1267^5=970^5+10...
2,221,371
I’m looking for positive integer solutions to $x^n+y^n+z^n=u^n+v^n+w^n=p$, where $p$ is prime. **Background.** I was looking at “Primes which are the sum of three nonzero 8th powers” <https://oeis.org/A283019> and the like, and wondered if there are rules similar to those for a prime being the sum of two squares. **...
2017/04/06
[ "https://math.stackexchange.com/questions/2221371", "https://math.stackexchange.com", "https://math.stackexchange.com/users/340536/" ]
Taxicab numbers can be generalised to any number of terms. With credit to Duncan Moore, author of [Generalised Taxicab Numbers and Cabtaxi Numbers](http://duncan-moore.netau.net/taxicab/index.htm) where I found suitable solutions, I can contribute: $$809^6+1851^6+2443^6=1277^6+1491^6+2489^6=253089021060516507491$$ $$5...
I just have a look at the primes solutions on my website [Equal Sums of Like Powers](http://eslpower.org/eslp.htm#IdeaPrimeSolutions), and find a very interesting one for your question. $$19+179+241=43+139+257=439$$ $$19^3+179^3+241^3=43^3+139^3+257^3=19739719$$ All the numbers, including $x=19,y=179,z=241,u=43,v=139...
28,203,214
Haskell IO is often explained in terms of the entire program being a pure function (`main`) that returns an IO value (often described as an imperative IO program), which is then executed by the runtime. This mental model works fine for simple examples, but fell over for me as soon as I saw a recursive `main` in [Learn...
2015/01/28
[ "https://Stackoverflow.com/questions/28203214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/699224/" ]
In this case, `main` is a *value* of type `IO ()` rather than a function. You can think of it as a sequence of `IO a` values: ``` main = getLine >>= putStrLn >> main ``` This makes it a recursive value, not unlike infinite lists: ``` foo = 1 : 2 : foo ``` We can return a value like this without needing to evaluat...
The value `main` denotes is an infinite program: ``` main = do line <- getLine putStrLn line line <- getLine putStrLn line line <- getLine putStrLn line line <- getLine putStrLn line line <- getLine putStrLn line line <- getLine putStrLn line ... ``` But it's *represented* in memory as a re...
54,865,997
I dont have a clear concrete understanding of why we write e.target.name into the state definition statement in react. Who can explain ? thanks in advance. ``` checkboxChange(e) { let state = { ...this.state, [e.target.name]: !this.state[e.target.name] }; ... ``` why we write ``` [e.target.name]: !this.state[...
2019/02/25
[ "https://Stackoverflow.com/questions/54865997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7542172/" ]
If an input's name is "email" or "password" you can easily set that state key without defining a separate function for each input. For email and password it would be like: ``` <input name="email" onChange={this._handleChange} /> <input name="password" onChange={this._handleChange} /> ``` And the function would be ...
Let's say that in your state you have something like this: ``` state = { privacyAccepted: false } ``` Now, you can manage that value with a simple checkbox: ``` <input type="checkbox" name="privacyAccepted" ... /> ``` Once you attach an event handler to this checkbox, you can access the target from the ge...
32,398,752
I'm having a problem. I'm trying do ajax on my own, but I have problem with saving result from ajax call. I want it to do just like jQuery does, or similarly. So, I have a function called ajax, with I parameter, and this parameter is an object with properties like: method, url, async, data, and success ... When I call ...
2015/09/04
[ "https://Stackoverflow.com/questions/32398752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5300735/" ]
You want to call the method, not set it. ``` arg.success(xmlhttp.responseText); ```
``` var ajax = function (arg) { if (typeof arg.method !== "undefined" && typeof arg.url !== "undefined" && typeof arg.async !== "undefined" && typeof arg.success !== "undefined" && typeof arg.data !== "undefined") { var xmlhttp, i = 0, versions = [ "MSXML2.XmlHttp.6.0", ...
32,398,752
I'm having a problem. I'm trying do ajax on my own, but I have problem with saving result from ajax call. I want it to do just like jQuery does, or similarly. So, I have a function called ajax, with I parameter, and this parameter is an object with properties like: method, url, async, data, and success ... When I call ...
2015/09/04
[ "https://Stackoverflow.com/questions/32398752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5300735/" ]
You want to call the method, not set it. ``` arg.success(xmlhttp.responseText); ```
If you got **status 200** and there is some **data** that is from **server**. **With callback**: If need someting to return you can use callback. ``` var ajax = function (arg) { if (typeof arg.method !== "undefined" && typeof arg.url !== "undefined" && typeof arg.async !== "undefined" && typeof arg.succe...
28,482
Specifically, if we look at any transaction on the Ethereum blockchain, is the TimeStamp based on when the transaction is generated (like when you click generate transaction on MEW), or is it based on when the transaction was successfully sent from whatever node generated that transaction?
2017/10/15
[ "https://ethereum.stackexchange.com/questions/28482", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/20931/" ]
When watching for events from web3, this is the format of the result you get when one is called: ``` { address: '0x9c0ac1e0f0a8e0b01c7b652d5fbe094ddff48b81', blockNumber: 704227, transactionHash: '0x5887ba4e15d51e1cfddf626ecf416a0002085a1e0929fffe1f90ad69d5040081', transactionIndex: 0, blockHash: '0x5f485133ec...
To accept tokens as payment all you need is an Ethereum account. Tokens can be sent to any address. To receive them, the people who own the tokens simply have to send them in a transaction on the network. I'm assuming that whoever deployed the contract to mint the tokens probably also created a front end user interface...
28,482
Specifically, if we look at any transaction on the Ethereum blockchain, is the TimeStamp based on when the transaction is generated (like when you click generate transaction on MEW), or is it based on when the transaction was successfully sent from whatever node generated that transaction?
2017/10/15
[ "https://ethereum.stackexchange.com/questions/28482", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/20931/" ]
When watching for events from web3, this is the format of the result you get when one is called: ``` { address: '0x9c0ac1e0f0a8e0b01c7b652d5fbe094ddff48b81', blockNumber: 704227, transactionHash: '0x5887ba4e15d51e1cfddf626ecf416a0002085a1e0929fffe1f90ad69d5040081', transactionIndex: 0, blockHash: '0x5f485133ec...
The function you need to make this is `transfer(address, value)`. You have to be the owner of the contract to call this function. You can make this changes locally using ganache and calling the method transfer(address, value) from your contract. If you want to make this directly in the EVM you need to use Infura that ...
72,729,167
I am working with a **laravel 8** app, I want to get the route name which we write in the ->name() method. Basically want to print this name in title of page. [->name() method in the laravel 8, Laravel Routes](https://i.stack.imgur.com/fPkbw.png) `Route::view('/documents_for_approvals','document_approval')->name('Doc...
2022/06/23
[ "https://Stackoverflow.com/questions/72729167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16984276/" ]
In your View : ``` {{Route::current()->getName()}} ``` If you want to show the current route name in the browser Tab foreach pages add this to your layout view ``` <title>{{Route::current()->getName()}}</title> ```
Go to project and open a command line and write the line below ``` php artisan route:list --path=documents_for_approvals ``` Update [![enter image description here](https://i.stack.imgur.com/oEgCe.png)](https://i.stack.imgur.com/oEgCe.png)
36,687
My question is a bit more specific as it is indeed well known that investors expect higher returns in times of higher risks/volatility. However, isn't it counterintuitive to expect the market to achieve higher returns when the economy is slowing down ? For example, if we have a look at the current economic situation, ...
2020/05/16
[ "https://economics.stackexchange.com/questions/36687", "https://economics.stackexchange.com", "https://economics.stackexchange.com/users/28006/" ]
You can't really estimate stock prices this way because it's forward looking (i.e. it considers the future, not so much the past). Example: Suppose company A lost \$100 million this year, but next year it's going to earn \$100 million. How much is company A worth? If you naively used the P/FCF ratio (price-to-free-cas...
This six page reference describes valuation models based on several distinct definitions of discounted cash flow analysis: [http://educ.jmu.edu/~drakepp/general/FCF.pdf](http://educ.jmu.edu/%7Edrakepp/general/FCF.pdf) Stock prices in secondary markets are set by a combination of factors including concepts of market p...
51,881,460
I have written a code for the below problem statement which works fine for most of the inputs. But it doesn't work for input like 1,1,1,1,1,1,1,3. The answer should be 11/13 11:11 but it returns 0 (which means it couldn't find a valid date). I understood why this is happening but i could not find a solution for this. ...
2018/08/16
[ "https://Stackoverflow.com/questions/51881460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6261693/" ]
Your only problem seems to be this: ``` if (list[i] > [i + 1]) ``` Should be: ``` if (list[i] > list[i + 1]) ``` That stopped the algorithm from hanging for me and also seems to sort correctly.
Use .charCodeAt(array location) method for each string to sort.
51,881,460
I have written a code for the below problem statement which works fine for most of the inputs. But it doesn't work for input like 1,1,1,1,1,1,1,3. The answer should be 11/13 11:11 but it returns 0 (which means it couldn't find a valid date). I understood why this is happening but i could not find a solution for this. ...
2018/08/16
[ "https://Stackoverflow.com/questions/51881460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6261693/" ]
Your only problem seems to be this: ``` if (list[i] > [i + 1]) ``` Should be: ``` if (list[i] > list[i + 1]) ``` That stopped the algorithm from hanging for me and also seems to sort correctly.
Try default sort function in js. ``` var numbers = [3, 2, 1]; var letters = ["c", "b", "a"]; alert(numbers.sort()); alert(letters.sort()); ```
48,085,695
Basically, I want to take a screenshot of an entire scrollView. I've tried so many methods, but couldn't find the perfect one. I've tried following: ``` public void takeScreenShot() { mbitmap = getBitmapOFRootView(); createImage(mbitmap); } public void createImage(Bitmap bmp) { String path = Environment...
2018/01/03
[ "https://Stackoverflow.com/questions/48085695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6537332/" ]
I'd go with some more advanced tools like [`mechanize`](https://github.com/python-mechanize/mechanize) or [`MechanicalSoup`](https://github.com/MechanicalSoup/MechanicalSoup). The latter is actually based on `requests` internally (I assume you meant [`requests`](http://docs.python-requests.org/en/master/) package by "r...
Try something like this: (prob need to make some modifications but it will be close to what you want this example is for login form): install lxml ``` import requests from lxml import html payload = { "username": "<USER NAME>", "password": "<PASSWORD>", "csrfmiddlewaretoken": "<CSRF_TOKEN>" } sessionReq = request...
48,085,695
Basically, I want to take a screenshot of an entire scrollView. I've tried so many methods, but couldn't find the perfect one. I've tried following: ``` public void takeScreenShot() { mbitmap = getBitmapOFRootView(); createImage(mbitmap); } public void createImage(Bitmap bmp) { String path = Environment...
2018/01/03
[ "https://Stackoverflow.com/questions/48085695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6537332/" ]
I'd go with some more advanced tools like [`mechanize`](https://github.com/python-mechanize/mechanize) or [`MechanicalSoup`](https://github.com/MechanicalSoup/MechanicalSoup). The latter is actually based on `requests` internally (I assume you meant [`requests`](http://docs.python-requests.org/en/master/) package by "r...
You have to look at the DevTools Network tab while posting a form. Every form will have different request url and post parameters. Generally, what you will need to do with `requests` is something like that: ``` req = requests.post('https://mywebsite.com/pageB', data = {'fieldB':'value_you...
48,085,695
Basically, I want to take a screenshot of an entire scrollView. I've tried so many methods, but couldn't find the perfect one. I've tried following: ``` public void takeScreenShot() { mbitmap = getBitmapOFRootView(); createImage(mbitmap); } public void createImage(Bitmap bmp) { String path = Environment...
2018/01/03
[ "https://Stackoverflow.com/questions/48085695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6537332/" ]
You have to look at the DevTools Network tab while posting a form. Every form will have different request url and post parameters. Generally, what you will need to do with `requests` is something like that: ``` req = requests.post('https://mywebsite.com/pageB', data = {'fieldB':'value_you...
Try something like this: (prob need to make some modifications but it will be close to what you want this example is for login form): install lxml ``` import requests from lxml import html payload = { "username": "<USER NAME>", "password": "<PASSWORD>", "csrfmiddlewaretoken": "<CSRF_TOKEN>" } sessionReq = request...
562,319
I want to prepare code listing which looks like this: [![enter image description here](https://i.stack.imgur.com/pQ9G4.png)](https://i.stack.imgur.com/pQ9G4.png) I tried this: ``` \lstset{escapeinside={<@}{@>}} \begin{lstlisting} <@\textcolor{blue}{void}@> fun(var<<@\textcolor{blue}{long int}@>> list) \end{lstlist...
2020/09/11
[ "https://tex.stackexchange.com/questions/562319", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/59722/" ]
You need to keep the verbatim/listing text out of the arguments of other macros, and also out of escaped regions. [![enter image description here](https://i.stack.imgur.com/ZOsXz.png)](https://i.stack.imgur.com/ZOsXz.png) ``` \documentclass{article} \usepackage{listings} \usepackage{color} \def\z#1{\gdef\zz{\color{...
You can define you own listing environment and assign different colors to lists of keyword you define: ``` \documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage[procnames]{listings} \usepackage{color} \lstnewenvironment{myCode}[1][]{ \lstset{ emph={void,long,int}, emphstyle=\color{blue}, e...
23,885,894
I am just debugging a weird scenario where the scroll movement in an overlay is passed to the underlying element once it reaches its bounds. So when the overlay has no room for scrolling (hence when you hit the elastic top/bottom part), the background layer begins to scroll. I tried several solutions, and also checked...
2014/05/27
[ "https://Stackoverflow.com/questions/23885894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Yep it's annoying. Try using *-webkit-overflow-scrolling: touch* for the overlay and *-webkit-transform: translateZ(0)* on your page-wrap. Hope it helps.
Javascript Fix -------------- We can catch the touch events on the overlay and stop in propagating to other elements. `<nav id="overlay"> <!-- The overlay -->` ``` document.getElementById('overlay').addEventListener("touchmove", function(e) { e.preventDefault(); }, true); ``` This prevents the scrolling of...
39,270,896
I have created Docker containers using `docker-compose.yml` on a single host. Can anybody tell if `docker-compose.yml` file can be used to start Docker containers on multiple VMs ? If yes, how?
2016/09/01
[ "https://Stackoverflow.com/questions/39270896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6783095/" ]
Yes, that's the expected and documented behavior. [Quote from the JavaDocs](http://docs.oracle.com/javase/8/docs/api/java/sql/Date.html) > > To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and millise...
Just change your import from `java.sql.Date` TO `java.sql.Timestamp`
39,270,896
I have created Docker containers using `docker-compose.yml` on a single host. Can anybody tell if `docker-compose.yml` file can be used to start Docker containers on multiple VMs ? If yes, how?
2016/09/01
[ "https://Stackoverflow.com/questions/39270896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6783095/" ]
Yes, that's the expected and documented behavior. [Quote from the JavaDocs](http://docs.oracle.com/javase/8/docs/api/java/sql/Date.html) > > To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and millise...
tl;dr ===== ``` myPreparedObject.setObject( 1 , myJavaUtilDate.toInstant() // Convert legacy object to modern java.time object, `Instant`. ) ``` Details ======= The other Answers are correct. The `java.util.Date` class represents a date *and* a time-of-day in UTC. The `java.sql.Date` represents only a date...
57,049,753
I've been really intrigued about `async / await` syntax recently and I've been experimenting with it for a while. In this particular problem, my goal is to execute the callback function after all the promises are made, if possible. I had no idea how to apply my ideas in real life situations so I expected the funct...
2019/07/16
[ "https://Stackoverflow.com/questions/57049753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11650686/" ]
I think if you already used async/await, maybe you don't need to use callback anymore. The purpose of async/await functions is to simplify the behavior of using promises, and avoid callback hell too. Hope the example below could help. ```js function endTask (task) { // finalizes tasks } async function doSomethin...
Yes, `async` functions can take and call callbacks just like any other function, but that pretty much defeats the purpose of using an `async` function. There are some cases where there is a valid reason to do this (see Dave Newton's comment below), but this isn't one of them. Instead, you should do something like this...
57,049,753
I've been really intrigued about `async / await` syntax recently and I've been experimenting with it for a while. In this particular problem, my goal is to execute the callback function after all the promises are made, if possible. I had no idea how to apply my ideas in real life situations so I expected the funct...
2019/07/16
[ "https://Stackoverflow.com/questions/57049753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11650686/" ]
The purpose of the async/wait functionality is to reduce the complexity called [Callback Hell](http://callbackhell.com/). Async functions effectively removes the necessity of passing around callback functions. However, one can still pass a callback function to an async function as a reference to be called later in his...
Yes, `async` functions can take and call callbacks just like any other function, but that pretty much defeats the purpose of using an `async` function. There are some cases where there is a valid reason to do this (see Dave Newton's comment below), but this isn't one of them. Instead, you should do something like this...
54,126
Matthew 1:18 (NIV) > > This is how the birth of Jesus the Messiah came about[a]: His mother > Mary was pledged to be married to Joseph, but before they came > together, she was found to be pregnant through the Holy Spirit. > > > It says Mary became pregnant through the Holy Spirit, but how does one rule-out the i...
2021/01/02
[ "https://hermeneutics.stackexchange.com/questions/54126", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/32532/" ]
First, the text eliminates the possibility that Joseph’s seed contributed to the conception because it said Mary was found pregnant (lit., “having in her womb”) while she and Joseph were betrothed and before she and Joseph came together (i.e., had intercourse). Notice the phrase at the end: «ἐκ πνεύματος ἁγίου». The t...
Here is the passage from the ancient Greek translation to which he appeals: > > [Isaiah 7:14](https://studybible.info/Brenton/Isaiah%207:14) > Brenton(i) 14 Therefore the Lord himself shall give you a sign; behold, a virgin shall conceive in the womb, and shall bring forth a son, and thou shalt call his name Emmanuel...