input
stringlengths
51
42.3k
output
stringlengths
18
55k
ts-node will not compile official Discriminated Unions example <p>Here is the official example for discriminated Unions from <a href="https://www.typescriptlang.org/docs/handbook/advanced-types.html" rel="nofollow">here</a>. It won't pass the compiling through <a href="https://www.npmjs.com/package/ts-node" rel="nofoll...
<p><code>ts-node</code> brings in the 1.8 compiler (see its <code>package.json</code> on github). You can ask the package author to update to the 2.0 compiler.</p>
COLDFUSION Delete and Edit Checkboxes <p>Attempting to make a ColdFusion edit and delete section on an admin page. The checkboxes can be selected and then either edit or delete the selected user.</p> <p>Below is the code.</p> <pre><code>&lt;td&gt; &lt;input type = "text" name = "firstname" value = "#firstname#"&...
<pre><code>&lt;input type="radio" name="action" value="Edit"&gt; Edit &lt;br&gt; &lt;input type="radio" name="action" value="Delete"&gt; Delete &lt;br&gt; &lt;input type="submit" name="submit" value="Submit Changes" id = "Submit"&gt; &lt;!-- Action Page--&gt; &lt;cfif isDefined("FORM.action") AND #Form.action# eq "Del...
Rearrange table in Excel <p>In Excel, I need to convert entries like this one:</p> <p><pre><code> +------------+-------------------+--------+ | Date | Details | Amount | +------------+-------------------+--------+ | 15/02/2016 | Payment type | 37.42 | +------------+-------------------+--------+ |...
<p>Try this code:</p> <pre><code>Option Explicit Sub move_details() Dim rw, last_rw, offset, cl As Integer Application.ScreenUpdating = False Application.Calculation = xlCalculationManual rw = 1 cl = 4 While Cells(rw, 2) &lt;&gt; "" If Trim(Cells(rw, 1)) = "" Then Cells(rw - 1, cl) = Cells(rw, 2) ...
How to enter a while loop unless three conditions succeed simultaneously <p>I'm trying to create a complex condition consisting of three smaller conditions, to be used in a while loop. I always want to enter the loop except when all three conditions are met simultenously. The way I have it now, if only one of these mee...
<p>If I understand what you're trying to say you want the while loop to proceed <em>except</em> in the specific scenario that a=1, b=2, and c=5 (as opposed to just one of them having that value).</p> <p>Therefore the correct statement that you're trying to relay is "proceed when (a==1 &amp;&amp; b == 2 &amp;&amp; c==5...
Teradata volatile table setting field too large <p>I'm trying to re-run an old query and have been hitting row size issues. After a few workarounds I've gotten all but two of the values added to the table that I need. Whenever I try to add the last two fields I get some form of "This will make the maximum row length to...
<p>If this query worked before you had a different character set for your session. </p> <p>When you get a <em>9804: Response Row size or Constant Row size overflow</em> it's usually due to session using UTF-8 or UTF-16 as a character set. </p> <p>The columns are probably defined as LATIN (i.e. a single byte per char...
two way data bind using jquery <p>We need to bind such like two way binding . When i change value at also display value in content using Javascript or Jquery.. </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js ...
<p>Rather than appending the value of <code>demo</code> you should just be replacing the value with the value in the textbox.</p> <pre><code>document.getElementById("demo").innerHTML = document.getElementById("text1").value; </code></pre> <p><a href="https://jsfiddle.net/03gkm4wh/" rel="nofollow">https://jsfiddle.net...
skip_before_action and Rails 5 <p>I just upgraded to Rails 5 and everything went pretty smoothy but for no apparent reason a method that is called after <code>skip_before_action</code> is not allowing rspec to run with this message <code>Before process_action callback :redirect_heroku_user has not been defined (Argumen...
<p>According to <a href="https://github.com/lynndylanhurley/devise_token_auth/issues/500" rel="nofollow">this thread</a></p> <blockquote> <p><a href="https://github.com/rails/rails/blob/6dfab475ca230dfcad7a603483431c8e7a8f908e/activesupport/lib/active_support/callbacks.rb#L634" rel="nofollow">ActiveSupport::Callback...
How do I refer to Java classes in the same directory? <p>I have an SBT project that has a number of classes declared as java files. Two of them are Table.java and LinHashMap.java. They are both in the src/main/java/cs4370 directory. I want to create and refer to a LinHashMap object in the Table class. I thought t...
<p>You need to declare them as being in the same package :</p> <pre><code>package mypackage; </code></pre> <p>Being in the same folder only implies that the compiler will know where to look for the files. Being in the same package is required to not have to use fully specified class name. </p> <p>That is actually th...
Rails GET request pulling down previously downloaded data <p>I'm working with an external API to receive pending orders. I've successfully written a GET request method that saves any pending orders to PostgreSQL.</p> <p>The issue I'm having is that during each GET request, I'm creating duplicates because it's download...
<p>Do you have control of the remote server too? can you update it to only send you things you haven't fetched before? if not, then how about asking for only posts that have been created after date X (which is the date of the last time you fetched)? if not, then fetch them all, and just check your db and only create a ...
Limit the number of rows of autocomplete result , and match strings with starting letters only <p>I'm using jquery autocomplete in my project,</p> <pre><code>&lt;div class="ui-widget"&gt; &lt;label for="tags"&gt;Tags: &lt;/label&gt; &lt;input id="tags"&gt; &lt;/div&gt; </code></pre> <p>Json file</p> <pre><code>[ ...
<p>HTML</p> <pre><code>&lt;div class="ui-widget"&gt; &lt;label for="tags"&gt;Tags: &lt;/label&gt; &lt;input id="tags"&gt; &lt;/div&gt; </code></pre> <p>Here I have no idea whether you are getting json data in your js file or not , So In my case json data is available in js file and I am accessing json data in my ...
How do enable debug() logging for modules used in my RN project? <p>I'm using React-Native 0.33.</p> <p>Lots of modules I depend on have debug logs, which use the NPM debug() module. They require an ENV var to be set, i,e. "export DEBUG=*" to enable the logs.</p> <p>React-Native doesn't really allow setting ENV vars....
<p>At the <em>very beginning</em> of your app launch in <code>index.ios.js</code> <em>before</em> you import any of your modules, you could do something like</p> <pre><code>const debug = require('debug'); debug.enable('*'); // or use specific subkeys </code></pre> <p>This will make sure that that subsequent calls li...
Vue Transition Not Affecting Each Element <p>I have a container with two elements that I would like to toggle with a click. </p> <p>I'd like to have the visible element slide out while the new element slides in, but the transition only affects the first child (i.e. logo) while the second child (i.e. version) does a si...
<p>It turns out that this was not an issue of transitions, but of the child elements not having the <code>position: absolute; top: 0; left: 0;</code> properties, so that the transitions on each element could be seen from beginning to end.</p>
How to access the current response's status_code in Flask's teardown_request? <p>I'm interfacing with an internal logging system and I'd like to obtain the current response's <code>status_code</code> from within Flask's <code>teardown_request</code> callback: <a href="http://flask.pocoo.org/docs/0.11/api/#flask.Flask.t...
<p>You can't. <code>teardown_request</code> is called as cleanup after the response is generated, it does not have access to the response. You should use the <code>request_finished</code> signal or <code>after_request</code> decorator if you need access to the response from within Flask. <code>teardown_request</code...
How can I repeatedly play a sound sample, allowing the next loop to overlap the previous <p>Not sure if this isn't a dupe, but the posts I found so far didn't solve my issue. </p> <hr> <p>A while ago, I wrote a (music) <a href="http://askubuntu.com/a/814889/72216">metronome for Ubuntu</a>. The metronome is written in...
<p>You can use <a href="https://github.com/jiaaro/pydub" rel="nofollow">pydub</a> for audio manipulation , including playing repetedly.</p> <p>Here is an example. You can develop this further using examples from <a href="http://pydub.com/" rel="nofollow">pydub site.</a></p> <pre><code>from pydub import AudioSegment f...
The method ____ is undefined for the type ____ <p>Okay so I have a homework assignment and I'm having difficulty calling a method on my main class that is in another class. </p> <p>Basically the "test" method is in the landEnclosure.java class and I'm trying to call it on my main class which is landAndEat.java</p> <p...
<p>In java the only top level "things" are classes (and similar stuff such as interfaces and enums). Functions are not top level "things". They can exist only inside a class. Thus to call it you need to go through that class, or through an object of that class. </p> <p>From the code you have written it seems that test...
Unable to mock class methods using unitest in python <p>module <code>a.ClassA</code>:</p> <pre><code>class ClassA(): def __init__(self,callingString): print callingString def functionInClassA(self,val): return val </code></pre> <p>module <code>b.ClassB</code>:</p> <pre><code>from a.ClassA im...
<p>You assigned to <code>return_value</code> twice:</p> <pre><code>classAmock.return_value=dummyMock classAmock.return_value=Mock() </code></pre> <p>That second assignment undoes your work setting up <code>dummyMock</code> entirely; the new <code>Mock</code> instance has no <code>functionInClassA</code> attribute set...
Remove Wordpress Plugin functionality from admin side <p>I'm using a WordPress plugin <a href="https://github.com/lesterchan/wp-postratings" rel="nofollow">https://github.com/lesterchan/wp-postratings</a>. It also showing ratings on admin, when i visit <a href="http://domain.com/wp-admin/edit.php" rel="nofollow">http:/...
<p>You can use the below function in your functions.php file with the <a href="https://developer.wordpress.org/reference/hooks/manage_posts_columns/" rel="nofollow">manage_posts_columns</a> filter. I'm assuming your custom post type id 'tools' and the column is referenced by 'ratings'. If they are different you can jus...
How to stop Python 3 printing none <p>how do I stop this from printing none at the end. Or is it inevitable? </p> <pre><code>x = int(input("Please enter a number to print up to.")) def print_upto(x): for y in range(1,x+1): print(y) print(print_upto(x)) </code></pre> <p>Many thanks.</p>
<p>instead of </p> <pre><code>print(print_upto(x)) </code></pre> <p>on the last line, just do, </p> <pre><code>print_upto(x)` </code></pre> <p>thats it, and it will work fine.</p>
How to retry windows service startup if db is offline with castle windsor and nhibernate facility? <p>Problem: If the DB is offline when this service is started, this service will not start as it fails inside this line: <code>var container = new BootStrapper().Container;</code> on start.</p> <pre><code>private stati...
<p>You need to divide your startup actions into two categories:</p> <ol> <li><p>Actions that must happen fairly immediately and/or won't fix themselves in case of failure. Things such as a mandatory configuration file missing, for which administrator intervention would be required.</p></li> <li><p>Actions that we're O...
How to loop chi sq test in R <p>I have the table with alternative and reference allele counts. How could I loop chi sq test in R to run it for each row? I attached the picture of my table. I need to perform chi sq test with altCount and refCount columns.</p> <pre><code> altCount refCount 8 6 3 ...
<p>The easiest loop for a beginner still is the for loop:</p> <pre><code>d &lt;- data.frame(a = c(8,3,4), b = c(6,7,9)) for(row in 1:nrow(d)){ print(row) print(chisq.test(c(d[row,1],d[row,2]))) } </code></pre> <p>The same can be done with</p> <pre><code>apply(d, 1, chisq.test) </code></pre> <p>The latter is...
How to insert twice of space "& nbsp " for each new line <p>I create an array with "split" and "join" when the array jump to a new line insert twice as much space as the previous and send it to a &lt; p> by GetElementById. This is my code:</p> <pre><code> &lt;script type="text/javascript"&gt; function myfuncti...
<p>consider using <code>.reduce()</code> instead of <code>.join()</code> - it gives much more flexibility at processing individual values and their concatenation. <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow">https://developer.mozilla.org/en/docs/Web...
Specifying opcache.blacklist_filename from .htaccess? <p>Is it possible to specify a 'blacklist filename' (opcache-blacklist.txt) from .htaccess (it's a shared host). I was thinking of putting this file in the /etc/ folder, something like:</p> <pre><code>php_value opcache.blacklist_filename "/etc/opcache-blacklist.txt...
<p>I found this setting:</p> <pre><code>php_flag opcache.enable Off </code></pre> <p>which appears to work (it needs to be added to a .htaccess in a directory that should be excluded from opcache).</p>
Can I use Kendo UI and Webix on same project? <p>I need to migrate an app to HTML 5 and I'm researching HTML 5 frameworks. So far I have Webix and Kendo ui as the 2 finalists. Now, each one has something that I need to use and that is better than on the other, so, I was thinking about using both of them if possible. So...
<p>There is one thing to consider with regard to styling - Kendo UI uses the content box model, while Webix uses the border box model.</p> <p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Introduction_to_the_CSS_box_model" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Bo...
Hartl Ruby on Rails tutorial 4 ch 10, users edit test fails <p>I am practicing Ruby on Rails by trying to create a custom website based off of Hartl's tutorial. Things have been going well so far but I am getting an error in the users edit test "Successful edit with friendly forwarding" in which the user is not redirec...
<p>I found out what my problem was, I forgot to add the store_location method to the logged_in_user method in the users_controller.</p>
INNER JOIN - Mysql and PHP <p>I'm having some problems with inner join in mysql.</p> <p>I have the following code:</p> <pre><code>DELETE T1,T2 FROM table1 AS T1 INNER JOIN table2 AS T2 ON T1.id = T2.pageid WHERE T1.ID = 2 </code></pre> <p>The problem here is if there's nothing in the table2 to delete.</p> <p>For ex...
<p>From your description, it appears that your <code>banners</code> table (table1) is dependent on table 2. </p> <p>The foreign key of table 1 references table 2, but table 2 "doesn't care" about table 1 (table 1 is the independent entity). When you delete an item from table 1, the data integrity is not ruined as ther...
How to prevent Browser cache on Angular 2 site? <p>We're currently working on a new project with regular updates that's being used daily by one of our clients. This project is being developed using angular 2 and we're facing cache issues, that is our clients are not seeing the latest changes on their machines.</p> <p>...
<p>Found a way to do this, simply add a querystring to load your components, like so:</p> <pre><code>@Component({ selector: 'some-component', templateUrl: `./app/component/stuff/component.html?v=${new Date().getTime()}`, styleUrls: [`./app/component/stuff/component.css?v=${new Date().getTime()}`] }) </code></pre...
groovy.json.JsonException: expecting '}' or ',' but got current char <p>I am trying to get a piece of code working for me and not having much luck. So I have broken the code down to this little snippet that is causing me grief. </p> <p>Can anyone help identify why in the world this error is happening?</p> <pre><code>...
<p>Json keys have to be in double quotes</p> <p>All your values are strings, so they also need to be in double quotes.</p> <p>Also you need <code>"key":"value"</code> instead of using <code>=</code></p> <pre><code>String index = '[{"accessCode":"d20in9t", "createdAt":"2016-09-22T18:27:47.904Z", "id":"22cbf7c2-5d4e-4...
separating user input number with spaces <p>I need to separate the number that the user inputs (up to five digits) with three spaces in between. So if the user inputs the number 12345, then the console prints out, "1 2 3 4 5".</p> <p>I just have the console printing out the number: </p> <pre><code>class Mai...
<pre><code>static void Main() { Console.Write("Please enter in a five digit number: "); Console.WriteLine(string.Join(" ", Console.ReadLine().ToCharArray())); Console.Read(); } </code></pre>
Trouble on running a Symfony Service <p>start working with symfony and got a problem with services. </p> <p>...\app\config\services.yml</p> <pre><code>app.pdf.service: class: AppBundle\Service\PdfService arguments: [format, orientation]] </code></pre> <p>...\src\AppBundle\Service\PdfService.php</p> <pre><co...
<p>Assume that format and orientation are well defined in your parameters, try : </p> <pre><code>app.pdf.service: class: AppBundle\Service\PdfService arguments: ["%format%", "%orientation%"] </code></pre> <p>An "hardcoded" definition example : </p> <pre><code>app.pdf.service: class: AppBundle\Service\Pdf...
Best way to write custom json messages using log4j2 <p>I have been using log4j for different kind of projects and have some experience with log4j2. All implementations used the default appender and layout. Currently i need to write a application which writes in json format. So i tried the log4j2 JSONLayout layout by se...
<p>I found a solution which works for me; <a href="https://github.com/savoirtech/slf4j-json-logger" rel="nofollow">slf4j-json-logger</a>. It is a slf4j framework, so should be included in the pom.xml. Sample project files;</p> <p><strong>pom.xml</strong></p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; ...
Remove text on web page - following a String ">" until end of span <p>I interact with a web page at work that overloads me with redundant information of the form:</p> <pre><code>Important text Other important text &gt;&gt; Not important 1 &gt;&gt; Not important 2 &gt;&gt; Not important 3 Other important text </co...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>Array.from(document.getElementsByTagName('span')).forEach( a =&gt; a.innerHTML = a.innerHTML.replace(/&amp;gt;.*/g,'') );</c...
Submitting a dynamically created form in jQuery <p>I am trying to submit a form that I dynamically created. I am using the .submit, but it is not working. Here is my code</p> <pre><code>var $message = $('.message'); $message.submit(function(e){ console.log("Test"); }); $(document.body).on('click','.button',...
<p>The problem is that the <code>submit</code> button isn't in the form. You're appending each <code>&lt;input&gt;</code> element to the <code>&lt;p&gt;</code>, not the <code>&lt;form&gt;</code>. The result is equivalent to this HTML, which has an empty <code>&lt;form&gt;</code>.</p> <pre><code>&lt;p&gt;Chat with ...
Why autowiring spring repositories doesn't work? <p>I have a controller where I autowire repository:</p> <pre><code>@Controller @RequestMapping("/account") @EnableJpaRepositories public class AccountController { @Autowired private AccountRepository accountRepo; //methods } </code></pre> <p>My repository ex...
<p>May be you need to have <strong>@EnableJpaRepositories</strong> annotation on a configuration class with <strong>@Configuration</strong> annotation instead of Controller class.</p> <p>Also, make sure your Configuration classes are under a scanned package.</p>
Microsoft Cognitive Serivces Bing News API how to search multiple languages in 1 query <p>I am attempting to use the V5 Bing News API. On the documentation here (<a href="https://msdn.microsoft.com/en-us/library/dn760793.aspx#news" rel="nofollow">https://msdn.microsoft.com/en-us/library/dn760793.aspx#news</a>) it shows...
<p>You can only get results from one language per API call. If you want to get results for multiple languages for the query, then you need to call the API twice passing the appropriate headers/params to customize the language. </p>
word frequency of string counter is sometimes wrong <p>I hope you can help me I worked on this code. The code works like this</p> <ul> <li>user inputs a string for example "hey john, how are you john?</li> <li>the program erases signs like "'?' , ',' '!' " etc.</li> <li><p>the program writes a string after erasing th...
<p>The most significant problem I found was in <code>extract_and_count()</code> -- it doesn't count the last word as it only counts words followed by space. The bandaid is to check if <code>string</code> has anything in it after the loop, and if so, process it. Below is my rework for that fix and general style:</p> ...
Return list of files recursively in Go, including root directory <p>Wonder if there is a quick way to get a list of files in a root directory that includes the root directory itself.</p> <pre><code> sourceDir, err := os.Open(startPath) if err != nil { return err } defer sourceDir.Close() files, err := so...
<p>This is what <a href="https://golang.org/pkg/path/filepath/#Walk" rel="nofollow"><code>filepath.Walk</code></a> is for.</p> <p>This will recursively print out every filename:</p> <pre><code>filepath.Walk(startPath, func(path string, info os.FileInfo, err error) error { fmt.Println(path) if err != nil { ...
How to sign AppX from Desktop App Converter <p>I have been trying to sign the AppX generated by the D.A.C. in order to verify it works as expected, but it seems a self signed certificate is not enough.</p> <p>I also tried to sign using my Comodo SHA256 certificate, but even if I make sure to use the same publisher nam...
<blockquote> <p>I have been trying to sign the AppX generated by the D.A.C. in order to verify it works as expected, but it seems a self signed certificate is not enough.</p> </blockquote> <p>We can use the <code>-Sign</code> flag when running the DAC to automatically sign your .appx package. Please see the details ...
Pandas Python- read_csv not reading complete data on each row <p>I'm using read_csv to read a fairly big csv in chunks (just reading the first line to test).</p> <pre><code>data = read_csv('VOD_Properties.csv', nrows=1, low_memory=False) print(data) </code></pre> <p>Result:</p> <pre><code> ...
<p>The full line was in fact read correctly, just when printing pandas truncates wide columns with ellipsis '...'.</p> <p>You can change pandas' column width display threshold as per: <a href="http://stackoverflow.com/questions/21028819/how-to-remove-ellipsis-from-a-row-in-a-python-pandas-series-or-data-frame">How to ...
Is there a way to get a reference to see the remaining time left in a Local Notification, and have it update? <p>I would like to show the user the remaining time left before the local notification is called. I can display the time, but it will not update. Is there a way to get the remaining time left in a local notific...
<p>UIApplication's has property called <a href="https://developer.apple.com/reference/uikit/uiapplication#//apple_ref/occ/instp/UIApplication/scheduledLocalNotifications" rel="nofollow">scheduledLocalNotifications</a> </p> <pre><code>NSMutableArray *notifications = [[NSMutableArray alloc] init]; [notifications addObje...
Require JS file in Chai TDD -- TypeError: is not a function <p>I'm new to using Chai for TDD. Wanted to run a function that I passed within a test file in Chai and check to see if its an object returned. Looks like I am not accessing the function right. </p> <p>I get this in terminal when running the test -- "TypeErr...
<p>You have not exported anything from your module. The way your <code>parser.js</code> module is setup, you could do:</p> <pre><code>var VASTParser = { parse:function(xml) { return xml; }, ... }; // Add this. module.exports = VASTParser; </code></pre> <p>And then it should work.</p>
AngularJS Select option using ng-repeat <p>Is it possible to pass the who object using ng-repeat in options? <br> Example: <br></p> <pre><code>&lt;select id="cREmp123" ng-model="vm.selEmployee"&gt; &lt;option value="" selected&gt;Choose...&lt;/option&gt; &lt;option ng-repeat="emp in vm.employeeList" value="vm.employe...
<p>Have you tried ng-options? </p> <p>Sample code for your reference</p> <pre><code> &lt;select id="cREmp123" ng-model="selEmployee" ng-options="employee as employee.strEmpFirstName for employee in employeeList"&gt; &lt;option value="" disabled selected&gt;- Please Choose -&lt;/option&gt; &lt;/select&g...
Is there a SIMPLE way to store passwords in Ionic2? <p>Native Android (and I guess iOS too) apps can easily store app private data (such as login credentials) to the private app data storage. This method is considerably secure (unless the user has rooted their phone...), but I don't see how can I reach this storage fro...
<p>I see that you want to store the password of your user, which is an important point. It is important to respect the privacy of your user, that's why I think, during sign in or first login, your server should return the encrypted password, and you should store only an encrypted password.</p> <p>Then, to store it you...
Basic Python range and slicing not working <p>Can someone explain what happened here? The slicing seems to be off isn't it? doing this on the interactive shell.</p> <pre><code>&gt;&gt;&gt; range(3,100,7)[0:5] range(3, 38, 7) </code></pre>
<p><code>range(3, 100, 7)</code> returns a <code>range</code> object. That <code>range</code> object understands slicing. Note that <code>list(range(3,100,7))[0:5]</code> is the same as <code>list(range(3,38,7))</code></p>
how to expect if item is present in the list <p>How can I compare a String with a List of <code>ng-repeat</code>: </p> <pre><code>this.TenantList = element.all(by.repeater("tenant in tenantList")); TenantList.getAttribute('aria-label').then(function(list) { //label contains 10 items and I want to see if this lis...
<p>You can actually make the expectation in one go with <code>toContain()</code> matcher:</p> <pre><code>expect(TenantList.getAttribute('aria-label')).toContain('Test'); </code></pre> <hr> <p>Note that there is no need to resolve the promise with <code>then()</code> - <code>expect()</code> is capable of understandin...
Regex: pattern for simple division string <p>I have a string that follows this pattern:</p> <p><code>2/9 (22%)</code></p> <p>where the <code>2</code> or the <code>9</code> could contain 1 or more digits. I need to parse out those two integers, so I came up with this pattern:</p> <pre><code>String patternString = "([...
<p>Use group 1. Group 0 will match the whole string</p> <pre><code>int i = Integer.parseInt(matcher.group(1)); </code></pre>
Call non static methods from another class <p>I'm have 2 classes. <code>Car</code> and <code>Attendant</code>.</p> <pre><code>public Attendant(int staffNum, String id, boolean available, attNm name, Cars assign) { this.staffNum = staffNum; this.id = id; this.available = available; this.name = name; ...
<p>First of all, it makes more sense to make the <code>Cars</code> class singular, ie <code>Car</code>.</p> <p>Background info: in the statement <code>Cars car1 = new Cars()</code>, <code>Cars</code> is the class, and <code>car1</code> is an instance of the <code>Cars</code> class. This issue is caused by confusing tw...
VBA macro hiding sheets <p>I know there are answers everywhere for my question but I've tried them all, I'm not sure what I am missing, or what have you. Basically I have about 20 tabs in an excel spreadsheet. On workbook open, I'm trying to hide them all, but this isn't working out. When my workbook opens, i see sheet...
<p>There's a few different ways we can go about having the Userform visible while the workbook isn't. </p> <p><strong>Minimize your workbook on open.</strong> </p> <pre><code>Private Sub Workbook_Open() 'This is in the Workbook Code Application.WindowState = xlMinimized UserForm1.Show xlModeless End Sub </cod...
Grab retweeted status text in loop <p>I am using the python script tweepy to scrape Twitter data; the scraped data is output as a csv. The retweets are truncated. I am looking for suggestions on how I could modify the code below to grab the "retweeted_status.text" if the retweeted_status is "True". It seems that I have...
<p>As you've discovered, the way Twitter handles retweets is a little strange.</p> <p>In the JSON representation of the tweet you have something which looks like this:</p> <p><code> - user: "you" - text: "RT @example this text gets truncated at the end of the tw..." - retweeted: "true" - retweeted_status:...
ansible playbook: setup and connect to docker (authentication or permission failure) <p>I am trying to write an ansible playbook that sets up some docker containers and then runs a role on them:</p> <pre><code>- hosts: localhost gather_facts: no vars: - docker_test_hosts: - container_name: 'test_precise' ...
<p>First of all: You need to keeps your docker containers running, so using </p> <pre><code>- docker_container: name: '{{item.container_name}}' image: '{{item.image_name}}:{{item.image_tag}}' command: tail -f /dev/null pull: yes </code></pre> <p>Should lead to a changed error message: <code>fatal: [test_trust...
Popover keeps presenting modally <p>I'm trying to add a popover when an image is tapped but it keeps being presented modally. Every answer to this question/ topic suggest to add <em>adaptivePresentationStyleForPresentationController</em> but it won't work for me. I'm trying to do this on an iPhone. Here's my code:</p> ...
<p>Also add:</p> <pre><code>func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -&gt; UIModalPresentationStyle{ return .None } </code></pre>
Is bean-discovery-mode="all" required to @Inject a bean into a Jersey @Path JAX-RS resource? <p>I am using Payara 4.1.1.161. I have a Jersey @Path JAX-RS resource and all I want to do is @Inject a bean into it using CDI. I've tried lots of different combinations to get this to work, but so far the only way I've gotte...
<p>Your JAX-RS resource class needs to have a bean defining annotation to enable injection of the CDI bean. Just add <code>@ApplicationScoped</code> or <code>@RequestScoped</code> to your JAX-RS resource and bean injection should then work without bean discovery mode of all.</p> <p>BTW I'm assuming the <code>InjectMe<...
How to split delimited values in a SQLite column into multiple columns <p>How can I parse comma separated values in <code>Fruit Basket</code> and move them to other columns. </p> <p>For example, I want this</p> <pre><code>Fruit Basket Fruit1 Fruit2 Fruit3 ------------ -------- -------- -------- Apple Banana...
<p>Check the man page : </p> <pre><code>man sqlite3 | less +/-csv </code></pre> <p>Then use </p> <pre><code>sqlite ... -csv | ... </code></pre> <p>the output will be quit more easy to parse</p>
How to add new email to CNMutableContact in Swift 3? <p>Quickly .. I have this code to add new contact , it was working until converting my code to Swift 3 , now it accept all properties except the email I get two errors :</p> <blockquote> <p>1-Argument type 'String?' does not conform to expected type 'NSCopying'<...
<p>In Swift 3, <code>CNLabeledValue</code> is declared as:</p> <pre><code>public class CNLabeledValue&lt;ValueType : NSCopying, NSSecureCoding&gt; : NSObject, NSCopying, NSSecureCoding { //... } </code></pre> <p>You need to make Swift able to infer the <code>ValueType</code>, which conforms to <code>NSCopying</co...
how can i split a string into tokens and store the tokens in a differents variables, C language <p>hi i have this code in C language : that split a string into tokens but what i want is that the tokens get store in different variables for example: a[]=+5000 b[]=-9000 c[]=7HH4 d[]= 0 because after the last comma i want...
<p>Just keep track of how many times you called <code>strtok</code>, and copy the string to the appropriate place each time.</p> <pre><code>char a[50], b[50], c[50]; int count = 0; char *token = strtok(str, ","); // Keep printing tokens while one of the // delimiters present in str[]. while (token != NULL) { pri...
How do I delete all image files with same album id? <p>I have a two tables, one with all the pictures (called billeder, its danish), that have foreign key (in my code called 'album') that tells witch album it belongs to, and then I have the one with albums, with the primary key (alb_id). So i can eval the pictures from...
<p>Given that you have the image path in the <code>billeder</code> table you can query them before you delete the rows from the table:</p> <pre><code>cmd.CommandText = "select imagePath FROM billeder WHERE album = @id"; var result = cmd.ExecuteQuery(); </code></pre> <p>Then loop over the result set deleting each imag...
no .mat files generated deeplab <p>When I test Deeplab-ver2 on PASCAL VOC 2012 dataset, the test net generates only log files of huge size with an output [see the below log] but it doesn't generate any .mat files in features/deeplab_largeFOV/val/fc8 folder. My network runs without any errors and does'nt terminate even ...
<p>Here is the rest of the log file: </p> <pre><code> I0920 12:57:35.971684 12793 image_seg_data_layer.cpp:145] output data_dim size: 1,1,1,2 I0920 12:57:35.997220 12793 net.cpp:150] Setting up data I0920 12:57:35.997285 12793 net.cpp:157] Top shape: 1 3 513 513 (789507) I0920 12:57:35.997301 12793 net.cpp:157] Top...
Does ::operator delete( void * ) know the size of memory allocated with ::operator new( size_t ) <p><strong>Context:</strong></p> <p>I am trying to create a custom allocator which mimics <code>std::allocator</code> <em>(not derived from)</em> in some ways, but allows instanced allocators. My generic containers have co...
<p>Calling <code>::delete</code> on a pointer returned from a call to <code>::new</code> is safe. Calling <code>::delete[]</code> on a pointer returned from a call to <code>::new[]</code> is safe. Calling <code>delete x</code> on a pointer returned from a call to <code>auto x = new {...}</code> is safe if you don't awa...
Value of type DictionaryLiteral<_,_> does not conform to 'Any' in coersion <p>I am attempting to set up custom video compression in swift based off of this SO post that used Obj-C instead (<a href="http://stackoverflow.com/questions/11751883/how-can-i-reduce-the-file-size-of-a-video-created-with-uiimagepickercontroller...
<p>I do not understand why you need this line:</p> <pre><code> DictionaryLiteral : (Key: AVVideoCodecKey, Object: AVVideoCodecH264), </code></pre> <p>Seeing the linked thread, you can write something like this:</p> <pre><code> var videoWriterCompressionSettings: [String: AnyObject] = [ AVVideoAverageBi...
Loop optimization changing direction <p>I have read about loop optimization (N.Zakas, Javascript Optimization) and there it was written that using inverse loop for arrays is more optimized then direct loop. It seems completely logically:</p> <pre><code>for(var i = 0; i &lt; length; i++){...} </code></pre> <p>- checks...
<p>just because there's less code in <code>for(i = length;i--;)</code> doesn't mean less things are getting done; the <code>i</code> still needs to be incremented (or in this case, decremented), and a check still needs to take place (where before it was <code>i &lt; length</code>, it's now <code>i != 0</code>).</p> <p...
Flowchart diagram assign functions value to local variable <p>In my scenario there are 3 functions whose values are stored in a local variables:</p> <pre><code>boolean var1 = someFunction1(), var2 = someFunction2(), var3 = someFunction3(); </code></pre> <p>First I thoguht about just assigning function...
<p>the graph you made has a good level of generalization, Complete would be something like this: <a href="http://i.stack.imgur.com/4LgD8.png" rel="nofollow">flow1</a></p> <p>You can olso use this "Predefined Process" reference on wikipedia: https: //en.wikipedia.org/wiki/Flowchart </p> <p>Or if you prefere to incre...
Can't output array correctly <p>I want to have output of array <code>$mass</code> like this </p> <pre><code>0,1,2,3,4,5,6,7,8,9,10,11,12,"e","f" </code></pre> <p>using three "for" loops but something is wrong in the code and I have output like this </p> <pre><code>0 1 2 3 4 5 e f </code></pre> <p>Any ideas ? </p>...
<p>Using a little bit of recursion it can be done quite simply like this</p> <pre><code>&lt;?php $mass=array(array(array(0,1,2,3,4,5),6,7,8,9,10),11,12,"e","f"); function pr_all($arr) { $out = ''; foreach ( $arr as $a ) { if ( is_array($a) ) { $out .= pr_all($a); } else { ...
How to convert java stream to scala streams? <p>I am new to scala I am trying to understand the streams. Can I some tell me the difference between jsva 8 streams filter and streams in scala ?</p> <p>How do I convert this in scala ? </p> <p>For example if I want to convert this to scala do I need to use to Stream or...
<p>Here is a similar sample</p> <p>Assuming a data structure and validate function is defined</p> <pre><code>val myMap = Map(1 -&gt; "Value1",2 -&gt; "Value2") val time = System.currentTimeMillis def validate(str:String, time:Long) = true </code></pre> <p>Then a straight translate of your code could simply be</p> ...
Hiding implementation details when passing data around <p>I'm not even sure how to properly formulate question about this. </p> <p>I'm writing a library where I have multiple implementations (multiple libraries out of one). I want to hide as much as possible, if not all, implementation details from client app, in orde...
<p>Cast to a void * when returning and back to structure mystruct_t just after passing into a function. This is not great as you will loose some of the compiler type checking.</p>
How to make Angular 2 Router work by rewriting the URL in deployed app? <p>I'm now finishing my Angular 2 Application and I'm wondering how to host it. </p> <p>I've just tried to build the app on my localhost and actually everything seems to work fine, expect the <code>Router</code> of the app. I can't access routes b...
<p>This problem is solved by implementing <code>HashLocationStrategy</code> which adds <code>#</code> to all your routes: <code>http://localhost/FinalApp/list/page/1</code> becomes <code>http://localhost/#/FinalApp/list/page/1</code>. You achieve this by adding <code>HashLocationStrategy</code> to <code>AppModule</code...
Extending type conversion to pairs/tuples of convertable types <p>I've got to deal with a bunch of 2D point types: <code>pair&lt;double&gt;</code>, <code>pair&lt;float&gt;</code>, <code>pair&lt;int&gt;</code>, and I'd like to allow implicit conversions between points whenever there exists a conversion of their coordina...
<p>You cannot make implicit conversion to an unknown type; and again, conversion operator must be a non-static member function which will still require you to wrap it a class; and write a converting constructor from an unknown type (aka templated constructor).</p> <p>Why don't you want to make it a free function:</p> ...
Access server running on ubuntu host from guest in virtualbox <p>I have a nodejs project running in ubuntu. so I access it this way:</p> <p><a href="http://localhost:9000/login" rel="nofollow">http://localhost:9000/login</a></p> <p>now I am trying to access this server from a guest windows7 which I am running on virt...
<p>Look at file /etc/hosts and check how localhost is mapped. Surely it is set to 127.0.0.1 . If you make your nodejs application listen on IP:port 192.168.1.13:9000 you will be able to connect. Or change the mapping of localhost which I don't recommend.</p>
How can I make my python binary converter pass these tests <p>My python code is supposed to take decimal numbers from 0 to 255 as arguments and convert them to binary, return invalid when the parameter is less than 0 or greater than 255</p> <pre><code>def binary_converter(x): if (x &lt; 0) or (x &gt; 255): r...
<p>You already know how to check the range of the input argument, and how to return values. Now it's a simple matter of returning what the assignment requires.</p> <p>In checking for valid input, all you've missed is to capitalize "Invalid". </p> <p>For legal conversions, you just need to pass back the binary repre...
how to link two jcomboboxes without repeat the values <p>i want to select an item from a comboBox which called names to display item in comboBox asnaf .. i did it but the item appears twice and when i select another item from comboBox names the other items appends on the previous items as As it is shown in the image a...
<blockquote> <p>the other items appends on the previous items</p> </blockquote> <p>Before you start appending new items you need to remove the old items. </p> <p>See the <code>removeAllItems()</code> method from the <code>JComboBox</code> API.</p>
Bootstrap 3 columns uneven spacing <p>When implementing bootstrap 3-columns design, there is uneven spacing between columns, because bootstrap css defines col-md-4 with left and right padding = 15px.</p> <p>So, the column in the middle gets double padding, therefore the spacing is 30px, and not 15px.</p> <p>Here is a...
<pre><code>.col-md-4:nth-child(2) {padding-left: 7.5px;padding-right: 7.5px;} </code></pre> <p>This would be more appropriate way to have equal paddings for all this tree columns , or if you want just have equal paddings and does'not matter if it would be 30px you can just remove row outside of columns which is not go...
Override property conflict <p>I have two complex class:</p> <pre><code>public class BaseRepository&lt;EntityType&gt; where EntityType : class { protected northwindDataContext context = new northwindDataContext(); public EntityType Get(object id) { return context.Set&lt;EntityType&gt;().Find(id); ...
<p>It sounds like what you really want is for the <code>BaseService&lt;T&gt;.repo</code> field (it's a field, not a property - and I'd discourage you from using public fields, but that's a different matter) to be the appropriate kind of repository for the type. That's easy enough to do - just don't create it in <code>B...
How to handle throttling of producer to an akka.net router <p>I'm new to akka.net and trying to read as much as possible. I have 2 scenarios that I'm not sure how to deal with and would appreciate any help or pointers to examples.</p> <p>1) I have a process that looks for zip files to land on a file system and then ne...
<p>Yes akka.net streams seems to be what you need. You will be able to back pressure your producers to match consumption speeds. See <a href="http://getakka.net/docs/streams/integration#integrating-with-actors" rel="nofollow">stream integration with actors</a></p> <p>For the second part you want to use flows which sim...
When socket timeout happens? (Unix) <p>When I connect to a Unix named socket, under which conditions I may receive ETIMEDOUT?</p> <p>If it happens when the server does not accept() during N seconds, then what are typical N on Linux?</p>
<p>It happens if the server's operating system doesn't accept the connection within <code>N</code> seconds. The server application calling <code>accept()</code> is not normally relevant, because the operating system performs the 3-way handshake automatically, regardless of whether the application calls <code>accept()</...
Parse PHP variables (e.g $myVar) that exist in a .txt file using file_get_contents("myFile.txt"); <p>I have a text file named myFile.txt with following content:</p> <blockquote> <p>My variable is $myVar</p> </blockquote> <p><strong>PHP Example 1:</strong></p> <pre><code>$myvar = "Parsed"; $a = file_get_contents("m...
<p>Using a mixture of RegEx and eval() would do the job.</p> <p><strong>myFile.txt</strong></p> <blockquote> <p>My variable is $myvar and another variable is $another</p> </blockquote> <p><strong>index.php</strong></p> <pre><code>&lt;?php // vars $myvar = "parsed"; $another = "whatever"; // regEx $re = "/(\\$\\...
Find the nearest neighbor of coordinates in 2 separate matrices and the distance between the 2 in r <p>I have 2 dataframes that are simply matrices of 2 dimensions (lat/long). Both dataframes would look like the input below:</p> <pre><code>latitude longitude 27.78833 -82.28197 27.79667 -82.29294 </code></pre> <p>...
<p>I am not expert on Geo math, but it seems that you can start with something like this:</p> <pre><code>dfref &lt;- read.table(text = "latitude longitude 27.78833 -82.28197 27.79667 -82.29294", header = T) dtref &lt;- data.table(dfref) dfnew &lt;- read.table(text = "latitude longitude 27.54345 -82.33233", ...
elasticsearch term aggregation over not_analyzed string returns buckets with very low doc count <p>While playing with AWS Elasticsearch (2.3), I loaded it with some sample data <a href="https://www.elastic.co/guide/en/kibana/3.0/snippets/shakespeare.json" rel="nofollow">https://www.elastic.co/guide/en/kibana/3.0/snippe...
<p>The root cause is the bug in mapping and way the data is being searched. Mapping is set for only doc_type:'act' when it should be set for doc_type:'line', also the search shouldn't be over everything instead just doc_type:'line'.</p> <p>Detailed answer:</p> <p>Following the example from this page: <a href="https:/...
Windows OS Update/Patch handling - best practices for SF today <p>I'm aware that the SF doesn't yet automatically handle OS Upgrades/patching in any way like Cloud Services do. I eagerly await it when that is ready. But for now I am curious what I should expect by default.</p> <p>Since SF uses Scale Sets and standard ...
<p>You're correct that there could be catastrophic results if you just turn on Windows Update and let it go. There will be no coordination when the node reboots and you could lose part or all of your application or cluster if the nodes cause the service fabric services to lose quorum. </p> <p>The only safe approach is...
How do I make my website compatible with iMessage link preview for iOS10? <p>iOS10 offers rich link preview for links sent via iMessage to other iOS users. What do I need to do to make sure Messages displays a good preview for my website? Currently it shows an empty bubble with the Safari icon next to it.</p> <p>Her...
<p>You need to add <a href="http://ogp.me" rel="nofollow">Open Graph</a> meta tags to pages on your website.</p>
Include file from static folder in Flask template <p>How can I include "in-line" javascript in a Flask template for performance but keep the code in a separate file in the static folder for organization? Something like this is what I'm looking for. </p> <pre><code>&lt;script&gt; {% include_from_static 'in-line.js' %} ...
<p>Well, you can pass the root of your Flask project to <code>PackageLoader</code>. The downside will be that you must have to prefix each file to the <code>template</code> and <code>static</code> folder.</p> <p>app.py</p> <pre><code>from flask import Flask from jinja2 import Markup, PackageLoader, Environment app ...
Pass Foreign Key via Post Form <p>I am doing an exercise of creating an helpdesk system. I'm using code first so i create some scripts that i'll describe briefly.</p> <p>This class is my main class</p> <pre><code>public class Ticket { public int Id { get; set; } [Required] [StringLength(255)] public s...
<p>Got it guys on my viewmodel i put a variable that i set on the form to the id of the ticket and it persists on the post method</p> <pre><code>public class AnswerTicketViewModel { //public IEnumerable&lt;TicketStatus&gt; TicketStatus { get; set; } public Ticket Ticket { get; set; } public int TicketId { ...
Unable to unbind event listener - trouble with turbolinks caching <p>I'm binding then unbinding the ready event listener to the document. </p> <pre><code>$(document).bind("ready", readyEventHandler); function readyEventHandler() { // run some code $(document).unbind("ready"); } </code></pre> <p>The code produce...
<p>Not so sure it will help, but here are my 2 cents - instead of trying to unbind the <code>readyEventHandler</code> - make sure that if you run the function once it will not run twice:</p> <pre><code>var readyHandlerRun = false; $(document).bind("ready", readyEventHandler); function readyEventHandler() { if (r...
Do Kubernetes service IPs change? <p>I'm very new to kubernetes/docker, so apologies if this is a silly question.</p> <p>I have a pod that is accessing a few services. In my container I'm running a python script and need to access the service. Currently I'm doing this using the services' IP addresses. </p> <p>Is the ...
<p>The service IP address is stable. You should only need to use environment variables if you don't have a better way of discovering the IP address (e.g. DNS).</p>
EF Map The Latest Object In A List Of Objects <p>I am trying to do this <code>Linq</code> query:</p> <pre><code>dataContext.Request.Where(x =&gt; x.LatestResponse.IsReviewRequired); </code></pre> <p>The problem is that <code>LatestResponseID</code> is actually not a column on the <code>Request</code> table.</p> <p>T...
<p>You could do something like this (if you want both sides of the join back):</p> <pre><code>var results = dataContext.Requests.Select(request =&gt; new { Request = request, LatestResponse = request .Responses.FirstOrDefault(response =&gt; response .RequestID == request.Responses.Max(r...
Snap.svg animating position on 2d axis <p>Looking through the other posts about Snap.svg, I am not seeing much explanation regarding simple use of the animate function. </p> <p>I can't quite understand the documentation and current examples of using <code>element.animate</code>. </p> <p>I see that there are specific...
<p>To control translate: <code>transform: 't300,300'</code> Scale: <code>transform: 's2'</code> Rotation: <code>transform: 'r45'</code><br> You could make all in single statment: <code>transform: 's2r45,300,300'</code> <br></p> <p>You could select any element by <code>Snap("#elevBox");</code> <br><br> <strong>Useful r...
Group list of tuples by item <p>I have this list as example:</p> <pre><code>[(148, Decimal('3.0')), (325, Decimal('3.0')), (148, Decimal('2.0')), (183, Decimal('1.0')), (308, Decimal('1.0')), (530, Decimal('1.0')), (594, Decimal('1.0')), (686, Decimal('1.0')), (756, Decimal('1.0')), (806, Decimal('1.0'))] </code></pre...
<p>You would first need to <em>sort</em> the data for the <em>groupby</em> to work, it groups <em>consecutive elements</em> based on the key you provide:</p> <pre><code>import operator, itertools from decimal import * test=[(148, Decimal('3.0')), (325, Decimal('3.0')), (148, Decimal('2.0')), (183, Decimal('1.0')), (30...
How to store availability information in SQL, including recurring items <p>So I'm developing a database for an agency that manages many relief staff. </p> <p>Relief workers set their availability for each day in one of three categories (day, evening, night). </p> <p>We also need to be able to set some part-time relie...
<p>For absolutely flexibility in the future and keeping data from bloating my first thought would be something like</p> <ul> <li><em>Calendar Dimension Table</em> - Make it for like 100 years or Whatever you Want make it include day of week information etc.</li> <li><em>Time Dimension Table</em> - Hour, Minutes, every...
Python Function Won't Run At ALL? <p>I am fairly new to the programming world and am wondering why the following code will not only refuse to run, but my python software won't even give me any error messages whatsoever.I'm using Pythonista, an IOS app for python. I can't get the app to run this code (and it won't give ...
<p>I'm not sure what you expect from this, but it's <em>really</em> funky syntax.</p> <pre><code>print(badMatchups)[1:2] print(worstMatchups)[1:1] </code></pre> <p>If those slices are subscripts for the lists, you need them inside the call to <strong>print</strong>:</p> <pre><code>print(badMatchups[1:2]) print(worst...
Display project version in ASP.NET Core 1.0.0 web application <p>None of what used to work in RC.x helps anymore.</p> <p>I have tried these:</p> <ol> <li><p>PlatformServices.Default.Application.ApplicationVersion;</p></li> <li><p>typeof(Controller).GetTypeInfo().Assembly.GetCustomAttribute&lt;AssemblyFileVersionAttri...
<p>This is it:</p> <pre><code>Assembly.GetEntryAssembly().GetCustomAttribute&lt;AssemblyInformationalVersionAttribute&gt;().InformationalVersion; </code></pre>
Interesting CSS selector <p>I have an interesting CSS selector here:</p> <pre><code>.gridcell[id="danger"] { color: red; } </code></pre> <p>I think that it should style the paragraph element in the following section:</p> <pre><code>&lt;div class="gridcell" id="danger"&gt; &lt;p&gt;fort_sumter&lt;/p&gt; // this w...
<p>You have some strange Unicode quote there, specifically code point 8221 "Right Double Quotation Mark". It should be code point 34 "Quotation Mark".</p> <p>Try to find the difference between the two: U+8221:<code>”</code> U+34<code>"</code>.</p> <p>This could be caused by some interesting system keyboard setting...
Token Authentication/Authorization With PassportJS <p>I'm currently in the process of developing a Node/Express-based API for an application that will be distributed on multiple platforms. Because of this, I will need to authenticate/authorize users based on a token rather than sessions/cookies.</p> <p>After doing som...
<p>I'm going to try and break down your question into a few parts:</p> <ul> <li>Configuring Passport</li> <li>Where to use Passport</li> <li>Miscellaneous final remarks</li> </ul> <p>First, a slight misconception. Passport doesn't come bundled with a token generation system. Passport is designed to be configured with...
crossfilter.all() not working as per the docs + cf.size works <p>as per the <a href="https://github.com/crossfilter/crossfilter/wiki/API-Reference#crossfilter_all" rel="nofollow">docs</a> I cannot get <code>cf.all()</code> to work</p> <p>I am using this as an example <a href="http://animateddata.co.uk/articles/crossfi...
<p><code>crossfilter.all</code> was added in the version 1.4 alphas. The page you are looking at uses version 1.3.12, so it doesn't include that method. I've updated the documentation to reflect this.</p>
Adding to the UITableView on UIButton <p>At one ViewController is located separately UITableView, UITextField and UIButton. I need to add UITextField's text to the cell of the table by button. I set the flag on the pressing process:</p> <pre><code>- (IBAction)addingButon:(id)sender { _addingFlag = true; } </code>...
<p><code>tableView:cellForRowAtIndexPath:</code> should return immediately. Instead, call <code>[tableView reloadData]</code> in <code>addingButton:</code>:</p> <pre><code>- (IBAction)addingButon:(id)sender { [self.tableView reloadData]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPa...
React + Express RESTful API calls <p>I'm trying to make a full-stack app (Express on the backend and React on the front) and I'm running into a problem. The server and UI are both being tested in my DEV environment on localhost, but with different port numbers. Making API calls from the frontend to the backend are res...
<p>You need to enable CORS, what o can do is specify the address with "Access-Control-Allow-Origin", "IP:PORT".</p>
Recieving a EOF Panic error <p>I'm trying to decode a json I get. Here's an example json I get: </p> <pre><code>{"response":"1","number":"1234","id":nil} </code></pre> <p>Here's my struct: </p> <pre><code>type AutoGenerated struct { Response string `json:"response"` Number string `json:"number"` ID int...
<p>Without you showing how you're doing it, I think the best answer is to show you how to do it. </p> <pre><code>package main import ( "fmt" "log" "encoding/json" ) func main() { j := []byte(`{"response":"1","number":"1234","id":null}`) data := AutoGenerated{} err := json.Unmarshal(j, &amp;da...
powershell timer cannot stop immediately <p>I am trying using powershell Timer to do some periodically job and once the job returns results that meet my expectation, I will stop running the job.</p> <pre><code>&gt;$timer = New-Object System.Timers.Timer &gt;$counter = 0 &gt;$timer.Interval = 1000 &gt;$timer.AutoReset ...
<p>Your IF should have an ELSE. Your logic is not correct. Try code like this:</p> <pre><code>$timer = New-Object System.Timers.Timer $counter = 0 $timer.Interval = 1000 $timer.AutoReset = $true $wait = $true Register-ObjectEvent -InputObject $timer -EventName Elapsed -Action { if ( $counter -eq 5 ) {$timer.Stop(); ...
How to delete a column of a single row in Google Cloud Bigtable with HBase API <p>I'm using the HBase API to access Google Cloud Bigtable, but whenever I try to delete a column:</p> <pre><code>Delete delete = new Delete(r.getRow()); delete.addColumn(CF, Bytes.toBytes(d.seqid())); delete.addColumn(CF, COL_LEASE); tasks...
<p>Sorry for your troubles. Bigtable and HBase differ in a couple of ways, and this is one of them.</p> <pre><code>Delete delete = new Delete(rowKey); delete.addColumns(COLUMN_FAMILY, qual); // the 's' matters table.delete(delete); </code></pre> <p>HBase's <code>Delete.addColumn</code> deletes only the latest cell f...
subdomain is created via domain regitrar or web server? <p>I'm hosting a API server using Docker Nginx server with Lumen, let say example.com, but now I want to change it to api.example.com. I tried editing my nginx.conf by adding <strong>server_name: api.example.com</strong> but it didn't work, but I still able to acc...
<p>You need to set up both a domain name registration and a server configuration. The cname will send the request <code>chris.example.com</code> to your servers actual location on the internet <code>192.168.1.1</code> (or what ever its IP is). Then you need to set <code>chris.example.com</code> in the server's configur...
Avoid Casting in following Code by using Generics <p>I am new to generics and just wondering if it's possible to avoid the casting in the following code using better OO approach.</p> <pre><code>public class CollectorFactory { public static MyCollector Create(ICredential credential) { return new MyColle...
<p>I don't think it's possible given that you're implementing different credentials and trying to use them for ICredential as well.</p>
How to install repo for AEM? <p>I am trying to install this repo(<a href="https://github.com/sinnerschrader/aem-react" rel="nofollow">https://github.com/sinnerschrader/aem-react</a>) into AEM but getting this error:</p> <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4:enforc...
<p>It definitely says in the github docs</p> <blockquote> <p>>= Java 8 (Oracle JDK with nashorn engine)</p> </blockquote> <p>github -> <a href="https://github.com/sinnerschrader/aem-react#dependencies" rel="nofollow">https://github.com/sinnerschrader/aem-react#dependencies</a></p> <p>so you just need to install ne...
jquery: make get() before form submitting <p>here is my code. Question is how can i make async get() query before form submit? One another callback? How should it looks like?</p> <pre><code>$('#auth').submit(function(e) { var self=this; e.preventDefault(); $.get(url, function(data) { //some code ...
<p>Submit the form only when the request has finished</p> <pre><code>$('#auth').submit(function(e) { e.preventDefault(); var self = this; $.get(url, function(data) { //some code self.submit(); }); }); </code></pre> <p>It generally makes little sense to do an ajax request, sending dat...
Calendar (GregorianCalendar) .complete() method not visible? <p>So I read through a few different threads but none of them seem to directly address how I fix my issue. I'm trying to create a <code>Calendar</code> (<code>Gregorian</code>) and then use the <code>.complete()</code> method so that in my classes using this ...
<p>In a <a href="http://stackoverflow.com/questions/39650770/calendar-gregoriancalendar-complete-method-not-visible#comment66605119_39650901">comment</a> you wrote:</p> <blockquote> <p>I don't care about the actual time, I just want it to give me the date so I can determine the dayofweek (important based on various ...