input
stringlengths
51
42.3k
output
stringlengths
18
55k
Page Transformer animation like Google Play Books app <p>I want to implement <code>animation</code> when change the page in <code>ViewPager</code>, I know that I must use <code>PageTransformer</code>. I want to create an <code>animation</code> as <code>Play Books</code> app from google (like <a href="https://www.youtub...
<p>There are many page curl libraries:</p> <p><a href="https://github.com/emilsjolander/android-FlipView" rel="nofollow">android-FlipView</a></p> <p><a href="https://github.com/SalmanJawed/transitionviewpager" rel="nofollow">transitionviewpager</a></p> <p><a href="https://github.com/openaphid/android-flip" rel="nofo...
How to understand call destructor method in CPP? <p>I am trying to understand the Destructor method in CPP. I have known facts: a. Destructor method would be automatically called when the instance ends. b. If no explicit destructor methods defined, then compiler would create a default Destructor (though no specific ta...
<p>A destructor is going to get called exactly once for every instance of a class. I am excluding the marginal case of program termination making the entire process go away without invoking the oustanding objects' destructors (no point to it).</p> <p>In your example, <code>p</code> is a pointer to an array containing ...
Getting current Date by CultureInfo <p>I'd like to get localized date in my Xamarin Forms app. I have tried two ways that work just fine in ASP.NET MVC, but I wonder why neither of them works in Xamarin.</p> <pre><code>var currentDate DateTime.Now.ToString("yyyy/mm/dd", new CultureInfo("fa-IR")) </code></pre> <p>And ...
<p>.Net framework doesn’t support Persian calendar for the culture. This culture doesn’t accept the calendar; therefore display of DateTime in this culture is impossible.</p> <p>You need to create a custom <a href="http://stackoverflow.com/questions/15817348/how-to-customize-cultureinfos-default-calendar">helper</...
Application all of a sudden crashing <p><strong>Background Info:</strong></p> <p>I have been helping a friend of mine with an Android Application. He had the app built by some contractors who weren't very helpful. I told him I would help him out. </p> <p>All of a sudden last week the app started crashing. </p> <p>I ...
<p>The problem and the solution for the crash are both in the error trace:</p> <blockquote> <p>Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.myapp.myapp/com.myapp.myapp.Register}; have you declared this activity in your AndroidManifest.xml?</p> </blockquote> <...
Hiding the loader when updating kartik grid <p>I have a grid that gets updated every 3 seconds. Everything working fine but the problem is that the loader (showing...loading) keeps on poping up everytime the grid is updated. </p> <p>This is what I have tried:</p> <pre><code> echo DynaGrid::widget([ 'columns' =&...
<p>Use this in your widget</p> <pre><code>'afterAjaxUpdate' =&gt; 'function(id) { $(\'.loader\').hide(); }' </code></pre> <p>Hope that will help you.</p>
Unable to parse through sqlite query using regular expressions <p>I am trying to figure out a way to iterate through a database and match all rows that have 02 in them using regular expressions. When a match is made the count should reset to 0 and when there is not a match the count should accumulate by negative 1. The...
<p>You probably want to use <a href="https://docs.python.org/3/library/re.html#re.search" rel="nofollow"><code>r.search()</code></a> to execute a regular expression search:</p> <pre><code>for i in rez: if r.search(i[0]): count = 0 else: count -= 1 </code></pre> <p>Note the use of <code>i[0]</c...
why no tkinter distribution found <p>while installing tkinter i am having problem ,i have version 2.7.11. i have entered the <code>pip install tkinter</code> on dos but it shows the following message : </p> <blockquote> <p>collecting tkinter </p> <p>Could not find a version that satisfies the requirement tkinte...
<p>The Tkinter library comes in default with every Python installation</p> <p>Try this:</p> <pre><code>import Tkinter as tk </code></pre>
xCode 8, swift 3, Facebook SDK login using LoginManager have to click twice to open FB login form <p>I'm using below function to login with Facebook, but I always have to click Login button twice to open the Facebook login page.</p> <p>I already tested on simulator and device. The first time I click login button, the ...
<p>This code works for me. The completion handler is called during each tap of the button.</p> <p>Xcode version - 8.0</p> <p>FBSDK version - 4.15.1</p> <pre><code>@IBAction func loginTest(_ sender: UIButton) { let loginManager = FBSDKLoginManager() loginManager.logIn(withReadPermissions:["public_prof...
Sir Trevor is not defined <p>I am new to Node.js. I wanted to use Sir Trevor Editor. So, I followed the following procedure.</p> <p><code>npm install sir-trevor cd node-modules/sir-trevor npm install npm run dev</code></p> <p>Then I opened examples/index.html but page showed ordinary html textarea and following javas...
<p>Did you include the javascript and css files within node-modules/sir-trevor into your html page?</p>
Cofusing about lookup node with binary tree <p>I build a binary tree with python code, now I could print it in order with <code>testTree.printInorder(testTree.root)</code>. I have tried to lookup some node ,and the function <code>findNode</code> doesn't work anymore . <code>print testTree.findNode(testTree.root,20)</co...
<p>When you recurse to children in <code>findNode</code> you need to return the result, otherwise the function will implicitly return <code>None</code>:</p> <pre><code>def findNode(self,node,value): if self.root != None: if value == node.data: return node.data elif value &lt; node.data ...
prototype function which will check all other function return true or false <pre><code>function checkname(){return false;} function checkemail(){return false;} //submit function submitFormFunction(event){ //array validation function var validators = [checkname, checkemail]; // bypass ...
<p>you can still use your code and instead of giving reference as function name use instance.functionname for ex.</p> <pre><code>submitFormFunction = function(event){ //array validation function var validator = new ClassSignUpValidation var validators = [validator.checkname, validat...
change cell value on button click <p>I have a table with the following.</p> <pre><code> Table parts_stock *--------------------* | id | sku | stock | | 1 | 101 | 2 | | 2 | 102 | 3 | *--------------------* </code></pre> <p>This is my code so far, i'm sure there are many ways to achieve this but ideally...
<p>In your <code>HTML Button</code> to have a <code>onClick</code> event like this <code>onclick="buttonSubtract1('&lt;?php if(isset($val['itm_code'])){echo $val['itm_code'];}?&gt;')"</code><strong>(You can fetch the itm_code from your db)</strong>.Then Write your <code>AJAX</code> for <code>Request</code> and <code>Re...
vb.net sql bulkcopy non string values issue <p>Can I use sqlbulkcopy to insert non string values from a csv file to an sql table?</p> <p>I have the following code to create a datatable :</p> <pre><code> Dim dt As New DataTable() Dim line As String = Nothing Dim i As Integer = 0 Using sr As StreamRead...
<p><code>SqlBulkCopy</code> will insert the data from your <code>DataTable</code> so if you want to insert data that is not text then your <code>DataTable</code> has to contain data that is not text. It's your responsibility to convert the data that you read from the CSV file into the appropriate data types before add...
Displaying foreign key values using php mysql <p>I have 3 tables which are <code>states</code>, <code>cities</code>, <code>colleges</code>. All are contains id and corresponding names. I have one more table <code>students</code> with column names are <code>id, studentname, state, city, college</code>.</p> <p>Now i nee...
<p>use sql join assuming state_id, city_id, college_id are saved for each student for ex.</p> <pre><code>SELECT `states.*`, `cities.*`, `colleges.*`, `students.*` FROM `students` left join states on states.id = students.state_id left join cities on cities.id = students.city_id left join colleges on colleges.id = stude...
When using PyMongo, No handlers could be found for logger "apscheduler.scheduler" <p>The code works fine printing to screen <code>hello</code> every second. This is done using the <code>bar</code> method, which is added to the scheduler as a job.</p> <p><strong>Problem:</strong> However when the line <code>self.db.ani...
<p>That's not an error, but a warning. Python's logging system is trying to tell you that it has no outlet for logging output because you haven't configured it. Try using <code>logging.basicConfig(level=logging.DEBUG)</code>.</p>
get the value of the drop down in jquery on page load <p>I want to get the value of the dropdown on document ready but i am getting only the first value of the drop down I have tried this</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"&gt;&lt;...
<p>try this</p> <pre><code>&lt;script&gt; $(document).ready(function() { var car = $('.car :selected').val(); alert(car); }); &lt;/script&gt; </code></pre>
How to stack + center two text views using programatic constraints? <p>I'm trying to achieve a hard coded layout where two text views should be stacked on top of each other and centered in a parent UICollectionViewCell:</p> <pre><code>---------------------- | | | This is text | | Also tex...
<p>Let's asume that the labels are named <code>textView1</code> and <code>textView2</code>.</p> <p>What you need is to set a constraint for centering horizontally <code>textView1</code> to it's <code>superview</code>(the <code>UICollectionViewCell</code>), then center <code>textView2</code> with <code>textView1</code>...
Hide element on checkbox click/check, re-insert element on checkbox uncheck <p>Im learning Jquery so please bear with me here I would like to hide / remove a <code>DIVs</code> content if a checkbox is check></p> <p>When checkbox is <strong>unchecked</strong> <strong>I would like the <code>DIVs</code> content to re-app...
<pre><code>$(function() { $('.return_to_pickup_location').click(function() { //fire when the button is clicked $('form input:checkbox').each(function() { var checkbox = $(this); if(checkbox.is(':checked')) $('.returnLocation').hide("slow"); else $('....
Upgrading OS, will it keep android packages? <p>I have android studio (I don't use it) installed in my windows 8.1 and I am upgrading my os to windows 10. Which folders should I backup to skip downloading the packages from Android SDK Manager in Windows 10. </p> <p>I don't have knowledge of android studio yet and as i...
<ol> <li>Open your user under the Users in C drive.</li> <li>Go to the location \AppData\Local\Android and backup the entire sdk folder. (Note the AppData folder might be hidden).</li> <li>After upgrading, place the backup in exactly the same location as before.</li> </ol> <p>Happy Upgrading! :)</p>
"cannot find symbol" error in Java <p>I am new to Java, and trying out simple examples to get familiar with the basics. This is a program to see if three integers specified by the user are all equal.</p> <pre><code>import java.lang.*; import java.util.*; public class CheckEqual{ public static void main(String [] ...
<p>Java uses a scope on every variable. Basically, if you create a variable in a if block, like the following :</p> <pre><code>if(statement){ int x = 1; } x++; </code></pre> <p>The x variable only exists in the scope of the if block. It doesn't exist afterwards. Meaning that x++ will create an error because x d...
how to write findOneAndUpdate query in express.js? <p>i have shown my data , which is stored in database like this</p> <pre><code>{ "_id": { "$oid": "5799995943d643600fabd6b7" }, "Username": "xx", "Email": "xx@gmail.com", "Info": "Deactivate", "Description": "aajdjdjddjdkjddjdjdhdj", ...
<pre><code> exports.updatearticle = function(req, res) { Article.findOne( { "Username":'xx', "Email":'xx@gmail.com', "Info": "Deactivate" }, function(err, result){ if (!err &amp;&amp; result) { result.Info = "Active"; // update ur values goes here result.VerificationCode = ""; resu...
change keyboard language in client-side programming languages <p>I want to focus in input element change keyboard language.<br> is there a way to change keyboard language in client-side programming languages ?<br> is there a way to change keyboard language in javascript ?<br></p>
<p>With a Windows software for Windows, yes, for other OS with locally installed software, most likely yes, with javascript, no, assuming you mean running inside a web browser.</p>
jQuery storing attribute into an array or object between two classes <p>I have following markup.</p> <pre><code>&lt;div class="block" my_id="1"&gt;1&lt;/div&gt; &lt;div class="block first" my_id="2"&gt;2&lt;/div&gt; &lt;div class="block" my_id="3"&gt;3&lt;/div&gt; &lt;div class="block" my_id="4"&gt;4&lt;/div&gt; &lt;d...
<p>you can use .each() and add the attribute value to array for ex.</p> <pre><code>var number_store = []; $('.first').nextUntil('last').each(function(){ number_store.push($(this).attr('my_id')); }); </code></pre>
How to select current element by class inside in jQuery? <p>I have a loop that dynamically populates information.</p> <pre><code>&lt;div class="main"&gt; &lt;div class="more"&gt; more &lt;/div&gt; &lt;span&gt;&lt;/span&gt; .... &lt;div class="more"&gt; more &lt;/div&gt; &lt;span&gt;&lt;/span&gt; &lt...
<p>You can use <code>$(this)</code> inside click handler to get the clicked button. Make sure to capture it in click handler, not in AJAX callback:</p> <pre><code>$(document).on("click", ".more", function (event) { var clickedDiv = $(this); // &lt;- capture clicked div to variable $.ajax({ url: '..',...
Create a rounded checkbox with boarder <p>This is how I create a rounded <code>checkbox</code> with boarder. But the boarder is in square shape,not circle. </p> <p><strong>CheckBox</strong></p> <pre><code>&lt;CheckBox android:id="@+id/checkBox" android:paddingTop="15dp" android:pad...
<p>use this xml as background in your radio button .....</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item&gt; &lt;shape android:shape="oval"&gt; &lt;stroke android:color="#1E90FF" android:width="10dp...
Excel: get the value of third column on the behalf of second column <p>i am not much familiar with excel formulas and i am trying to get the value of third column on the behalf of second column. Example:</p> <pre><code>|---------------------------------------------------------| | A B C D ...
<p>Use <code>VLOOKUP</code>. Enter the following formula into cell <code>C1</code> and then copy it down the <code>C</code> column:</p> <pre><code>=VLOOKUP(B1, D$1:E$4, 2, FALSE) </code></pre> <p>To cover more than 4 rows, then just update the formula accordingly. If you want to display a certain placeholder value ...
how to receive JSON data from angularjs into laravel <p>Help me on this:</p> <p>I am sending JSON data through angularjs to laravel :</p> <p>My angularjs Json code like:</p> <pre><code> $scope.addnew = {name:'',email:'',message:''}; $scope.addnew.name=$scope.name; $scope.addnew.email=$scope.em...
<p>You can retrieve your input at Laravel using <code>$request-&gt;input('your_json_key')</code>.</p> <p>Example basic saving data:</p> <pre><code>$post = new Post(); $post-&gt;title = $request-&gt;input('title'); $post-&gt;save(); </code></pre> <p>Those above code will create new post and save it to <code>posts</co...
Converting INT minutes to HOUR in SQL server <p>I'm writing a view to get hours of holiday count from the minutes.</p> <p><strong>Minutes data type is INT in the data table</strong></p> <p>I wrote this but it doesn't work:</p> <pre><code>DATEPART(HOUR, CONVERT(DATETIME, '00:' + CAST(S.availablevacations AS NVARCHAR(...
<p>you can try this</p> <pre><code>SELECT CONVERT(NUMERIC(18, 2), `TotalMinutes`/ 60 + (`TotalMinutes`% 60) / 100.0) </code></pre> <p>this will convert you minutes to HH.MM format sql format</p>
Can a Finite Automata exist without any final state? <p>It doesn't make sense to construct a language acceptor which does not able to accept any language. I specifically talking about FA which accept languages not transducer or translator which translate languages. </p>
<p>People build them all the time. You have a set of states, and each state is accessible ultimately from every other, and there is no final state, so it never halts, though it might get stuck in a cycling loop. No issue with that at all.</p> <p>Do a search on "busy beaver".</p>
Azure Active Directory Users and SaaS Application using Microsoft Graph Api <p>I am developing a SaaS application that requires external organizations' AD users to sync appointments to Office 365 calendar event.</p> <p>Admin user scenario:</p> <ol> <li>Admin imports all AD Users to the app.</li> <li>The app redirects...
<p>First, I recommend against importing all users to your app. It is best to only provision the users you actually need, in a "just in time" manner as they sign in. If your app has scenarios where it's useful to list other users in the tenant (e.g. a "people picker"), you can use the Microsoft Graph API on-demand.</p> ...
change string in TASM <p>I'm try to write program for searching smallest word in the input string using this algorithm.</p> <p>My Algorithm:</p> <pre><code>Read character from input, but not echo If character is space: current_string_length = 0; current_string = ""; echo character Else If character belong...
<blockquote> <p>can't find way to add character to string and clean string. </p> </blockquote> <p>Well, in the first place it depends on your definition of what is string (this is common theme in assembly, deciding how you store your data, ie. which bits/bytes are used for what and what meaning you give them).</p> ...
how to export environment variable using newman API <p>i'm running a postman test suit using newman api. Its executing properly as expected but i want to export environment variable generated during test execution in file, in command line it is possible using --export-environment:</p> <pre><code>newman run collectionP...
<p>Not possible per <a href="https://nodejs.org/api/process.html#process_process_env" rel="nofollow">NodeJS documentation</a>.</p> <blockquote> <p>The process.env property returns an object containing the user environment. See environ(7).</p> <p>An example of this object looks like:</p> </blockquote> <pre><c...
Pygame: Collision of two images <p>I'm working on my school project for which im designing a 2D game.</p> <p>I have 3 images, one is the player and the other 2 are instances (coffee and computer). What i want to do is, when the player image collides with one of the 2 instances i want the program to print something.</p...
<p>Use <a href="http://pygame.org/docs/ref/rect.html" rel="nofollow">pygame.Rect()</a> to keep image size and position. </p> <p>Image (or rather <code>pygame.Surface()</code>) has function <code>get_rect()</code> which returns <code>pygame.Rect()</code> with image size (and position).</p> <pre><code>self.rect = self....
how ot use (in_array) <p>I am using ‘ ‘to pass my array value from one page to another. I have an array value that is doesn’t have value always. How to put condition when it have value pass it but I don’t have idea about (in array) in . </p> <p>this is my passing code</p> <pre><code>echo '&lt;td &gt;&lt;a ...
<p><strong>in_array — Checks if a value exists in an array</strong></p> <pre><code>&lt;?php $names = array("VYSAKH", "DODESTINO", "CHOORAKKATT", "VYSU"); if (in_array("DODESTINO", $names)) { echo "Got DODESTINO"; } if (in_array("VYSU", $names)) { echo "Got VYSU"; } ?&gt; </code></pre>
oracle rman duplicate database <p>I'm trying to duplicate from active database. I have configured everything according to oracle docs. still in the middle of the process I get the error </p> <pre><code>RMAN-06025: no backup of archived log for thread 1 with sequence 58 and starting SCN of 2001221 found to restore </co...
<p>I solved the problem by switching to backup based duplication. at fist I got the same error, following instructions in here: <a href="https://oracle-base.com/articles/11g/duplicate-database-using-rman-11gr2" rel="nofollow">https://oracle-base.com/articles/11g/duplicate-database-using-rman-11gr2</a></p> <p>I did a p...
I want to make effect to my photos.How can i Separating the image in pixels?(for image effect) <p>I want to separate the pixels of the image.Also i have a lot of picture.How do i do it serially?</p> <p><a href="http://i.stack.imgur.com/IOJ32.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/IOJ32.jpg" alt="image ...
<p>This is just a sample code "not tested" in c#.</p> <pre><code> private void ImageToPixcels() { Bitmap img = (Bitmap)Image.FromFile(@"D:\sample.jpg"); Color[,] pixels = new Color[img.Width, img.Height]; for (int x = 0; x &lt; img.Width; x++) { for (int y = 0; y &lt; ...
I want to convert json according to my format <p>// I am converting sqlite data into json format </p> <p>try</p> <p>{</p> <pre><code> SQLiteDatabase db; String dbDir= Environment.getExternalStorageDirectory()+"/"+getResources().getString(R.string.folderName);; db=getActivity().open...
<p>You can use Jackson library -</p> <ol> <li><p>Create a response class.</p></li> <li><p>Use @JsonProperty annotation -</p></li> </ol> <p>@JsonProperty("product") private String jsonArray;</p> <p>//getter</p> <p>//setter</p> <ol start="3"> <li>Set your json response string in the response object.</li> </ol>
pexpect not executing command by steps <p>I have this Python3 code which use Pexpect.</p> <pre><code>import pexpect import getpass import sys def ssh(username,password,host,port,command,writeline): child = pexpect.spawn("ssh -p {} {}@{} '{}'".format(port,username,host,command)) child.expect("password: ") ...
<p>You may lack permission for executing commands through ssh. Also there is possibility that your program sends scp before prompt occurs.</p>
Linux bash script to add data to database <p>I am trying to write a bash script that will pull data from a csv file and put it in a format where I can place it in a database. The csv file has about 1000 rows and 8 columns. When I use the command line I can get the data formatted exactly how I want. I am using the lates...
<p>I agree with @GhostCat for sure, parsing a CSV is much more complicated than just splitting on comma, though some trivial CSVs might work. Often, though, a CSV can contain commas within a field, so splitting on comma would break things.</p> <p>That said, your problem here with why the script isn't doing what you w...
command failed due to signal: Segmentation fault: 11 when swift 3 migration <p>my example code is <a href="https://drive.google.com/open?id=0B-bSY9YevABJZG9KaFJBSnQ5TXc" rel="nofollow">here</a> and my fault is under the line thanks for advices.</p> <p><a href="http://i.stack.imgur.com/vWOHH.png" rel="nofollow"><img s...
<p>This issue is dynamic and each time there is something for which compiler will complain.</p> <p>I think given line of code in <code>viewDidLoad</code> causing problem. Don't know compiler why complaining.</p> <p>But if you comment this line of code then error will get removed. Try once by removing this line.</p> ...
Exception from HRESULT: 0x80070005 (E_ACCESSDENIED) <p>I get a <strong>80070005 Access is denied</strong> error when attempting to deploy a Crystal Report to the server. I have tried every solution in this <a href="http://stackoverflow.com/questions/14019401/80070005-access-is-denied-when-asp-net-website-with-crystal-r...
<p>Check this:</p> <pre><code>1.)Goto inetmgr or IIS 2.)Application pools 3.).NET Framework Version. </code></pre>
Give a sub-rectangle, how does one divide the remainder of a rectangle into two parts such that the two new rectangles are more "squarish"? <p>I have a rectangle R1, with width w1, height h1.</p> <p>I am given a smaller rectangle R2 (w2,h2), whose origin is the same as R1 ie. (0,0).</p> <p>How can I divide the remain...
<p>We have an L shape, so we want to know whether to cut it vertically or horizontally to make the rectangles more "square". By "more square" we mean minimising perimeter. So the answer is simple. Make the shorter of the two cuts.</p>
NodeJS, Express, why should I use app.enable('trust proxy'); <p>I was needed to redirect http to https and found this code:</p> <pre><code>app.enable('trust proxy'); app.use((req, res, next) =&gt; { if (req.secure) { next(); } else { res.redirect('https://' + req.headers.host + req.url); } ...
<p>If your not running behind a proxy, it's not required. Eg, if your running multiple websites on a server, chances are your using a Proxy. </p> <p>X-Forwarded-For header attributes get added when doing this so that your proxy can see what the original url was, proxying in the end will be going to localhost you see....
how to convert mongodb queries into java <p>how to convert mongodb queries into java</p> <p>I want to convert following query into java</p> <pre><code>db.Student.aggregate( {$group : {_id : "$prnno", x: {$push:"$name"} , st:{$push: "$per"} }}, {$sort:{st:-1} },{$limit:3}); </code></pre>
<p>Try this one, I hope it helps:</p> <pre><code>collection.aggregate(Arrays.asList({$or:[ new BasicDBObject("$match", new BasicDBObject("x", {$push:"$name"})), new BasicDBObject("$match", new BasicDBObject("st", {$push: "$per"}))], new BasicDBObject("$sort", new BasicDBObject("st", -1)), ...
codeigniter session loading error: No such file or directory <p>I am following this <a href="https://www.formget.com/form-login-codeigniter/" rel="nofollow">tutorial</a>: </p> <p>however when I access to</p> <p><a href="http://localhost/index.php/user_authentication/" rel="nofollow">http://localhost/index.php/user_au...
<p>Make sure you have set your session save path something like</p> <pre><code>$config['sess_save_path'] = APPPATH . 'cache/'; </code></pre> <blockquote> <p>Folder Permissions 0700</p> </blockquote> <p>Config.php</p> <pre><code>$config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config[...
I have to create same Jhipster yo.rc.json as in my old project <p>I am working on rebuild the same jhipster application as previous one bcoz old project are having some problems. The problem is that, project was created in version 2.1.27 and I have to create the same kind of project in 3.8.0. So, jhipster question and ...
<p>You should use JWT authentication. This was changed in 3.0 <a href="https://github.com/jhipster/generator-jhipster/commit/2f017636700790aa5b38554da71fc27801b67cd3" rel="nofollow">https://github.com/jhipster/generator-jhipster/commit/2f017636700790aa5b38554da71fc27801b67cd3</a></p> <p>Regarding migration of your ful...
How to return from function with some error checking in Go <p>I have several data to load, and If one of them fails, I have to log error and not continue to run the code.<br> Is this code OK? And how to do that?</p> <pre><code>func (worker *Worker) GetData() error { err := worker.LoadModelA() if err != nil &amp;&a...
<p>With error in A (try it on <a href="https://play.golang.org/p/5YnhFN0TMC" rel="nofollow">The Go Playground</a>), output:</p> <pre><code>LoadModelA 2009/11/10 23:00:00 LogError 2009/11/10 23:00:00 Error LoadModelB </code></pre> <p>With error in B (try it on <a href="https://play.golang.org/p/-vZeZi5Moh" rel="nofoll...
How to limit array depth in php <p>I want to get up to 10 level in multidimensional array. </p> <p>Here is my code from which i get up-to infinite depth, but i want to limit this to 10 levels.</p> <pre><code>function tree($parent){ global $db; $sql = "SELECT * FROM clients WHERE parent_id = $parent "; $users=$db-&g...
<p>You can use <a href="http://php.net/manual/en/class.recursiveiteratoriterator.php" rel="nofollow">RecursiveIteratorIterator API</a> and use <a href="http://php.net/manual/en/recursiveiteratoriterator.setmaxdepth.php" rel="nofollow">setMaxDepth()</a> function and can get the maxDepth with this function <a href="http:...
Autobean returns an autobean after using as() <p>in my gwt project i am sending objects with the gwt channel api to the client and use Autobean to encode and decode those objects. everything works fine, i receive a valid json string on the client and can decode that json string to the AutoBean back again. only the auto...
<p><code>AutoBean#as()</code> returns a <em>“proxy implementation of the T interface which will delegate to the underlying wrapped object, if any.”</em> (source: <a href="http://www.gwtproject.org/javadoc/latest/com/google/web/bindery/autobean/shared/AutoBean.html#as()" rel="nofollow">javadoc</a>), it will never re...
Laravel modal loads only last entry <p>I have been trying to use modal to create and edit entries in Laravel. I am using simple modal instead of ajax. I can add entries, but when I try to edit an entry, it only loads the last entry in the modal.</p> <p>Here is my index (from where I am calling modal)</p> <pre><code>@...
<p>Set data to your edit link </p> <pre><code>@foreach ($clients as $client) &lt;tr&gt; &lt;td&gt;{{ $client-&gt;name }}&lt;/td&gt; &lt;td&gt;&lt;a href="#" class="edit-client-link" data-client-id="{{$client-&gt;id}}" data-client-name="{{$client-&gt;name}}"&gt;Edit&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; @endfor...
Could not connect to MySQL: Access denied for user 'root'@'localhost' (using password: NO) I cannot access my databases. What I am supposed to do <blockquote> <p>Could not connect to MySQL: Access denied for user 'root'@'localhost' (using password: NO)</p> </blockquote> <p>I cannot access my databases using earlie...
<p>It seems that you have forgotten your mysql root user password. I think you should reinstall WAMPP and then set the mysql root user password from command line. To set the mysql root user password you have to first login to mysql from command line using this command: mysql -u root. When it asks for password just ente...
Mapping string to int CPP - Output hangs during execution <p>I am currently doing a practice problem in hacker rank. The link is : <a href="https://www.hackerrank.com/challenges/linkedin-practice-dictionaries-and-maps" rel="nofollow">https://www.hackerrank.com/challenges/linkedin-practice-dictionaries-and-maps</a></p> ...
<p>This statement,</p> <pre><code>scanf("%s %d", &amp;str, &amp;num); </code></pre> <p>&hellip; is not a valid way to input a <code>std::string</code>. It has Undefined Behavior. All bets are off.</p> <p>You can input to a <code>char</code> buffer, and conveniently <code>std::string</code> provides such a buffer. E....
How can choose the five largest values ​in an array and put them in a new array? <pre><code>int[] a = { 1, 2, 5, 2, 4, 6, 8, 9, 1, 19 }; int[] largestValues = new int[5]; for (int i=0; i &lt; 5; i++ ) { System.out.println(largestValues[i]); }` </code></pre>
<p>You can use following code</p> <p>For Eg.</p> <pre><code>public static void main(String args[]) { int i; int large[] = new int[5]; int array[] = { 33, 55, 13, 46, 87, 42, 10, 34, 43, 56 }; int max = 0, index; for (int j = 0; j &lt; 5; j++) { max = array[0]; index = 0; fo...
Rails : How to accessing relation attributes from the view <p>I have the following rails code </p> <p>Employee model: id | emp_name | emp_number</p> <pre><code>class Employee &lt; ActiveRecord::Base has_many :visitors end </code></pre> <p>Visitor Model:id|employee_id|visitor_name|vis_company|vis|email</p> <pre...
<p>I created new project from the scratch and for some reason it started working. My mistake was that I didn't define the relation from the start. I added employee_id after everything else is created I think the rails didn't build the relation at that time. thanks everyone</p>
how to import dat file in R <p>I have a dat. file containing one really long line. I have the specific layout to read the data but I do not know how.</p> <p>What I have done so far(based on searhes in other posts) is try to use readLines, read.fwf, and also I tried to copy that line into one vector which later to spli...
<p>To read dat files you need to use the command <code>read.delim()</code>. See <code>?read.delim</code> for info on how to specify formatting. </p> <p>EDIT:</p> <p>Maybe after you read it as a single line you could do something like this:</p> <pre><code># Creating sample data data &lt;- data.frame(x = c(1, 'a', 5, ...
Shapes (1,) and () are not compatible on cond operator <p>I want to skip some data that have specific labels (like if <code>label</code> >= 7 or other). My code is here:</p> <pre><code>true = tf.constant(True) less_op = tf.less(label, tf.constant(delimiter)) label = tf.cast( tf.slice(record_bytes, [0], [label_byte...
<p>Tensorflow expects it to be of shape None or [] and not (1,). It's weird behavior that should be fixed in my opionion because tf.less returns a tensor of shape (1,) and not shape ().</p> <p>Change this:</p> <pre><code>tf.cond(less_op, lambda: true, lambda: true) </code></pre> <p>to this:</p> <pre><code>tf.cond(...
jQuery - Add row to datatable without reloading/refreshing <p>I'm trying add data to DB and show these data in same page using ajax and jQuery datatable without reloading or refreshing page. My code is saving and retrieving data to/from database. But updated data list is not showing in datatable without typing in searc...
<p>From the <a href="https://datatables.net/reference/api/row.add()" rel="nofollow">documentation</a>,</p> <blockquote> <p>This method will add the data to the table internally, but does not visually update the tables display to account for this new data.</p> </blockquote> <p>In order to have the table's display ...
Convert Picturebox Image to Transparent VB.Net <p>I'm having a problem when it comes to images with white background. How can I remove the white background or make the image transparent? </p> <p>For now I'm using this code</p> <pre><code>Dim _ms3 As New System.IO.MemoryStream() pbSignCapture.Image.Save(_ms3, System.D...
<p>Consider using the <code>Bitmap</code> class to open your image files.</p> <pre><code>Dim myImage as new Bitmap("C:\Image file.bmp") </code></pre> <p>And then you can use the <a href="https://msdn.microsoft.com/en-us/library/4zzst10b(v=vs.110).aspx" rel="nofollow">MakeTransparent()</a> or <a href="https://msdn.mic...
Why is my JavaScript function not being called? <p>This JavaScript function used to work before until I made it more complicated as I try to push more error checking to the front end. </p> <p>Here is the front end code just the important bits for brevity:</p> <pre><code> &lt;body&gt; &lt;form id="form1" ru...
<p>For those of you who want the full code: ASP.NET Front End:</p> <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="JobSeekerRegistration.aspx.cs" Inherits="JobSearchWebsite.WebForm1" %&gt; &lt;!DOCTYPE html&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; ...
ezPlot overlapping error bar and data <p>I am using ezPlot from the ez package in R to plot results of a mixed within and between-ss design. The data point from the two groups I have overlap so that I would like to jitter both the data point and associated error bar. </p> <pre><code>data&lt;-structure(list(Sub = stru...
<p>One way is to use set <code>print_code = TRUE</code>, to produce data to be plotted, as well as the <code>ggplot</code> code:</p> <pre><code>library(ggplot2) stats &lt;- ezPlot( data, dv = .(DepVar), wid = .(Sub), # subject within = .(Con), between=.(Group), split=.(Group), do_bars=TRUE, ...
php creating file from another file <p>Im new to php and I'm just trying stuff out, and I was wondering if i could take text from one file then put it into another.<br> For example have a .txt file that contains : </p> <pre><code>&lt;?php echo "Hello World"; ?&gt; </code></pre> <p>but then have a script run tha...
<p>If I understand you correctly, what are you trying to achive is copying a content of a text file to a php file.</p> <p>Simpliest way to do it:</p> <pre><code>&lt;?php $sourceFile = 'example.txt'; $destinyFile = 'example.php'; if (copy($sourceFile, $destinyFile)) echo "DONE"; </code></pre>
Bitbucket 443 Network is unreachable on different network <p>My git and Bitbucket connects and works just fine when I am in my office connected my laptop to wifi.</p> <p>But when I get home and connect same laptop to my wifi and try to access bitbucket I get 443 error.</p> <pre><code>git pull fatal: unable to access ...
<p>As mentioned in <a href="https://bitbucket.org/site/master/issues/12184/failed-to-connect-to-bitbucketorg-port-443" rel="nofollow">this issue</a>, try and set GIT_CURL_VERBOSE=1 before executing the git clone: you might have more clues.</p> <p>The standard advice is:</p> <blockquote> <p>"Failed to connect" error...
WPF: Stop Animation For Hidden Controls on Windows Load <p>I have a very simple fade in/out animation which works fine using data triggers. I have bind the data trigger to a bool property and inside trigger it set the opacity to 0 on false and vice versa.</p> <p>Now the problem is the objects whose bool value is fals...
<p>Do these changes in your XAML : </p> <ol> <li><p>Shift your <code>DataTriggers</code> from <code>&lt;ControlTemplate.Triggers&gt;</code> to <code>Style.Triggers</code>.</p></li> <li><p>Set <code>Opacity = 0</code> in <code>Style Setter</code> as starting <code>Opacity</code> for every <code>Button</code>.</p></li>...
Bootstrap Text Align Center Vertically <p>I want to make a text vertically center on 100vh height. Here is what I've done</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>....
<p>just add this below CSS:-</p> <pre><code>.about-header{ height: 100vh; background: #000; display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center...
md-content does not consume full height of the parent element <pre><code>&lt;md-content flex class="md-padding page-content"&gt; &lt;div ui-view flex layout="column"&gt; &lt;div class="center" layout="row" flex&gt; &lt;md-content layout="column" flex="30"&gt; &lt;md-list-item ng-repeat="...
<p>Here you go - <a href="http://codepen.io/camden-kid/pen/VKXWwX" rel="nofollow">CodePen</a></p> <p>You need to utilise <code>layout-fill</code>. From the <a href="https://material.angularjs.org/latest/layout/options" rel="nofollow">docs</a></p> <p><a href="http://i.stack.imgur.com/FeKaE.png" rel="nofollow"><img src...
unable to pass map to restful method <p>I am trying to call this api via postman</p> <pre><code>@POST @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void printDetails(final MultivaluedMap&lt;String, String&gt; formParams) { for(String key : formParams.keySet()) { System.out.println(key + " " ...
<p>Set the request header as <code>"application/x-www-form-urlencoded"</code>.</p> <p><a href="http://i.stack.imgur.com/HrnFz.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/HrnFz.jpg" alt="Postman request header"></a></p> <p>Request body - Select raw and provide values as mentioned below:-</p> <pre><code>{ ...
Visual Studio 2015 Enterprise very slow startup <p>I have the same version of VS 2015 at home and work; at work on a win7 machine it starts very fast (even with a solution of more than 100 projects!), taking roughly 10-15 seconds. At home on a win10, it starts very slow (around 2 mins) with a solution of only 20 projec...
<p>Try deleting the <strong>.suo</strong> file in the project directory. Then start it up. I had that problem in MSVS 2010.</p>
Unable to find lmdb while installing caffe with make all <p><a href="http://i.stack.imgur.com/d9iAd.png" rel="nofollow">/usr/bin/ld: cannot find -lmdb collect2: error: ld returned 1 exit status Makefile:568: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed make: *** [.build_release/lib/libcaffe.so.1....
<p>Make sure that the library file your are trying to use while compiling is present in the path that your have given while compiling...</p>
Changing default keybinding in yhat's Rodeo IDE <p>To comment out a block in Rodeo the <a href="http://rodeo.yhat.com/docs/#keyboard-shortcuts" rel="nofollow">docs</a> state to do <code>ctrl + /</code>. But on my machine thats not working, so I want to change a single keysetting. Where I am able to do this in Rodeo?</p...
<p>You can edit key-bindings in preferences <a href="http://rodeo.yhat.com/docs/#preferences" rel="nofollow">http://rodeo.yhat.com/docs/#preferences</a></p> <p>Changing the key bindings should avoid the use of <code>ctrl + /</code>, but if you just want to change a single setting, as far as I know, it's not possible. ...
Search query doesn't return desired results <p>I have kind of advanced search function. All works fine except one <code>AND LIKE ...</code>. There are two options <code>A</code> or <code>A, *AB</code>. I want when I choose <code>A</code> to return results only which are <code>A</code> in database and when I choose <co...
<p>You need to change a bit your query and the way you assign <code>$couGe</code> where you took selected <code>ge</code>. Please try this way</p> <pre><code>$couGe=($ge == "None") ? "" : "'".substr($ge, 0, 2)."'"; $active = ($this-&gt;showCouCancelled) ? "AND (c.active=1 OR c.active=7)" : ""; $active = ($this-&gt;hid...
Calculate the distance of the robot using matlab <p><a href="http://i.stack.imgur.com/fgcle.jpg" rel="nofollow">Sample Picture to find the distance</a></p> <p>We are currently working on the research based on slipping of the wheels in a mobile robot. We need to find the linear velocity of the robot for that purpose an...
<p>You should first calibrate your camera as already suggested in the comments. There are lots of tutorials on the web (one tip: dont use loose paper).Then you can print out a marker like this:<a href="http://i.stack.imgur.com/llDNj.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/llDNj.jpg" alt="enter image desc...
Source not found error in Eclipse while debugging <p>I get below error and while debugging. When I put a breakpoint and debugging throws a '<strong>source not found</strong>' error. </p> <p>I already clicked on "Edit Source Lookup Path" in Eclipse and add my project. but its not working. Please suggest</p> <pre><cod...
<p>For classes in the standard Java Runtime, the easiest, simplest answer is always going to be to install a JDK, and to compile and run your Java Applications using it. Your <code>Installed JREs</code> preference page should ideally only list JDKs.</p>
Python: How to convert google location timestaMps in a year-month-day-hour-minute-seconds format? <p>I am playing around with my google location data (which one can download here <a href="https://takeout.google.com/settings/takeout" rel="nofollow">https://takeout.google.com/settings/takeout</a>). </p> <p>The location ...
<p>Use <a href="https://docs.python.org/2/library/datetime.html#datetime.date.fromtimestamp" rel="nofollow">fromtimestamp</a> method from datetime module. To convert your 'timestaMps' to timestamp you need to convert it to int(). Formating of timestamp is done with <a href="https://docs.python.org/2/library/time.html#...
How to stop this fancybox opening on load? <p>I'm trying to figure out why this jQuery code makes a fancybox image open on page load rather than waiting for the user to click on it. How do I have it open when it's clicked on? Here's a <a href="http://jsfiddle.net/jsykes/j14gf3sv/3/" rel="nofollow">fiddle</a>.</p> <pre...
<p>Remove the .trigger("click");</p> <pre><code>$(document).ready(function() { $("#single_image").fancybox({ onComplete: function () { $("#fancybox-img").wrap($("&lt;a /&gt;", { href: this.href, //or your target link target: "_blank" })); } ...
Why do i get an error no match for 'operator^' <p>I am getting an error </p> <pre><code>10:13: error: no match for 'operator^' (operand types are 'std::basic_ostream&lt;char&gt;' and 'int') 10:13: note: candidates are: In file included from /usr/include/c++/4.9/ios:42:0, from /usr/include/c++/4.9/ostream:...
<p>According to the <a href="http://en.cppreference.com/w/cpp/language/operator_precedence" rel="nofollow">Operator Precedence</a>, <code>operator&lt;&lt;</code> has higher precedence than <code>operator^</code>. So <code>std::cout&lt;&lt;a^b;</code> is equivalent with <code>(std::cout&lt;&lt;a)^b;</code>; <code>(std::...
Rails create join table object should not create but update in special case <p>In a webshop I have a booking that needs to know if a booking already exists in the order. I had the whole thing working, but then the details...</p> <p>...now 'booking on a product' (or in normal English: Adding a product to your shopping-...
<p>The idea is right, but I think you're missing a call to <code>.first</code>:</p> <pre><code>@booking = @order.bookings.where(product_id: params[:product_id]) =&gt; #&lt;ActiveRecord::Relation&gt; </code></pre> <p>should be:</p> <pre><code>@booking = @order.bookings.where(product_id: params[:product_id]).first ...
jqGrid Custom Search Template <p>Using jqGrid 5.1.1</p> <p>I'm attempting to use custom search filer to display in what I "request" in gTmpl, but it doesn't show me anything but default ones.</p> <p>my gTmpl will always be different based on the GRID for certain data to be pulled, so this is one of few examples:</p> ...
<p>What you probably want to implement is displaying the specified filter on the first opening of the searching dialog. Do do this you should first specify <code>postData.filters</code> and seconds to use <code>multipleSearch:true</code> and optionally <code>multipleGroup:true</code> as the searching option:</p> <pre>...
Creating datetime for ebay with php <p>I cannot create a valid datetime with php for ebay finding api. </p> <p>According to their <a href="https://developer.ebay.com/devzone/finding/CallRef/types/simpleTypes.html#dateTime" rel="nofollow">api</a>, the datetime value should look like this</p> <p>2004-08-04T19:09:02.768...
<p>Try This:</p> <pre><code>&lt;?php $time = microtime(true); $tMicro = sprintf("%03d",($time - floor($time)) * 1000); $tUtc = gmdate('Y-m-d\TH:i:s.', $time).$tMicro.'Z'; echo $tUtc; ?&gt; </code></pre>
Excel formula required....probably an array <p>Basically we have a table that includes staff who were ineligible for a bonus between certain dates and they might have had overlapping periods when they were ineligible. For our bonus, you can't be penalised twice for the same date. So....</p> <ul> <li>I have a table tha...
<p>Posting as there are still no replies.. I tried to solve this a few days ago but got stuck on some excel limitations, my basic algorithm was:</p> <p>for each row use REPT function to create bit string length 366 with 0's and 1's representing days off, bitwise OR this with all other rows with same identifier then j...
Separate scrolling columns in a webpage <p>I'm trying to make a website similar to <code>www.the5th.co</code> where they have two independent columns. Both columns are scrollable but independently. How should I approach in developing a design like this? what languages would I need? I am trying to achieve this design in...
<p>First I think you should get basic information about programming languages for developing webpages and after this ask the question again but more accurate. For inspecting websites to check their design, there are several debugging and monitoring tools like <a href="https://addons.mozilla.org/de/firefox/addon/firebug...
What is the practical case of the Immutable.js? <p>I understand the benefits of the immutability in JS. But cannot get any advantages of using a specific library for that.</p> <p>There’s a good “The case for Immutability” paragraph at library’s homepage, but there’s no clear answer to “The case for Immuta...
<blockquote> <p>I mean to achieve immutability in JS app you should just to keep simple patterns like <code>Object.prototype.assign</code>, <code>Array.prototype.concat</code>, i.e. don’t mutate data directly, but returning a new copy not touching the source.</p> </blockquote> <p>If it was only that simple. </p> ...
Replace string at a given position with PowerShell <p>I have a folder where stand 4000 csv files right now in production with a running incident.</p> <p>With PowerShell I would like to replace:</p> <pre><code>In all files =&gt; OK In all lines =&gt; OK </code></pre> <p>All string from position start 9 to position en...
<p>try this (verify if its ok)</p> <pre><code> $pathwithfiles= "C:\temp" $stringtosearh="toto" $stringtoreplace="titi" $delimitercsv=";" $listfil=gci -Path $pathwithfiles -Recurse -File -Filter "*.csv" foreach ($currentfile in $listfil) { $contentfile=get-content $currentfile.Fu...
ReactJS: Returning a React Component in a loop <p>I'm trying to loop through an array and return a React Component on each element. The render functions are being called but nothing is showing up. </p> <pre><code>class ListOfFoundPages extends Component { constructor(props) { super(props); this._renderList =...
<p><code>_renderList</code> function should return an array of components (the result of <code>data.list.map...</code>). Currently, it doesn't return anything. The code needs to look like:</p> <pre><code>_renderList(data) { if (data !== null) { // eslint-disable-next-line return data.list.map( (obj) =&gt; { ...
Why am I forced to use !! in a combination of null checks? <p>For this piece of code, Kotlin forces me to handle a null-check situation while on the other line it doesn't, despite being the same situation:</p> <pre><code>if (r1 == null &amp;&amp; r2 == null) throw IllegalArgumentException("All nulls!") else if (r1...
<p>The Kotlin compiler does not make logical inferences in the way you expect: "I have already checked that r1 == null and r2 == null, so now if I'm only checking for r1 == null, then it must recognize that r2 is not null". It doesn't. You haven't checked r2 in that branch, so it doesn't see that it is not null.</p> <...
MongoDB split data in more Collection <p>I have one collection (CollectionA) . in this collection there are data of more experiment.</p> <p>I want create one collection for each experiment: Collection1, Collection2 ...</p> <p>There is a mode? without losing data?</p> <p>ps. I can interfacing MongoDB with php</p> <h...
<p>MongoDB enables easy to use <strong>Split</strong> method.</p> <p>While running the following command:</p> <pre><code>db.runCommand( { split : "db.collectionName", find : { 'experimentName' : "A" } } ) </code></pre> <p>The split command identifies the chunk in the db.collectionName. Then the command splits it int...
jtable won't update while the program is running <p><strong>okay i already posted this but i delete it because no one is answering for 24 hours already</strong></p> <p>i don't really know what to do anymore. i have so many tables in my system and they all have the same codes but this is the only on that doesn't work. ...
<p>Without you posting the whole code it's hard to debug. However a few things that could be wrong come to mind:</p> <ol> <li><strong>You don't notify the JTable that the data has changed by calling:</strong> <code>.fireTableDataChanged()</code></li> <li><strong>You don't update the frame with:</strong> <code>.repaint...
Pointer conversion in c <p>I have the following lines: </p> <pre><code>char *name = malloc(strsize + 1); </code></pre> <p>and </p> <pre><code>uint8_t *data; data = (uint8_t *)name; </code></pre> <p>It is correct? It doesn't exist a chance that the pointer *name will be interpreted bad when that conversion is done?...
<p>That shouldn't be much of a problem, except that the <em>signedness</em> of the memory would be interpreted differently between access along <code>data</code> and <code>name</code>. In most of the practical platforms, the size of <code>char</code> and <code>uint8_t</code> in bits is the same.</p>
get last 10 items in dynamodb cross partions <p>I've a table containning blogs posted by different persons;primary key is author+time; <strong>how to query last 4 blogs ordered by time?</strong>(get blog6,blog3,blog5,blog4)</p> <p><a href="http://i.stack.imgur.com/quS1u.jpg" rel="nofollow"><img src="http://i.stack.img...
<p>Adding a sparse index (for example, status) is similar to creating another table with only the recent blog posts. Make sure that you are using the Sparse functionality (<a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GuidelinesForGSI.html#GuidelinesForGSI.SparseIndexes" rel="nofollow">https...
Whats the best way to send XML data to Kafka topic? <p>I am trying to send a <code>XML data</code> to <code>Kafka topic</code> using <code>Kafka 0.9.0 version</code> Java API, because from <code>0.9.0 version</code> they are suggesting to use Java API instead Scala API to get better performance.</p> <p><a href="http:/...
<p>The API to read/write XML is up to the programmer/environment. Further, Apache Kafka does not enforce any particular format for event data beyond a simple key/value model. It will work equally well with XML, JSON,Avro or any other data format. It's recommended that any format, be it XML, JSON, provided it should be ...
Angular2 template field issue <p>I am getting spacing issue with the template field in Angular2</p> <p>This is my code. </p> <pre><code>@Component({ selector: 'my-component', template: ' &lt;h1 class="test"&gt; Angular 2 Template &lt;/h1&gt;', styleUrls: ['./assets/s...
<p>That's because you should use the ES6 backtick "`" for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals" rel="nofollow">template literals</a>:</p> <pre><code>Component({ selector: 'my-component', template: ` &lt;h1 class="test"&gt; A...
On route change view doesn't scroll to top in the new page in angular2 <p>I have tried <code>autoscroll="false"</code> on the <code>router-outlet</code> but does't seem to work, is there any default method of angular2 for doing the same without using any third party library? </p>
<p>Yes, you can refer to <strong><a href="https://angular.io/docs/ts/latest/guide/router.html#!#fragment" rel="nofollow">fragments</a></strong> available in <strong>Angular2-router</strong>.</p>
How to determine gzfile size OR reading it raw in R? <p>Following <a href="http://stackoverflow.com/a/9069670/6817726">this</a> answer for reading a whole file, I need to determine the uncompressed file size of a gzfile. It's saved at the last 4 bytes of the gzfile, but I couldn't find how to open the file without r wi...
<p>Provided you are sure this is a complete gzip'd file with a single stream and &lt;2GB uncompressed:</p> <pre><code>gz_size &lt;- function(path) { path &lt;- path.expand(path) f &lt;- file(path, open="rb", raw=TRUE) seek(f, -4L, "end", "read") ret &lt;- readBin(f, "integer", 1) close(f) return(ret) }...
URL dwell time in any programming language? <p>Could you please give me some hints, websites, books or research papers that would explain how to calculate the URL dwell time.</p> <p>in case you don't know what is dwell time : dwell time denotes the time which a user spends viewing a document after clicking a link on a...
<p>One crude way to do this on a page would be to use a small GET request on a timer, going to a server - an "I'm still here". The frequency of this would be a trade off. This would be relatively easy to do with jquery or a similar framework.</p> <p>You would not know if it is actually in an abandoned tab or that it i...
lua corona widget.newScrollView verticalScrollDisabled doesn't work <p>I have created a ScrollView with this code:</p> <pre><code>local function BuildScrollView( ) scrollView = widget.newScrollView( { top = 0, left = 0, width = display.actualContentWidth, height = display.actual...
<p>For this you should specify as a second parameter what axis you want to lock:</p> <pre><code>scrollView:setIsLocked(true, "vertical") </code></pre> <p>The second parameter, <em>axis</em>, as stated from the docs:</p> <blockquote> <p>Directional axis upon which to lock or unlock the scroll view, either "horizont...
Swift - UINavigationBar only sometimes included in screen height? <p>So I'm experiencing a bit of an odd (in my opinion) issue. I have a standard UINavigationController with a root UIViewController. </p> <p>I'm adding a UITableView programatically to the view controller. When I set the frame of the table view, I set i...
<p>Try the following code...tested in Xcode 8 it worked....You mentioned about a gap appears under the navBar.Because, you didn't put the statusBar height in your code.</p> <pre><code> override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. ...
JSON sub for loop produces KeyError, but key exists <p>I'm trying to add the JSON output below into a dictionary, to be saved into a SQL database.</p> <pre><code>{'Parkirisca': [ { 'ID_Parkirisca': 2, 'zasedenost': { 'Cas': '2016-10-08 13:17:00', 'Cas_timestamp': 1...
<p>I fixed up your code:</p> <ol> <li>Added required imports.</li> <li>Fixed the <code>pprint savetodb</code> line which isn't valid Python.</li> <li>Didn't try to iterate over <code>carpark['zasedenost']</code>.</li> </ol> <p>I then added another <code>pprint</code> statement in the <code>for</code> loop to see what...
PHP calling another PHP page for MySQL Query (returning JSON data) <p>I would like to find out how a PHP page calls another PHP page, which will return JSON data. </p> <p>I am working with PHP (UsersView.php) files to display my contents of a website. However, I have separated the MySQL Queries in another PHP (Get_Use...
<p>You have a couple of different ways to accomplish this:</p> <ul> <li>You should be able to first set the actual <code>id</code> and then include the <code>Get_Users.php</code> file like this. Notice that you should <strong>not</strong> echo out the output from <code>Get_Users.php</code>, instead only return the enc...
SQL Server : string to rows with delimiter? <p>In SQL Server 2016 there is a function called <code>STRING_SPLIT</code> (Transact-SQL).</p> <p>Answer to my question would work fine with this function.</p> <p>Unfortunately we only have SQL Server 2012. </p> <pre><code>SELECT email, [Special ftg], [Special...
<p>You can convert <code>[Special ftg]</code> into XML ant then use OUTER APPLY:</p> <pre><code>;WITH cte AS ( SELECT email, CAST('&lt;p&gt;'+REPLACE([Special ftg],';','&lt;/p&gt;&lt;p&gt;')+'&lt;/p&gt;'as xml) as [Special ftg], [Special OrgCode], [Special SalaryCode] FROM Employee ) SELECT ...
Safe way to know if user is logged in client side with Django <p>My website project shows user specific data in almost every page (e.g. show username in topbar if logged which is existent in all pages), show liked items, etc...</p> <p>I use AJAX to get html fragments depending if the user is authenticated or not (e.g....
<p>In your template, use <code>is_authenticated</code> to conditionally make the ajax requests. </p> <pre><code>{% if request.user.is_authenticated %} &lt;!-- make the ajax requests --&gt; {% endif %} </code></pre>
Getting erorr on login with angular 2 google and firebase <p>I am using firebase 3 and ng 2. My issue I am getting erorr when click on connect with google account. My error is:</p> <pre><code>Error: redirect_uri_mismatch 400. That’s an error. Error: redirect_uri_mismatch Application: Events Manager You can e...
<p>the issue was need to add to firebase auth link the correct host.</p> <p>firebase-> OAuth redirect domains</p>