input
stringlengths
51
42.3k
output
stringlengths
18
55k
Load preset directory in Maya with python/MEL? <p>I have a folder where I'm storing some maya presets (specifically nCloth presets) and I would like to make this directory available to all of the users on my current network. To do this, I would like to have this folder added to the MAYA_PRESET_PATH on startup. However,...
<p>save the code as filename.bat file, running via double click. you have to refactor the paths to your own environment. its a simple example, if you have other artists out of your scope, you should check that the Paths are matching for example that everybody who start maya with this batch should have maya installed on...
Python "list index out of range" other rule works <p>I have tried to make a script to read out a csv file and determine some information.</p> <p>Now I receive an error: </p> <pre><code>Traceback (most recent call last): File "/home/pi/vullijst/vullijst.py", line 26, in &lt;module&gt; startdate = datetime.dateti...
<p>Your csv file appears to have an empty line at the end, after the last row with real data. So your script reads all the real lines and processes them, but it breaks when the last line is parsed into an empty list. The <code>row[0]</code> you're trying to parse into a date isn't valid in that situation.</p> <p>To av...
Python: Connecting list values with array values <p>I have created a tornado plot taking inspiration from <a href="http://stackoverflow.com/questions/32132773/a-tornado-chart-and-p10-p90-in-python-matplotlib">here</a>. It has input variables labelled on the y-axis (a1,b1,c1...) and their respective correlation coeffici...
<p>use build-in zip function - returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables. But aware the returned list is truncated in length to the length of the shortest argument sequence.</p>
I can't integrate a Web Template purchased into Meteor <p>thanks for read</p> <p>I have a problem, I hope some orientation because always I worked only with bootstrap. Never with css, js, or templates. But this case is diferent.</p> <p>I bought a template in wrapbootstrap.com As you know, this templates coming with a...
<p>You need to port those files to use modules (or find already-wrapped versions on npm), so that they can be bundled up in the correct order with the rest of your JS code.</p>
Resizing window always trigger a click event <p>I have a bootstrap sidebar that can be toggled into a narrow icon bar, and now I am required to show the sidebar when screen height is greater than 768, and to a narrow side bar when height is lower than 768. But my script appears to be triggering a click event when lower...
<p>Are you sure the click event is triggering? (Try making a log inside the click function(s) to confirm using <code>console.log</code>)</p> <p>Based on the code you posted it looks like <code>resize</code> may be firing multiple times as you resize the window.</p> <p>Try using the following:</p> <pre><code>$(window...
excel VBA worksheet_activate method not working correctly <p>I have a spreadsheet with a small Subroutine in it that should do three things when the tab for the sheet "Template" is clicked: 1. make a copy of the "Template" sheet and place it before the original "Template" sheet 2. change the name of the copied sheet to...
<p>you wouldn't use <code>Worksheet_Activate()</code> because it would be copied along with the worksheets copies, thus having copied worksheets generate other worksheets</p> <p>so you want to use <code>Workbook_SheetActivate()</code> event handler</p> <p>even then, you must be aware that upon deleting a sheet just p...
The database and links aren't working <p>I have been trying to use Javascript and jQuery to make a subdomain for my website that has only one page. I had it working perfectly when all of the code was completely on the one page. When I tried to make it so that the script pulled from outside pages, two of the functions s...
<p>Your code has to be execute after the DOM is ready.</p> <pre><code>$( document ).ready(function() { // your code here }); </code></pre> <p>or </p> <pre><code>$(function() { // code here }) </code></pre>
Quickest way to implement a server side alarm with Firebase and Ionic <p>I'm currently developing an app with Ionic/AngularJS/Firebase, basically I store user's alarm clocks in a Firebase DB and I want to send a notification when the time elapses.</p> <p>What is the most efficient way to achieve this? How do I run a j...
<p>I would actually suggest giving <a href="https://syncano.io" rel="nofollow">Syncano</a> a try. With Syncano, you can set up a Schedule which, at a time selected by you, will run a NodeJS script that you wrote on a server you don't have to manage. It's the best way to get what you're looking for up and running as soo...
javascript getAllResponseHeaders() - how to view '[native code]'? <p>I am doing an AJAX call and attempting to retrieve the response headers. </p> <p>MY code:</p> <pre><code> var xmh = new XMLHttpRequest; xmh.getAllResponseHeaders </code></pre> <p>I am trying to view the headers in the console and what I am gettin...
<p>This is because you are inspecting the function itself, whereas you want to first invoke the function, and then inspect it's return value.</p> <p>Try updating to:</p> <pre><code>xmh.getAllResponseHeaders(); </code></pre>
Redirect from image to script <p>please help me with redirect in .htaccess Iam have simple link</p> <p><a href="http://domain.com/" rel="nofollow">http://domain.com/</a><em>test123</em>/<em>image-123.gif</em></p> <p>Iam need to redirect from this image to script.</p> <p><a href="http://domain.com/test.php?company=" ...
<p>Assuming this is literally what you have in a .htaccess file, the problem is that you have .\g rather than .g -- that is, you've escaped the 'g' character, rather than the . character.</p> <p>That is, what you want is:</p> <pre><code> RewriteRule ^(.+)/(.+)\.gif$ tracking.php?company=$1&amp;email=$2 [PT,L,QSA] </c...
Listen to the click event with id/class or use the onclick in the link? <p>To run javaScript/jQuery I can do it with click event with id/class/data like this and get the values to use in the function with <code>$(this).data("id");</code></p> <pre><code>&lt;div data-id="@item.PostId" data-vote="up" id="vote-up " class=...
<blockquote> <p>It's generally considered ‘bad’ to use <code>onclick</code> for a number of reasons:</p> <ul> <li>you're mixing small pieces of JavaScript syntax inline with HTML syntax: <ul> <li>when you have lots of these, especially when you have lots of elements that all > contain essentially th...
Redgate DLM Automation - deploy database to multiple environments <p>I am using Redgare DLM Automation for database CI in a SQL Server and Visual Studio Team Services environment. I can easily deploy to multiple databases in a single environment, but apparently DLM Automation does not support multiple environments out ...
<p>You definitely can deploy to multiple environments, however the issue of needing different user accounts for different environments is not a trivial problem to solve. Ultimately whatever you source control will be deployed to each environment, so if you need different user accounts then you will need to take care of...
Android viewpager fragment <p>I need to create an app with one activity and 3 fragments in it. Pages don't need to be dynamically created but its a plus. My question is: do I need a separate fragment for every view or I can reuse one with different view?I've read the android tutorial here <a href="https://developer.and...
<p>I'm assuming you want 3 full screen fragments. Use a <code>ViewPager</code> with a <code>FragmentPagerAdapter</code>.</p> <pre><code>public class MyFragment extends Fragment { @BindView(R.id.view_pager) ViewPager viewPager; MyPagerAdapter pagerAdapter; @Nullable @Override public View onCr...
iOS - how to write this objective-C into Swift? <p>How can i exactly do this in swift for iOS?</p> <pre><code>- (IBAction)skypeMe:(id)sender { BOOL installed = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"skype:"]]; if(installed) { [[UIApplication sharedApplication] openURL:[NSURL URL...
<p>In Swift you'd use the same framework calls with a different syntax. To write this in Swift,</p> <ol> <li>Look over the code for things that might be class names and/or method names</li> <li>Look up those names in Apple's documentation</li> <li>Apple's documentation will describe both Objective-C and Swift syntax</...
C# Manually Sorting Parent/Child tree elements in a list <p>I am attempting to generate a list of elements that would generate a tree structure if visualized.</p> <p><strong>Example:</strong></p> <pre><code>Element 1 -&gt; 1, 0 //ID is 1 &amp; Parent ID is 0 (0 = root) Element 2 -&gt; 2, 0 //ID is 2 &amp; Parent ID i...
<p>If I understand correctly, you have a flat <code>List&lt;Node&gt;</code> and you want to populate <code>children</code> property and end up with a list of the root nodes.</p> <p>This can be achieved efficiently by building a fast lookup structure by <code>id</code> (like <code>Dictionary</code>) and single iteratio...
'CookieAuthenticationProvider' does not contain a definition for 'SlidingExpiration. Claims expiration time <p>So, I was trying to set expiration time on claims in mvc. That is the code:</p> <pre><code>public class Startup { public void Configuration(IAppBuilder app) { app.UseCookieAuthentication(new M...
<p>They belong to <code>CookieAuthenticationOptions</code> instead of the provider. That should resolve it. <a href="https://msdn.microsoft.com/en-us/library/microsoft.owin.security.cookies.cookieauthenticationoptions(v=vs.113).aspx" rel="nofollow">CookieAuthenticationOptions</a></p> <pre><code>app.UseCookieAuthentic...
Moving reusable components outside project folder using Webpack React <p>I am building an application using Webpack and React.</p> <p>my package.json is :</p> <pre><code>{ "name": "v1", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" &am...
<p>I solved this. What I did was install the node modules in the react folder as well through npm install and put the .babelrc file there as well. It was trying to load the node_modules from the react directory, not home directory for SearchBox.jsx.</p> <p>So if someone else encounter this issue, the way to solve it i...
If I copy a Folder with .git repo will it work independently of original? <p>If I copy a folder under git VC (with the appropriate .git subfolder) will this copy then "behave" independently of the original?</p> <p>What if, instead, I MOVED the folder to a new location? Would it behave as it did previously? (I.e., the...
<p>Yes. The folder with the .git directory is what makes it a git repository. If you copy the folder, you're making a copy of the local repository and it is completely independent of the original repository.</p> <p>If you move a repository and do a <code>git status</code>, you'll notice that nothing is seen as havin...
Javascript - fetch elements from array dynamically <p>I have an array and i need to fetch elements from the array inside a loop. Let me explain,</p> <pre><code>var globalArray = ['apple','orange','melon','banana'], loopLimit = 5, fruitsPerLoop = 3; for (var i=1; i&lt;=loopLimit; i++) { // when the loop run...
<p>How about creating a recursive function to determine the index:-</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 lang-js prettyprint-override"><code>var globalArray = ['apple', 'orange', 'melon', 'banana'],...
Bi-directional association <p>The concept with association and also how it relates to the UML design. I would appreciate if some expert could give me an idea or code design relate to the UML picture attached.</p> <p><a href="https://i.stack.imgur.com/L02ly.png" rel="nofollow"><img src="https://i.stack.imgur.com/L02ly....
<p>One possible solution is</p> <pre><code>public class Loan { private final Date date; private final Borrower borrower; private final Equipment equipment; Loan(Borrower borrower, Equipment equipment, Date date) { this.borrower = borrower; this.equipment = equipment; this.date ...
R Add rows while reshaping a data frame <p>I have a similar data frame as <code>df</code> that looks like a registry of entries and exits in a system. </p> <pre><code>df = data.frame(id = c("A", "B"), entry = c(2011, 2014), exit = c(2013, 2015)) &gt; df id entry exit 1 A 2011 2013 2 B 2014 2015 </code></pre> ...
<p>Here's a way to get toward your desired solution:</p> <pre><code>df1 &lt;- data.frame(id = c("A", "B"), entry = c(2011, 2014), exit = c(2013, 2015)) setNames(stack(by(df1, df1$id, function(x) x$entry : x$exit))[,c(2,1)], c('id','time')) id time 1 A 2011 2 A 2012 3 A 2013 4 B 2014 5 B 2015 </code></pre>...
How to force a subclass to have a specific subclass of superclass property? <p>Starting off, I'm working with EF, since I'm building an MVC application on C#. I want different types of exams to have different types of questions. Here are my abstract classes:</p> <pre><code>public abstract class Exam { public int I...
<p>As other have mentioned I think you are over complicating your problem. However; your question is about type guarantees and I will try to answer that.</p> <p>First the code:</p> <pre><code>public interface IExam&lt;out T&gt; where T:IQuestion { int Id { get; set; } string Description { set; get; } IEnumerabl...
Removing mime type icon from image using CSS, possible? <p>I'm currently using some CSS to append font-awesome icons as mime types for uploaded files and or links that end in .pdf, .xls, .docx, etc.</p> <p>I should have prefaced this entire post with this comment I made:</p> <p><strong>Ok, I should have mentioned tha...
<p>To solve it with the existing markup you'll need a parent selector, and those does not exist (yet).</p> <p>A workaround could be to wrap the text in the text only links with a <code>span</code> and update the CSS rule with the <code>:not(img)</code> selector</p> <p><div class="snippet" data-lang="js" data-hide="fa...
subprocess.Popen process stdout returning empty? <p>I have this python code</p> <pre><code>input() print('spam') </code></pre> <p>saved as <code>ex1.py</code></p> <p>in interactive shell</p> <pre><code>&gt;&gt;&gt;from subprocess import Popen ,PIPE &gt;&gt;&gt;a=Popen(['python.exe','ex1.py'],stdout=PIPE,stdin=PIPE)...
<p>Input expects a whole line, but your input is empty. So there is only an exception written to <code>stderr</code> and nothing to <code>stdout</code>. At least provide a newline as input:</p> <pre><code>&gt;&gt;&gt; a = Popen(['python3', 'ex1.py'], stdout=PIPE, stdin=PIPE) &gt;&gt;&gt; a.communicate(b'\n') (b'spam\n...
Finding model predictor values that maximize the outcome <p>How do you find the set of values for model predictors (a mixture of linear and non-linear) that yield the highest value for the response.</p> <p>Example Model:</p> <pre><code>library(lme4); library(splines) summary(lmer(formula = Solar.R ~ 1 + bs(Ozone) + ...
<p>There are some conceptual issues here.</p> <ul> <li><p>for the simple terms (<code>Wind</code> and <code>Temp</code>), the response is a linear (and hence both monotonic and unbounded) function of the predictors. Thus if these terms have positive parameter estimates, increasing their values to infinity (<code>Inf</...
Show YouTube Videos URLs and thumbnails in listview <p>I want to show multiple YouTube videos URLs (that are in arraylist) in the listview. This listview should show both URL and thumbnail of that video and if the user select any video, it should play in next full screen.</p> <p>How can I do that in both Java and XML?...
<p>Assuming that the URLs &amp; Video data is provided by a Backend of yours, the steps would be as follows:</p> <p><strong>1) Create a Java class named 'Video'</strong></p> <pre><code>public class Video { String Thumbnail; String Url; String Title; //GET &amp; SET Methods } </code></pre> <p>For mor...
Get time Android <p>I use Time Picker and i Want take value of hour and minute after push a button, i've make this code but the app shutdown after I push it.. I don't know where is the error.</p> <pre><code>final TimePicker tp = (TimePicker)findViewById(R.id.tp); Button b3 =(Button)findViewById(R.id.b3); b3...
<p>Consider using a <code>TimePickerDialog</code> with a <code>DialogFragment</code> For a working example you can check out a test app I have here: <a href="https://github.com/agramian/android-test-app/blob/master/AndroidTest/app/src/main/java/com/abtingramian/android/androidtest/feature/calendar/CalendarLayout.java" ...
OpenGL rotation issues <p>So I've managed to build a complex shape consisting of multiple parts in OpenGL and I need to make it rotate via keyboard input. I have implemented keyboard inputs and they work although when I call glRotatef inside the key event handler the shapes do not rotate which I believe is because it i...
<p>You can rotate using glRotatef() then after you can call the function which is creating that object provided your function which is drawing is not creating its own modelview matrix. If your function is using its own matrix i.e using loadIdentity then it might be not possible. Grv10India </p>
Input field freezes on adding new row at Enter key press <p>I have a table with input fields. If a user presses <code>Enter</code> key inside an <code>input</code> field then it will add a <code>new row</code> to the table. Here is the code for it:</p> <pre><code>// Detecting keycode if $event.keyCode == 13 $event.p...
<p><code>preventDefault()</code> just do what it names points (i.e. prevents the default action to be triggered) It means, if it's a click event on, let's say, <code>&lt;a href="whatever"&gt;MyLink&lt;/a&gt;</code> the link will no be triggered and no navigation will occur. </p> <p>Keep in mind that <code>preventDefau...
why regex getting stackOverFlow <p>When I trying to match for above regex using scala lib (working with re2), code goes into below path and times out 1 minute:</p> <p>Regex:</p> <pre><code>(([a-z0-9!#$%&amp;'*+?^_`{|}~-]+(?:.[a-z0-9!#$%&amp;'*+=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*...
<p>Your regular expression has nested quantifiers (e.g. <code>(a+)*</code>). This <a href="https://swtch.com/~rsc/regexp/regexp1.html" rel="nofollow">works well with re2</a> but <a href="http://www.regular-expressions.info/catastrophic.html" rel="nofollow">not with most other regular expression engines</a>.</p>
How can I elegantly write class templates that use a value implied by the template argument? <p>I am writing a source file library with a series of declarations and macros that are related in a one-to-one relationship. The first is a list of categories, as an enumeration:</p> <pre><code>typedef enum { CID_SYS, ...
<p>This may not be neat or elegant but I had some search meta-function to find a type in a type-list as follows:</p> <pre><code>#include &lt;type_traits&gt; template&lt;typename ...Ts&gt; struct TypeList; //Represent a list of types to be queried struct Nil; //empty type, a placeholder type if we cannot find what we...
Sublime 3 Plugin Storing Quick Panel Return Val <p>I'm trying to write a simple plugin that generates a quick panel based on some list, waits for the user to select an item, and then performs an action based on the value the user selected. Basically, I'd like to do the following:</p> <pre><code>class ExampleCommand(su...
<p>Showing the quickpanel obviously does not block the program execution. I recommend to create and pass a continuation:</p> <pre class="lang-py prettyprint-override"><code>import sublime import sublime_plugin class ExampleQuickpanelCommand(sublime_plugin.WindowCommand): def run(self): # create your item...
android studio error: transformClassesWithJarMergingForDebug <p>I'm currently testing a game. But when I try to run the app on my device, it gives me this error:</p> <p><img src="https://i.stack.imgur.com/oYxKq.png" alt="enter image description here"></p> <p>I already tried cleaning the project, but the error stays.<...
<p>I would recommend you set a variable for the google services and make them all the same version. </p> <p>For example, your <code>BaseGameUtils</code> uses <code>8.4.0</code> consistently, but your project is using various other versions (<code>9.6.1</code> and <code>9.4.0</code>)</p> <pre><code>ext { appName =...
How to pass value to a viewController embedded in NavigationController <p>There are similar questions but they are either in swift or are not solving my problem.<br />I've a view controller which is presenting navigation view controller when cell did select button is pressed as:</p> <pre><code>patientBillNavigationVie...
<p>One way I know is to Subclass <code>UINavigationViewController</code> and in its <code>viewDidLoad</code>, you can do:</p> <pre><code> YourEmbeddedVc *svc =self.viewControllers[0]; //get the controller reference svc.name= @"Hello"; </code></pre> <p>I'm assuming you are only having one controller in your navigatio...
Can I use Hamcrest's Matchers.containsInRelativeOrder? <p>I'm a little confused. I see function <code>containsInRelativeOrder</code> in <a href="https://github.com/hamcrest/JavaHamcrest/blob/master/hamcrest-library/src/main/java/org/hamcrest/Matchers.java#L1021" rel="nofollow">the code</a>:</p> <pre><code>@SafeVarargs...
<p><strong>Corrected</strong> thanks to @Tom.</p> <p>Yes, it is a version issue! <a href="https://github.com/hamcrest/JavaHamcrest/commit/36d525e1e425006939a77aec5183aecd7c775b05" rel="nofollow">1.3</a> is from 2012. The function was added in Dec. 2014 by <a href="https://github.com/hamcrest/JavaHamcrest/commit/99bc...
Laravel 5.3 Upload an image with Auth user::create <p>I am trying to add an image to the user. To create the user I use system make:Auth but I don't know how can I get the file name because on <code>create(array $data)</code> I don't receive the file name.</p> <pre><code>protected function create(array $data) { ...
<p>use the <code>getClientOriginalName</code> method because it's symfony <a href="http://api.symfony.com/3.0/Symfony/Component/HttpFoundation/File/UploadedFile.html" rel="nofollow">UploadedFile</a> instance try this :</p> <p><code>data['img']-&gt;getClientOriginalName();</code></p>
vertical align inside divs contained in a div that represents a row <p>I've tried just about every vertical-align for div trick I can find and still not getting the results. This is inside of an established responsive framework, so I've stripped it down to some inline CSS to show the issue.</p> <p><a href="https://i....
<p>Note that I removed your <code>float: left;</code> on all <code>div</code>.</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-css lang-css prettyprint-override"><code>.row { display: table; width: 100%; }...
Generate X random integers between Y and Z? <p>Is there a function in Python (I'm working with SageMath) to get 10 random integers between 0 and 30, for instance, without repeating them?</p>
<pre><code>import random random.sample(range(31), 10) </code></pre>
Searching Multi-Dimensional Array <p>I've created a multi-dimensional array in C++, but it doesn't return anything when I search it. Just wondering if I messed something up in the code? Full disclosure: This was originally a class assignment, but I turned it in 2 weeks ago. I'm asking for clarification for future pr...
<p>Beyond having your loop test backward, using <code>cin &gt;&gt; name</code> will only get the first name. You test first and last. Thus your tests will never succeed.</p> <p>Use <code>std::getline</code>.</p> <p>Doing a modicum of debugging work would have turned up both errors.</p>
Django: Filtering query to a specific id <p>I have a podcast management website where a user is able to setup his account and after that will be able to create multiple episode from that specific user. After an episode is done, a button will appear where he can see some links that is created automatically for the user ...
<p>You filter by the id in the get method, but then don't do anything with the result. When it comes to construct the template context, Django calls get_queryset, which only filters by self.podcast - which is None.</p> <p>You should move that filter logic into get_queryset. And if you also want to filter by podcast, y...
Storage of structure elements in C <p>Consider the following code:</p> <pre><code>struct employee { int id; char name[30]; }; main() { struct employee e1; printf("%d %d %d", sizeof(e1.id), sizeof(e1.name), sizeof(e1)); } </code></pre> <p>where the Structure elements are saved in memory and how? And...
<p>In this case, the memory is stored on the program stack. Obviously, that means you don't want to store structures that are too large this way.</p> <p>The size of the memory is the total bytes used by the structure. Assuming your platform uses 1 byte per <code>char</code>, that would be 30 bytes plus the size of an ...
Doxygen project version number in XML <p>I would like my project version number to appear the the Doxygen XML output so I can programmatically retrieve it. I have set up PROJECT_NUMBER, and the value I used there appears in the HTML output for the same build, but not for the XML output. I grepped the XML output folder ...
<p>No definitive answer, but this is the solution I will be using if nothing else pops up.</p> <p>Create an alias:</p> <pre><code>ALIASES = "myversion=\anchor version \xmlonly a.b.c \endxmlonly" </code></pre> <p>Where 'a.b.c' is the version number that was also placed in PROJECT_NUMBER.</p> <p>Then place the <code>...
Allowing the user to undo a "don't ask again"? <p>In Android if you ask for permissions, second requests onward allow the user to check "Don't ask me again" so the failure state will always be reached in the future.</p> <p>What if the user changes their mind and wants to allow permission, but can't now because the fea...
<p>The user cannot undo the "don't ask again" setting itself directly. The user can:</p> <ul> <li><p>Grant rights to the permission group through the Settings app (Settings > Apps > (your app) > Permissions), or</p></li> <li><p>Clear the data associated with your app, which AFAIK will clear the "don't ask again" statu...
How to get the x and y intercept in matplotlib? <p>I have scoured the internet and can't find a python command to find the x and y intercepts of a curve on matplotlib. Is there a command that exists? or is there a much easier way that is going over my head? Any help would be appreciated. Thanks, </p> <p>Nimrodian.</p>...
<p>Use this. Much faster:</p> <pre><code>slope, intercept = np.polyfit(x, y, 1) </code></pre>
DropShadow with static source is faster when using "cached:true" <p>I'll begin with my testcase. It creates 21 unchanging shadowed blue rectangles. It also creates a 1x1px Canvas3D repainted constantly, so I can check how often it manages to get repainted with all the other stuff going on (<code>Canvas3D</code> has a b...
<p>I posted a <a href="http://stackoverflow.com/q/40040954/122687">follow-up question</a> about this. In the comments to it, I learned that when 1 item in the scene (e.g. the Canvas3D in this case) needs to be redrawn, the entire scene gets redrawn. Which means that every time my Canvas3D is redrawn (which is constantl...
need jquery datepicker to fire again for changing a date <p>When i click in an empty textbox, the datepicker fires and the calendar dialog shows nicely. But if click again on a date in the textbox in order to change to a new date, I cannot cause the same datepicker dialog to pop up. </p> <p>Markup after page is loaded...
<p>i updated your whole source code... now it seems that it will work...</p> <pre><code> &lt;link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt...
Random comma inserted at character 8192 in python "json" result called from node.js <p>I'm a JS developer just learning python. This is my first time trying to use node (v6.7.0) and python (v2.7.1) together. I'm using restify with python-runner as a bridge to my python virtualenv. My python script uses a RAKE NLP keywo...
<p>This looks suspiciously like a bug related to size of some buffer, since 8192 is a power of two.</p> <p>The main thing here is to isolate exactly where the failure is occurring. If I were debugging this, I would </p> <ol> <li><p>Take a closer look at the output from <code>json.dumps</code>, by printing several cha...
Hibernate: custom entity name <p>Let's say I have an entity with a very long name:</p> <pre><code>@Entity public class SupercalifragilisticexpialidociousPanda { ... } </code></pre> <p>Using Hibernate to persist it to a Postgres DB works flawlessly. Oracle, however, doesn't allow for table/column/index names longe...
<p>Usually people give names for each database thing (table, column, index) by themselves. Letting Hibernate decide for you can lead to problem in future when you decide to refactor something.</p> <p>All reference can be configured one way or another to use names you decide to use.</p> <p>Ask specific question in cas...
Different layout for different modules <p>Something really weird is happening. I have two modules, one called <code>Application</code> and the other one called <code>Dashboard</code> they are different and have nothing to do with each other. I wanted to use a phtml layout to each one of them, and that is what I did:</p...
<p>I had the same issue on a previous ZF2 project. The problem is that you use the same 'layout/layout' identifier for both modules and during config merging, one is lost.</p> <p>The idea is to give different names for identifiers, and to use an abstract controller which will permits to change the layout. And on the <...
When testing an ExpressJS route using mocha+sinon, how do you "stub" a function that's local to the route? <p>So in one file, I have this route defined:</p> <pre><code>router.post('/', security.authenticate, function(req, res, next) { //Doing prep stuff //Do database work (&lt;&lt; this is what im really test...
<p>As stated by @DavidKnipe, all I had to do was export the methods via:</p> <pre><code>module.exports.createFormUser = (ourUser, call) =&gt; { ... } </code></pre> <p>And was able to both test the method individually and prevent it's execution via a sinon.stub. </p>
Filtering syntax for pandas dataframe groupby with logic condition <p>I have a pandas dataframe containing indices that have a one-to-many relationship. A very simplified and shortened example of my data is shown in the <a href="https://i.stack.imgur.com/7z1ih.jpg" rel="nofollow">DataFrame Example</a> link. I want to...
<p>I think your code works nice, only you can add use small changes:</p> <p>In <code>all</code> can be omit <code>axis=0</code><br> <code>grouped==True</code> can be omit <code>==True</code> </p> <pre><code>grouped=(namToViirs['nCldLayers']&lt;=1).groupby(level='namldx').all() grouped = grouped[grouped] filterIndex ...
jQuery refer to wrapper set from .each() <p>I'm rather new to jQuery and couldn't find an answer to this on SO. On form submit, I have the following script to validate fields before sending the data.</p> <pre><code>jQuery('#contact_form input, #contact_form textarea').attr('disabled', true).each(function(index, elemen...
<p>You could store all the fields in a variable before applying the each loop</p> <pre><code>var form_fields = jQuery('#contact_form input, #contact_form textarea'); form_fields.each(function(index, element){ // Disable current input jQuery(this).prop('disabled', true); //test for empty values, incorrect...
displaying jtable in another panel and remove one row <p>i have one <code>jtable</code> and it is displayed to 1st <code>jpanel</code> but at the same it has to be displayed again in 2nd <code>jpanel</code>. but i should remove the last row of the <code>jtable</code> before i'll display it to 2nd <code>jpanel</code>. a...
<p>So, let me see if I have this correct: table 1 and table 2 will be exactly alike except that table 1 will have one more row than table 2, right?</p> <p>If so, have them share the same TableModel, but have table 2 not display the last row of the model by using a row filter as per the <a href="http://docs.oracle.com...
How to distinguish a negative binary number? <p>Suppose I am dealing with 4 bit operations. So if I encounter an binary digit say </p> <pre><code>1111 </code></pre> <p>then what should I infer ? Is it -1 or 15 ?</p>
<p>"That depends".</p> <p>The bits are (in this case) encoding a number, but you have to know which kind of number (signed or unsigned, integer, fixed-point or float) in order to interpret the encoded bits.</p> <p>If the number is supposed to be signed in two's complement, then the proper interpretation is -1, if it'...
Comparing two large text files column by column in Python <p>I have two large tab separated text files with dimensions : 36000 rows x 3000 columns. The structure of the columns is same in both files but they may not be sorted.</p> <p>I need to <em>compare only the numeric columns</em> between these two files(apprx 297...
<p>First of all, if files are that big, they should be read row by row.</p> <p>Reading one file row by row is simple:</p> <pre><code>with open(...) as f: for row in f: ... </code></pre> <p>To iterate two files row by row, zip them:</p> <pre><code>with open(...) as f1, open(...) as f2: for row1, row2...
how to implement notification in php when row update in data base without refresh just like facebook <p>i am working on my final year project which is about to share images videos,text messages and i want that on my website when user send a text images videos its should be display like "rana send u a message"but its sh...
<p>What you are looking for is <a href="http://www.w3schools.com/xml/ajax_intro.asp" rel="nofollow">AJAX</a> and it JavaScript not PHP although they do work together a lot.</p> <p>Facebook actually made their own JavaScript framework for Facebook. It's called React and there is a tutorial to do pretty much what you wa...
retrieve from array for input parameter doesn't work <p>I want to do something like..</p> <pre><code>position := [100, 200] Click, position[1], position[2] </code></pre> <p>but the above doesn't work, no error, but doesn't do click</p> <pre><code>Click, %position[1]%, %position[2]% </code></pre> <p>above gives erro...
<p>This will do what you want:</p> <pre><code>click % position[1] . "," . position[2] </code></pre> <p>The % must be followed by a space or tab. It causes the command to use <em>expression mode</em>.</p> <p>More information on "expression mode" can be found under <strong>Help > Variables and Expressions > Variables ...
Is there a shortcut to do JS imports in WebStorm? <p>I spend a lot of time writing JS imports. Seems like WebStorm should be able to help me, but I can't find any shortcut for it. Perhaps there is a plugin somewhere...</p>
<p>There is a "Missing import statement" inspection that has a quickfix (available on <code>Alt+Enter</code>). Similar inspection is available for <code>require()</code>. See <a href="http://blog.jetbrains.com/webstorm/2015/11/node-js-coding-assistance-in-webstorm-11/" rel="nofollow">http://blog.jetbrains.com/webstorm/...
Python string assignment error occurs on second loop, but not first <p>The first run-through of the while loop goes fine:</p> <pre><code>hour_count = list('00/') hours = 0 while hours &lt; 24: #loop while hours &lt; 24 hour_count[1] = hours #&lt;- error occurs on this line hour_...
<p>When you run this line <code>hour_count = ''.join(hour_count)</code>, you're changing the data type of <code>hour_count</code> from a list to a string.</p> <p>Because strings are immutable, you can't modify one character via the index notation (the line before this line attempts to do that).</p> <p>I'm not totally...
google charts no data (blank page) <p>i have a web page contain 8 google charts </p> <p>when i have all data for the charts it work fine </p> <p>but sometimes there is some charts has no data (2 or 3 out of the 8 )</p> <p>so i get a blank page cause this charts </p> <p>how to skip the script of the blank data chart...
<p>i figured the right way to make it work :)</p> <p>the answer to this question is in the <strong><em>edited2</em></strong> in the question but there is a 1 change</p> <p>what you need is to to put the google chart load out the of the script and make it alone like that:</p> <pre><code> &lt;script type="text/javascr...
Customize Paypal checkout page <p>using PHP REST API SDK, is there a way to customize the first PayPal page that appears (login page) when doing a Payment. Specifically, we would like to move "Pay with Debit or Credit Card" above and make larger than "Pay with Paypal".</p>
<p>It is not possible to edit any portion of the hosted secure checkout page of PayPal standard or PayPal Express Checkout. The only change you 'can' make is add a logo or header image that populates and replaces the business name or email to the account.</p> <p>Hope this helps</p>
Catching exception when retrieving data from sqlite database Android <p>I have this on my DBHelper</p> <pre><code>public Cursor selectUser(String username){ SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery("SELECT * FROM user_tbl WHERE username = '" + username+"'", null); ...
<p>i think you are missing "moveToFirst"</p> <pre><code>SQLiteDatabase db = this.getReadableDatabase(); Cursor res = db.rawQuery("SELECT * FROM user_tbl WHERE username = '" + username + "'", null); if(res.getCount() &gt; 0){ res.moveToFirst(); String fullnamee = res.getString(res.getColumnIndex(DBHelper.USER_NAME...
building basic calculator (cant get user input for the operator) <p>so I'm brand new to programming, trying to build my 5th program, a basic calculator.</p> <p>so far i can ask for users to input an integer correctly;</p> <pre><code>public static void main(String[] args) { // CALCULATOR Scanner keyboard = new Sca...
<p>Surprisingly(?), <code>Scanner</code> does not have a <code>nextChar</code> method. Just read the operator into a <code>String</code> and you should be OK:</p> <pre><code>String operator; System.out.print("Enter operator (/*-+): "); operator = keyboard.next(); </code></pre> <p>You should also probably validate tha...
Step In with native code leads to garbage in Android Studio <p>I have native code I've built using Gradle in Android Studio. Most of the debugging seems to work fine in C++, but I just added a new class and when I try to step in to the function call it takes me to an absolutely bizarre location in a completely unrelate...
<p>Implementation of <code>PlatformHelper::getAppVersion();</code> can give insight to the problem. In this particular case it occurred that the method had no return value. For <a href="https://www.quora.com/Why-dont-I-receive-a-compile-error-when-I-dont-return-a-value-from-int-main" rel="nofollow">historical reasons</...
Using session variables in a partial rendered in realtime with ActionCable <p>I'm making a realtime chat application in Rails and I'm having trouble differentiating between the messages sent by each user. In my message partial I use the current_user session to apply either .current-user or .other-user to each message.<...
<p>I ended up rendering the message on the client side from the chat.coffee file, first getting the user id from the message form</p> <pre><code>user_id = parseInt($('#message_user_id').val()) </code></pre> <p>and then</p> <pre><code>received: (data) -&gt; if user_id == data.user_id ...
Wait for promise to return <p>I want to asynchronously load some data when my app starts and use the loaded data from a view controller that's presented later on in the apps' flow.</p> <p>How do I determine if the data has loaded and, if it hasn't, how do I wait for it to load?</p> <p>So if in AppDelegate the code is...
<p>Calling <code>.then</code> on a resolved promise seems to result in the closure being called immediately. So I just store the promise from the initial query, and then append a new <code>.then</code> to it whenever. If the data is loaded, its returned immediately, otherwise, hopefully, it will wait.</p>
Unwind Segue Navigation Bar Button Xcode 8.0 Swift 3.0 <p>I want to create an app in Xcode 8.0 that lets the user press a bar button item in the navigation bar. Once this button has been clicked an unwind segue will take place whilst also printing, "helloWorld" to the output section at the bottom of Xcode. I have succe...
<p>Try the following link will fix your problem and help you to get better understanding about unwind segue...</p> <p><a href="https://www.andrewcbancroft.com/2015/12/18/working-with-unwind-segues-programmatically-in-swift/#identifier" rel="nofollow">https://www.andrewcbancroft.com/2015/12/18/working-with-unwind-segue...
How to give index items different background images <p>I have an index view displaying multiple items with background images. The url is a string product.image. Here is my index view.</p> <pre><code>&lt;div class="products"&gt; &lt;% @products.each do |product| %&gt; &lt;style&gt; .product-image...
<p>You are defining a CSS class where the background image will most likely be the last image in the loop. You will want to remove the line that sets the image:</p> <pre><code>.product-image-index { background-size: cover; background-position: center; background-repeat: no-repeat; } </code></pre> <p>Also, move ...
Query a mongodb record comparing values in an array to the array passed in the query <p>I have a document in the format </p> <pre><code>{ "history": [ { "plugin": [ 1, 2, 3, 4 ] }, { "plugin": [ 2, 3, 4, 6 ] }, { "plugin": [ 1, 4 ] } ] } </code></pre> <p>and i have ...
<p>Run the following pipeline which uses the <strong><a href="https://docs.mongodb.com/v3.2/reference/operator/aggregation/filter/" rel="nofollow"><code>$filter</code></a></strong> operator to return a subset of the <code>history</code> array that passes a given specified condition. This condition makes use of the <str...
C++ - How to write back JSON into file <p>I'm using library from <a href="https://github.com/nlohmann/json" rel="nofollow">https://github.com/nlohmann/json</a><br> I need to write my JSON into file but I can't find anythink about that in doc.<br> Anyone can help?</p>
<p>You can dump the json object into a string with the <code>dump()</code> method and then write that into a file.</p>
Create inverse Kaplan Meier curve with response percents and time <p>I am trying to create an inverse KM plot of the time it takes for patients to respond to drug therapy. </p> <pre><code>Time response 3 57 4 35 4 85 4 90 5 55 6 65 6 89 6 72 9 97 9 89 9 98 10 99 10 92 13 99 14 50 15 97 18...
<p>For your question to solve I first reorganized your data into survival data I am used to. That is one row per event/censor. Then I fit a survival model and plot the KM.</p> <pre><code>dt &lt;- as.data.frame(matrix(c(3,57 ,4,35 ,4,85 ,4,90 ,5,55 ,6,65 ,6,89 ,6,72 ,9,97 ,9,89 ,9,98 ,10,99 ,10,92 ,13,99 ,14,50 ,15,97 ...
How do I get the total offset of one display object between an ancestor display object? <p>How would I get the distance from a display object in a nested container and a root container like the stage or spark Application? </p> <p>For example: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:Windowed...
<p>There doesn't seem to be Flash API for this. So it looks like you take the two display objects and get their position globally and then subtract the difference. </p> <p>Here's a function and it seems like it's working: </p> <pre><code>public function distanceBetweenDisplayObjects(source:Object, target:Object):Poin...
How to count the number of rows updated, on each day/date, for a given range of dates <p>My Oracle table has columns which contain the date (timestamp) on which each row was last updated. Column is defined as timestamp(6).</p> <p>I need to count the number of rows updated on every day/date, for a given date range. Ex...
<p>One option would be </p> <pre><code>SELECT trunc(timestamp_column) ,count(*) FROM your_table GROUP BY trunc(timestamp_column) </code></pre> <p>You could, of course, create a string for the "My Remarks" column that combined the information from these two columns if that's all that column is doing (in which...
How to run application in cmd.exe with Inno Setup? <p>Say I want to install an <code>app.exe</code> with Inno Setup, but when the installation is done, I want the program to run </p> <pre><code>cmd /k app.exe </code></pre> <p>instead of just <code>app.exe</code>.</p> <p>Currently I have:</p> <pre><code>Filename: "c...
<ol> <li>The command parameters have to go to a separate parameter <code>Parameters</code>. See the documentation for the <a href="http://www.jrsoftware.org/ishelp/index.php?topic=runsection" rel="nofollow"><code>[Run]</code> section</a>.</li> <li>You have to surround the path to the application with double-quotes as t...
Create a class that contains all functions of its parent class except one <p>Suppose I have two classes, one is:</p> <pre><code>class A{ public: void f1() { cout &lt;&lt; "function 1"; } void f2() { cout &lt;&lt; "function 2"; } void f3() { cout &lt;&lt; "functio...
<p>You should <strong>not make <code>B</code> inherit from <code>A</code>.</strong></p> <p>If <code>B</code> lacks some functionality of <code>A</code>, then <code>B</code> and <code>A</code> do not have the <em>is-a</em> relationship that inheritance is intended to model (and which clients will expect). You should us...
Microsoft CRM User Default Form Query <p>We're using Microsoft Dynamics CRM 2016 on-premise. Is there a way to do a database query on the default form that users will see for a specific entity?</p> <p>The reason I ask, we have a user that has an error when opening an email form: systemform With Id = a7415a93-0113-4d90...
<p>Users' most recently viewed forms are stored in the <code>UserEntityUISettingsBase</code> table. You can query the <code>UserEntityUISettings</code> view to see if any users are having the given form as their default form:</p> <pre><code>SELECT * FROM UserEntityUISettings WHERE LastViewedFormXml LIKE '%a7415a93-01...
How can I use PowerShell to install this service fabric project? <p>I have the following folder structure once I package my <a href="https://azure.microsoft.com/en-us/services/service-fabric/" rel="nofollow">Service Fabric</a> <code>NS1.NS2.MicroServicesTest</code> project (written in <code>C#</code>, using <code>.NET<...
<p>(from discussion to answer)</p> <ul> <li><p>After registering it, validate that your Application Type shows up when calling 'Get-ServiceFabricApplicationType'</p></li> <li><p>Check your Application Type version 1.0.0?</p></li> <li><p>Try using this command: <code>New-ServiceFabricApplication fabric:/ MicroServicesT...
Redshift (SQL): try convert to timestamp <p>I have a column with timestamps as string, like so:</p> <pre><code>starttime | attribute 2000-08-21T23:10:37Z | X </code></pre> <p>Now I want to convert these strings to proper timestamps in AWS Redshift. The following works for the row shown in the above examp...
<p>You missed out a minor detail: change all the <code>\d</code>s to <code>\\d</code>. As per the documentation <a href="http://docs.aws.amazon.com/redshift/latest/dg/pattern-matching-conditions-posix.html" rel="nofollow">here</a>:</p> <blockquote> <p>Amazon Redshift supports the following Perl-influenced operators ...
Questions to appear in the same location <p>My form has many Questions. I'm looking for a way to have all my questions appear in one single location rather than one below the other as seen in my code below - </p> <pre><code>&lt;p&gt; &lt;SPAN ID="FirstQuestion"&gt; Blah Blah Blah &lt;/p&gt; &lt;button class=...
<p><code>visibility</code> only masks the element, leaving the space it takes up. Perhaps you want <code>.show()</code>, <code>.hide()</code>?</p>
No Write Access on Wordpress Folder permissions for Bitnami running on AWS <p>I recently migrated my Wordpress sites to Bitnami on Amazon Web Services. Everything it up and running from the user's perspective, but I'm struggling with a minor permission issue with the themes folder. When I download (or upload my own) ...
<p>You need to connect to your server via SSH and execute the commands below described in order to assign correct permissions definitively: </p> <pre><code>sudo chmod -R g+w /opt/bitnami/apps/wordpress/htdocs/wp-content sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content </code></pre> <p>Then c...
how do I reset a input in python <p>so i have this code that basically consists of you asking questions, but i have it so the input answers the question, so you can only ask one question, then you have to reset the whole thing again and again, and i have it to ask you your name first so i want a loop that ignores that....
<p>Get rid of the <code>break</code>s, so the loop keeps prompting for new questions. For performance, change the subsequent <code>if</code> tests to <code>elif</code> tests (not strictly necessary, but it avoids rechecking the string if you get a hit early on):</p> <pre><code>while True: question = input("ask me ...
C# Generic class definition with inerited class syntax error <p>I've looked at a number of questions related to defining a generic class that inherits a base class, but did not see this case. (Sorry if I missed it.)</p> <p>My class is a generic class. It inherits a concrete base class. The constructor for the base cla...
<p>Just remove the <code>&lt;TValue&gt;</code> from the row of the constructor in the generic class:</p> <pre><code>public class DataItem { public DataItem(string sNameArg, string sAddressArg, bool nWriteAllowedArg) {} } public class DataItemType&lt;TValue&gt; : DataItem where TValue : struct { public DataIte...
CMake does not find boost_thread <p>I am trying to install the OpenGM library. However, while using CMake, I get the following error:</p> <pre><code> CMake Error at /usr/local/share/cmake-3.6/Modules/FindBoost.cmake:1753 (message): Unable to find the requested Boost libraries. Boost version: 1.62.0 Boost in...
<p>I have managed to handle this error by setting the Boost multithreading flag to ON n CMakeLists.txt.</p>
Javascript - Calculate missing 5 stars to reach desired rating <p>I would like to make a script that calculate how many "5" I need to reach 4.95 rating.</p> <p>I created an object:</p> <pre><code>var obMed = { 5: 0, 4: 0, 3: 0, 2: 0, 1: 0 }; </code></pre> <p>I got this function to update previous obj...
<p>If you do the equations you get the following relation (using the same variable names that your code uses)</p> <pre><code>function getNeed(div, somma) { return Math.ceil((4.95*div - somma) / 0.05); } </code></pre> <p>As I understand that <code>div</code> is the total amount of votes sent, and <code>somma</code> ...
Renumbering Identical Field Values <p>I have a table with field values that are identical (0). I want to renumber them sequentially backwards starting with -1. There are about 1800 rows with this field value. Is there a way to do this with a query? I'd rather not use VBA for this task if I don't have to.</p>
<p>You can use an autonumber field to generate your numbers.</p> <p>Since you have rows with different values than 0 in the field you need to number, it gets sloppy. You would extract the '0' rows, place them an interim table with its own autonumber field (start value 1, increment by +1), run this query (for this exa...
How to Get key value pair tuple array in swift? <p>I have pairs tuple array pickerDataVisitLocation.just I want to know how to return key value pair location from my array using uniqId ex 204 </p> <pre><code>var pickerDataVisitLocation:[(uniqId:Int,location:String)] = [(203,"Home"),(204,"Hospital"),(205,"Other")] var ...
<p>According to the given code: <br>Try this</p> <pre><code>var pickerDataVisitLocation:[(uniqId:Int,location:String)] = [(203,"Home"),(204,"Hospital"),(205,"Other")] let selectedIndex = pickerDataVisitLocation[1].uniqId var location = "" for item in pickerDataVisitLocation { if item.uniqId == selectedIndex { ...
Grouping columns into count in R dataframe <p>So i have these 4 different cols in total in a dataframe</p> <pre><code> port ip service numberOfTimes 1 22 11.11.79.100 ssh 16 2 80 11.11.79.100 www 19 3 111 11...
<p>Using <code>dplyr</code>, this is quite straightforward:</p> <pre><code>testData %&gt;% group_by(port, service) %&gt;% summarise(`Number of IPs` = n_distinct(ip) , `Total number of times` = sum(numberOfTimes)) </code></pre> <p>Which for the sample data you included gives:</p> <pre><code> port se...
Making JavaScript items independent <p>I'm using a jQuery script to expand/collapse a div on a page an it works perfectly. I'm now trying to replicate the code so there are two divs which do the same but I want them to be independent however when I click one, both open/close. Just wondering what i'm doing wrong? </p> ...
<p>Instead of using a class selector for your open/close animation try focusing on referencing your element in relation to the item clicked.</p>
Map requests to other directory with htaccess without redirect <p>I have a project structure like this:</p> <pre><code>/php/ rest.php /public/ index.html /src/ /css /js /img /src/ /sql/ .htaccess </code></pre> <p>I think it would be pretty nice if only files in /public/ would be ...
<p>You can use this rule in site root .htaccess:</p> <pre><code>RewriteEngine on RewriteRule ^(?!public/)(.*)$ public/$1 [L,NC] </code></pre> <p><code>(?!public/)</code> is negative lookahead to prevent infinite looping, that avoid forwarding to <code>/public/</code> if URI already starts with <code>/public/</code>....
How to install Baidu's PaddlePaddle on ubuntu 16.04? <p>I recently wanted to install PaddlePaddle on ubuntu 16, but there's a missing dependency, the package requires libgflags2, I couldn't find this library on Ubuntu's canonical repos, I found libgflags2v5 instead, so I played a little with the paddle's package depend...
<p>Out of the box installation, see <a href="http://www.paddlepaddle.org/doc/build/" rel="nofollow">http://www.paddlepaddle.org/doc/build/</a></p> <p>For Ubuntu without GPU:</p> <pre><code>sudo apt-get install gdebi wget https://github.com/baidu/Paddle/releases/download/V0.8.0b1/paddle-cpu-0.8.0b1-Linux.deb gdebi pad...
Why ion auth library use custom where() instead of using the native where() CI provided <pre><code> public function groups() { $this-&gt;trigger_events('groups'); // run each where that was passed if (isset($this-&gt;_ion_where) &amp;&amp; !empty($this-&gt;_ion_where)) { foreach ($this-&gt;_...
<p>It seems to me the main reason is to implement event hook functionality. All the "duplicate" db functions make a call to <code>$this-&gt;trigger_events()</code> which in turn calls any function provided to <code>set_hook()</code>. </p> <p>I have a really vague recollection of noticing some other decent reason. But ...
Idle timer never activated so App never sleeps <p>I have an app with a sleep timer where the user can select that after a certain duration of time, the app will suspend. Basically what I do is:</p> <ol> <li><p>Use this code at the start of the app to disable the app timer:</p> <p>[[UIApplication sharedApplication] se...
<p>I think I found the answer — there were actually two problems. 1. So long as I'm running and building on Xcode, the app will never go to sleep (I think). 2. My app has sound so I'm doing something like this to ensure the controls and audio still work in when the device is locked:</p> <pre><code>audioSession = [AV...
How to implement database download at install and after in app purchase <p>My app is an e-learning app. Content is served from a database on the user's device. Currently my database is 'Realm' and not 'SQLite'. My question is: How do I have my users download part of the database on installation and then as they progres...
<p>My question was too much of a generalisation, but bottled down, <strong>Firebase Database</strong> is the way to go if your files aren't Gigabytes big. Did my research, designed my solution, works perfectly, is elegant and if anyone's interested post on this thread, I'd be glad to lay everything down, just don't kno...
Double Click on Edge of Cell Jump (How to Disable?) <p>The code takes an active cell and if it is in the appropriate column, and has the value "YES" it runs one of two codes (depending on whether it is a summary or an individual value). This done on 'raw' data that is not in a table or pivot table. </p> <p>About half ...
<p>First of all, let me organize your code, it is not very easy to read. Hope this works, I cannot try it right now.</p> <pre><code>Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim j As String Dim k As String Dim i As Range Application.ScreenUpdating = False Cancel = F...
Is it necessary to explicitly instantiate an array in java? <p>How does instantiation work in this code:</p> <pre><code>// decleration dataType[] arrayRefVar; //instantiation - is it required? arrayRefVar = new dataType[arraySize]; //A arrayRefVar[0]=1; //B arrayRefVar[1]=2; </code></pre> <p>I am from a C++ back...
<p>This is just reference(pointer) declaration but not object creation </p> <pre><code>// decleration dataType[] arrayRefVar; </code></pre> <p><strong>new</strong> keyword specifies that new memory location for given Type has to be created. This step is your actual object creation not the above step.You are pointing...
What Regular Expression would Pass these Conditions? <p>How do i write regular expression to pass the following?</p> <pre><code>LastName LastName SecondLastName LastName-SecondLastName LastName, F LastName SecondLastName, F LastName-SecondLastName, F LastName, FirstName LastName SecondLastName, FirstName LastName-Seco...
<p>How about you try something like:</p> <pre><code>^[a-zA-Z]+([- ][a-zA-Z]+)?(, [a-zA-Z]+([- ][a-zA-Z]+)?)?$ </code></pre> <p>Example: <a href="https://regex101.com/r/ipffrk/3" rel="nofollow">https://regex101.com/r/ipffrk/3</a></p>
converting LocalDate to GregorianCalendar in java <p>I want to convert LocalDate to GregorianCalendar. Please advice. In my application we are using GregorianCalendar to work with date's. But i got a joda LocalDate as a return type when i called one of the webservice. Now i want to convert that LocalDate to GregorianCa...
<p>Try this example to convert LocalDate to GregorianCalendar </p> <pre><code>LocalDate localDateObj = LocalDate.now(); GregorianCalendar gc = GregorianCalendar.from(localDateObj.atStartOfDay(ZoneId.systemDefault())); </code></pre> <p>Note: gc.OCTOBER is set to 9 but it is indicating the tenth mo...
For a spring application, do changes made to application context propagation levels take immediate effect? <p>I have a web application in production that is based on spring transactions. propagation levels are set in applicationcontext.xml. Will tomcat pick up any change I make to the propagation levels in this xml wit...
<p>Usually, applicationContext.xml will be IN your WAR file. In this case you will need to redeploy it. If for some reason it is outside your WAR, then changing it and restarting tomcat will be OK. PS of course you can change the applicationContext.xml in the exploded version of your WAR but this is not suggested as ch...
php array syntax ${ is confusing me <p>I create a $values array and then extract the elements into local scope.</p> <pre><code> $values['status'.$i] = $newStatus[$i]; extract($values); </code></pre> <p>When I render an html page. I'm using the following</p> <pre><code> &lt;?php if(${'status'.$i} == 'OUT'){ ?&gt; <...
<p><code>$status.$i</code> means </p> <blockquote> <p>take value of <code>$status</code> variable and concatenate it with value of <code>$i</code> variable.</p> </blockquote> <p><code>${'status'.$i}</code> means</p> <blockquote> <p>take value of <code>$i</code> variable, append id to <code>'status'</code> string...
Why is my image being distorted (shrunk) in Firefox? <p>This problem occurs on Firefox. On Chrome all is well. </p> <p>I have a magnifying glass image next to my search fields.</p> <p>However, on Firefox the image is being distorted (shrunk) and I can’t figure out why.</p> <p>Here’s the Fiddle — <a href="https...
<p>An initial setting of a flex container is <code>flex-shrink: 1</code> (<a href="https://www.w3.org/TR/css-flexbox-1/#flex-shrink-property" rel="nofollow">source</a>).</p> <p>This means that, by default, flex items are allowed to shrink below their initial size in order to fit inside the container.</p> <p>For your ...