input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
special case (!) of blank page in pdf issue in report builder /SSRS <p>I am aware that the blank page issue in pdf-exports from Report Builder / SSRS has been addressed numerous times here and elsewhere. However, I am faced with a particular version of the problem on which I have not been able to find more information.... | <p>You can try adding a big tablix with only one cell and add a row group on address (if this is the case) then try adding a rectangle in this cell and in this rectangle try adding the tablix you use. Set the tablix dimensions as long as your report page, if you have margins try making these margins 0 as PDF has a shri... |
Spring Integration DSL, PayloadTypeRouter, unsupported return type for router [class java.lang.Class] <p>I'd like to use <code>PayloadTypeRouter</code> as part of Spring Integration DSL as follows:</p>
<pre><code>jmsFlowsUtils.jmsXmlInputFlow(queue, loggingChannel)
.<Object, Class<?>>route(Object::getC... | <pre><code>.<Object, String>route(p -> p.getClass().toString(), incomingMsg -> incomingMsg
</code></pre>
<p>or use Spring Integration Java DSL 1.2 already with Spring Integration <code>4.3.1</code>. The <code>Class<?></code> as a routing key has been fixed in the <a href="https://jira.spring.io/brow... |
How to continue sqlite3_finalize(statement) in for loop. By using below code only one record stored at the end of loop <pre><code>-(void)insertIntoDatabase
{
appDelegate =(AppDelegate *) [[UIApplication sharedApplication]delegate];
for (int i=0; i < [arrFinalData count]; i++)
{
countryList =(CountryList *) [... | <p>You must only call <code>sqlite3_prepare_v2</code> once, before the loop. Then in the loop you bind all the values, then call <code>sqlite3_step</code> to execute the query, then call <code>sqlite3_reset</code>. After the loop is when you call <code>sqlite3_finalize</code>.</p>
<pre><code>- (void)insertIntoDatabase... |
Ionic: directive doesn't work in ionicModal <p>As the title, I define a directive and use it in the template of ionicModal, but it doesn't workï¼the console log '111' doesn't print.thks for help!
here is the code:</p>
<p>directive.js</p>
<pre><code>.directive 'size_item', () ->
restrict: 'AE'
link: (scope, el... | <p>Finally, I found that the error come from the name of directive, in my code, i named it as size_item, it's not legal, no underline is allowed! </p>
|
Image is not displayed in html inside jsp <p>I am trying to display a image in html in JSP script, just using <strong>img</strong> tag. </p>
<p><strong>index.jsp</strong> code:</p>
<pre><code><%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C/... | <p>@user3138997 gave me hints:</p>
<p>I just need to write as:</p>
<pre><code><img src="/projectName/images/x.png" alt="img" height="30" width="25">
</code></pre>
<p>And this shows the image.</p>
|
How to convert Cartesian coordinates to polar, and vice versa on Java / Drjava? <p>Can someone explain on how to convert Cartesian Coordinates to Polar, Polar to Cartesian using DrJava? I've been looking on Youtube, etc. But it only shows the writing method and not using DrJava / programming.</p>
<p>If anyone can help... | <p>It's quite simple:</p>
<pre><code>class Main {
public static void main(String[] args) {
double x = 1;
double y = 2;
// Cartesian to polar.
double radius = Math.sqrt( x * x + y * y );
double angleInRadians = Math.acos( x / radius );
System.out.println(String.form... |
Grab HTML tag value and assign to PHP variable <p>I have JavaScript to change the value of an input tag whenever I open my popup in which it all executes successfully. When I inspect the tag, the value is exactly what it should be every time. Now within that popup I have, I just want to echo out the value using my PHP ... | <p>All HTML code and Javscript execution is done (on client side) after PHP execution is complete on Server Side and response is sent to the client.</p>
<p>So you can not bind or assign HTML tag value to PHP directly.</p>
<p>But you can set it by AJAX and store it in session for next script execution on PHP.</p>
<p>... |
cant remove the sentence from arraylist <p>I have a problem in removing String from ArrayList. I can't remove a sentence with spaces between the words.</p>
<p>This is the piece of code I tested</p>
<pre><code>package com.collect;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;
publi... | <p>To take an string input that will contain whitespace characters, use <strong>nextLine()</strong> instead of <strong>next().</strong> next() does not consider remaining string after whitespace character.</p>
<pre><code>String numtoDel = input.nextLine();
</code></pre>
|
SQL query to update a column value using a select query in SQL Server <p>I have tables as below:</p>
<p>Language</p>
<pre><code>language_id | language_name
--------------------
1 English
2 Hindi
</code></pre>
<p>Book</p>
<pre><code> book_id | language_id | book_name
-------------... | <p>Think you need to use an alias for update, to find the right language in the setting subquery.</p>
<pre><code>update s
set s.book_id = (select book_id from book
where book_name = 'Head First C'
and language_id = s.language_id)
from student s
where s.book_id in (select book_id from ... |
Cannot update itself in SQL Server 2008 R2 <p>Please see my sample as below:</p>
<pre><code>create table tbl1(cl1 int, cl2 varchar(10))
create table tbl2(cl1 int, cl2 varchar(10))
insert tbl1
select 1, 'a' union all
select 1, 'b' union all
select 1, 'c' union all
select 1, 'd' union all
select 1, 'e'
insert tbl2
... | <p>Try this script.</p>
<pre><code>create table #tbl1(cl1 int, cl2 varchar(10))
create table #tbl2(cl1 int, cl2 varchar(10))
insert #tbl1
select 1, 'a' union all
select 1, 'b' union all
select 1, 'c' union all
select 1, 'd' union all
select 1, 'e'
insert #tbl2
select 1, '' union all
select 1, '' union all
select ... |
Flexbox "align-items: center" not working on Chrome beta <p>In the example below, all stable flexbox-capable browsers render the page correctly.</p>
<p>See jsfiddle <a href="https://jsfiddle.net/v966v6pp/" rel="nofollow">here</a>.</p>
<p>Because of <code>align-items: center;</code> the three colored blocks are evenly... | <p>The problem stems from these statements:</p>
<blockquote>
<p>In the example below, all stable flexbox-capable browsers render the page correctly.</p>
<p>Because of <code>align-items: center;</code> the three colored blocks are evenly distributed in the section element:</p>
</blockquote>
<p>Followed by this ... |
Make td element same width as input element with only using css/scss? <p>I have tried to ask this question before without any luck so I'll try to ask it again. I really hope someone can help. </p>
<p>What I want is: </p>
<ul>
<li>the table to stretch to 100%</li>
<li>the first input element to "fill" the table since ... | <p>Is this what you wanted to achieve? I set the first td and input to have <code>width: 100%;</code> so they will fill the rest of the table after all the rest of the divs are the width of the elements inside it (set by your class). With <code>box-sizing: border-box</code> you can set it so that borders etc have no ef... |
Unable to get 'not equal' operand recognised by char <p>New to programming and just started Java. I am unable to get the != operand to work with char.This is with regards to the while loop.even though the correct input is being placed. The loop keeps saying, it is an invalid input, despite the correct input being place... | <p>There is 3 possibility for gender <code>M</code>, <code>F</code> or other. Lets look at them</p>
<pre><code>| Gender | gender != 'M' | gender != 'F'| (gender != 'M') || (gender != 'F') |
| 'M' | False | True | True |
| 'F' | True | False | True ... |
How can I turn/tranpose these columns into rows in SQL? <p>This MUST be a simple one, I've very reluctantly asked this question - but I can't work it out. I have a query which (in a roundabout way) returns 2 counts:</p>
<pre><code>Col1 | COL2
123 456
</code></pre>
<p>But I need to return:</p>
<pre><code>123 | COL... | <p>Use a <code>UNION</code>:</p>
<pre><code>SELECT COL1 AS VALUE, 'COL1' AS COL
FROM yourTable
UNION ALL
SELECT COL2 AS VALUE, 'COL2' AS COL
FROM yourTable
</code></pre>
<p>If you want to select from the entire <code>UNION</code> query, you can wrap it and select out:</p>
<pre><code>SELECT t.VALUE,
t.COL
FROM... |
how to add hash mapping content to text file <p>Hi I am having Hashmap content as </p>
<pre><code>mapping :{[unknown, unknown, nicholas@123.com, nicholas@123.com, nicholas@123.com, WHEEL@123.com, WHEEL@123.com]=[STANDARD CHARTERED B, STANDARD CHARTERED B, DBS BANK LIMITED HON, DBS BANK LIMITED HON, DBS BANK LIMITED HO... | <p>Try This :</p>
<p>create another <code>HashMap</code> to add unique values </p>
<pre><code> HashMap<String, String> hashmap = new HashMap<String, String>();
</code></pre>
<p>add items in new hashmap</p>
<pre><code>hashmap.put(keys[i], values[i]);
</code></pre>
<p>``</p>
<pre><code> Iterator<E... |
How do I search for a saved fingerprint using sensor R305? <p><strong>What am I doing?</strong>
I have GUI interface built using PyQt, which grants access to the users by validating their Fingerprint.</p>
<p>I am using Fingerprint sensor R305, for my module.</p>
<p><strong>My issue?</strong>
I have my code available ... | <p>After going through your code, I get that in your GUI code you are using new() to generate random id values for saving fingerprint template data. But in your search code you are checking the value of r[2] in array [0,1] which is actually your currently stored id list. This is why your search program cant find your f... |
Karma keeps asking for more imports that have nothing to do with the tested component <p>I'm testing my <code>DashboardComponent</code>, this is my <code>beforeEach</code> block:</p>
<pre><code> beforeEach(() => {
TestBed.configureTestingModule({
imports: [
FormsModule,
routing
],
... | <p>Add <code>AppModule</code> and <code>RouterTestingModule</code> to <code>imports</code> of the object you pass to <code>TestBed.configureTestingModule()</code>.</p>
<p>Not sure if you still need to add <code>{provide: APP_BASE_HREF, useValue: '/'}</code> when <code>RouterTestingModule</code> is imported.</p>
<p>Se... |
How to leave vertical space for the youtube link? <p><a href="http://i.stack.imgur.com/ZfYgH.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/ZfYgH.jpg" alt="Background Image and Text"></a></p>
<p>The orange scroll block goes up and down but I wanted the default position of that orange icon to be more toward the... | <p>I think it could just change the padding-top in this lines:</p>
<pre><code>.content{
position: relative;
padding: 15% 0 0;
}
</code></pre>
<p>You can try something like <code>padding: 30% 0 0;</code></p>
|
How to remove newline characters from csv file <p>I have the below part of code that reads values from the csv file "prom output.csv" and writes them sorted in a new one "sorted output.csv".</p>
<pre><code>import collections
import csv
with open("prom output.csv","r") as f:
cr = csv.reader(f,delimiter=",")
d=... | <p>apparently changing the line: <code>cr = csv.writer(f,lineterminator='\n')</code>
into: <code>cr = csv.writer(f,sys.stdout, lineterminator='\n')</code> and adding <code>import sys</code> to the imports solves the problem.</p>
|
Use module as class instance in Python <h2>TL; DR</h2>
<p>Basically the question is about hiding from the user the fact that my modules have class implementations so that the user can use the module as if it has direct function definitions like <code>my_module.func()</code></p>
<h2>Details</h2>
<p>Suppose I have a m... | <p>In module <code>my_module</code> do the following:</p>
<pre><code>class MyThing(object):
...
_inst = MyThing()
say = _inst.say
move = _inst.move
</code></pre>
<p>This is <em>exactly</em> the pattern used by the <a href="https://github.com/python/cpython/blob/master/Lib/random.py#L736" rel="nofollow"><code>ran... |
How to make form templates in visual basic 6? <p>I would like to make a template for all the forms I create in my visual basic 6 project, for example I want to put a header on all the forms that contains user name etc, I know in c# all I have to do is make the form with appropriate controls and make all other forms inh... | <p>According to <a href="https://msdn.microsoft.com/en-us/library/aa733595(v=vs.60).aspx" rel="nofollow">MSDN:</a></p>
<blockquote>
<p>To create your own template, save the object that you want to use as a
template, then copy it to the appropriate subdirectory of the Visual
Basic Template directory. For example,... |
How to send a string value to a function (ng-click) <p>I've got a very simple questions; </p>
<p>Here's my HTML; </p>
<pre><code><button ng-click="projectTypeController.deleteProjectType(pt.Code)">X</button>
</code></pre>
<p>And my function in my controller: </p>
<pre><code>self.deleteProjectType = fun... | <p>You need to format the parameter as a valid json.
To do that you can use JSON.stringify().</p>
<p>To implementet this in the method</p>
<pre><code>self.deleteProjectType = function (projectTypeCode) {
$http.post('http://localhost:49165/Service1.svc/projecttypes/delete/', JSON.stringify(projectTypeCode))
.th... |
how to make angularjs and spring security login page? <p>This is my login controller:</p>
<pre><code>app.controller('loginCtrl', function($scope,$http,$state,$location,$q) {
var self = this;
self.user={uname:'',password:''};
self.users=[];
this.postForm=function(user)
{
var defe... | <p>You can used the login form as Rest Url like as:</p>
<pre><code>@Override
protected void configure(HttpSecurity http) throws Exception {
http
.formLogin()
.loginProcessingUrl("/app/authentication/oauth")
.usernameParameter("j_username")
.passwo... |
How to define a method only for one client and restrict access to other clients? <p>I was asked this in an interview. Say I have a dll (or a class) with multiple methods that is used by 10 clients. Now one of the clients needs to change a method and add a new method to the class. How can this be achieved without the ot... | <p>It seems that you shoud create a new class which is derived from the original class and has an additional fuctionality. For example:</p>
<pre><code>public class OriginalClass
{
public int SomeOriginalMethod() { }
}
public class YourNewClass : OriginalClass
{
public int SomeNewMethod() { }
}
</code></pre>
... |
Split a string with hours inside brackets <p>This is a data I am getting from the server. I want to obtain the hours and store them in a string</p>
<pre><code>(09:00-12:00) (17:00-20:30)
(12:00-16:00) (20:00-22:00)
(11:00-15:00) (19:00-21:30)
(07:00-11:00) (16:00-20:00)
(10:00-14:00) (18:30-21:00)
(05:00-09:00) (14:00... | <p>use this split("-")
ex :</p>
<pre><code> String string = "09:00-12:00"
String Array[] = string.toString().split("-");
</code></pre>
|
google-services.json for Google-play-services:ads - should I generate? <p>I use Google play service (ads) in my old app and after updating library I've got an issue</p>
<pre><code>FAILURE: Build failed with an exception.
</code></pre>
<ul>
<li>What went wrong:
Execution failed for task ':app:processLiteReleaseGoogleS... | <p>I think the reason you're not seeing Ads in the link you've provided is because <a href="https://firebase.google.com/docs/admob/admob-firebase" rel="nofollow">AdMob is now being handled by Firebase</a>. They've made the steps simpler as stated in the docs:</p>
<blockquote>
<p>The best way to use AdMob is with Fir... |
C# Securely delete variable from memory <p>I'm making a security related program and I want to be sure that I'm doing this the right way. When someone logs in with a password, a secret key is decrypted and stored in a variable. When they log out, I want the data in memory for that secret key to be completely erased, no... | <p>I think you might be interested in <a href="https://msdn.microsoft.com/en-us/library/system.security.securestring%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396">SecureString</a> </p>
<blockquote>
<p>An instance of the System.String class is both immutable and, when no longer needed, cannot be programmaticall... |
How to set an integer value to a lable? <p>I have a method which returns and integer value. But i can't display the value using a label. Here I have added the code.I get and <strong>error message</strong> as follows. </p>
<blockquote>
<p>Error 4 Argument '1': cannot convert from 'string' to 'int' </p>
</b... | <p>From what I can understand from your question, you are trying to convert a string to integer. But for doing that, <strong>your string must be in proper format(such as "123").</strong> If it's not in proper format then Int32.Parse method gives error <em>"cannot convert from 'string' to 'int'"</em>.</p>
<p>Try follow... |
Saving new image in SD Card instead of overwriting <p>I have created an android application in which I draw on screen and by clicking on button It gets saved in picture folder .</p>
<p>code:</p>
<p><strong>MainActivity</strong> :</p>
<pre><code> package com.example.writeonscreen;
import android.support.v7.app.Actio... | <p>Just change this line of code : </p>
<pre><code>final File file = new File(path, fileJPG + ".jpg");
</code></pre>
<p>to this:</p>
<pre><code>final File file = new File(path, fileJPG + "_" + System.currentTimeMillis() + ".jpg");
</code></pre>
|
span lang="en-gb" gets generated after copying text <p>I copy a text from a source in a platform. It is a private platform that has a box where you can type text. There is a button where you can see the HTML source code afterwards. I copied numerous texts with no problem. When I am trying to copy-paste the above, I not... | <p>Based on the fact you said it had a button where you can view source, this sounds like a WYSIWIG (What you see is what you get) editor like CKeditor, TinyMCE, Froala, etc. They take standard HTML textarea elements and using Javascript and CSS convert them into more robust editors. They allow you to do simple text f... |
Pulldown a pullup by default and then pullup again on an ESP2866 <p>I have an (Adafruit Feather Huzzah) ESP2866 WiFi module which has an (EN) pin to disable the 3v3 output on the chip. This pin is pulled up by default and normally you would just connect it to GND in order to switch off the 3v3 regulator (and disable th... | <p>Reading the Adafruit forums I have since discovered that pulling the EN pin also switches off the ESP2866 internal circuitry so it will never come back out of deep sleep. On this basis there is no solution to this specific question as there will never be a high pin (without some form of external circuitry).</p>
<p... |
Strange Java behaviour with static and final qualifiers <p>In our team we found some strange behaviour where we used both <code>static</code> and <code>final</code> qualifiers. This is our test class:</p>
<pre><code>public class Test {
public static final Test me = new Test();
public static final Integer I = ... | <p>These are the steps taken when you run your program:</p>
<ol>
<li>Before <code>main</code> can be run, the <code>Test</code> class must be initialized by running static initializers in order of appearance.</li>
<li>To initialize the <code>me</code> field, start executing <code>new Test()</code>.</li>
<li>Print the ... |
Is it possible to resize image, re-encode video etc. in ArangoDB <p>In CouchDB, I faced with a problem while getting many photos which I would use them on the client-side after resizing. Since downloading many megabytes and then resize them on the client-side isn't seem to be efficient, I need to find a way to download... | <p>ArangoDB is a multi model Database, not a transcoder. </p>
<p>So while manipulating json objects is one of its core competencies, manipulating image and vidio data is definitely not.</p>
<p>For such a job you would choose <a href="http://www.graphicsmagick.org/" rel="nofollow">graphicsmagic</a> for images, and <a ... |
Symfony Prevent multiple submit <p>how can I prevent multiple form submit? Every time some one sending me form like 2-Xx in a row. It looks like they're spamming "enter" button on keyboard.</p>
<p>Tahanks</p>
| <p>You should redirect the user after the form has been submitted to prevent the user's browser from re-sending the <code>POST</code> request if <code>Enter</code> is pressed or the page is being refreshed.</p>
<p>Just send a <code>HTTP 302</code> (temporary) redirect if the form is valid like this in your controller:... |
How do I set up TF weight of terms in corpus using the âtmâ package in R <p>I wonder how can I get the term frequency weight in tm packge which is (tf=term/total terms in the document)`</p>
<pre><code>MyMatrix <- DocumentTermMatrix(a, control = list(weight= weightTf))
</code></pre>
<p>After I use this weight... | <p>Something like MyMatrix / rowSums(MyMatrix) should give you the desired result. </p>
<p>But if a document has no terms (DTM has all zeros for the document) the above will result in a row of NaNs as follows (as in your case)</p>
<pre><code>Doc(1) 0.1111111 0 0 0.5555556 0.1111111 0.2222222 0.0000000
Doc(2) 0.00... |
How to set dynamic value in css? <p>I want to pass dynamic css value.I want to change css value on index basis.</p>
<pre><code><hr style="width: 150px;float: left;position: absolute;z-index: 99999;top: 28%;margin-left:110px; left: (index == 0) ? '110px' : '145px'%;">
</code></pre>
<p>but the here "left" value i... | <p>To make angular evaluate the expression once, use the double curly braces as usual:</p>
<pre><code><hr style="width: 150px;float: left;position: absolute;z-index: 99999;top: 28%;margin-left:110px; left: {{(index == 0) ? '110px' : '145px'}};">
</code></pre>
<p>To do it continuously, try this:</p>
<pre><code>... |
Authentication cookie not being read when using [Authorize] attribute <p>I need help configuring my asp.net application using cookie authentication. This is what my configuration looks like:</p>
<pre><code>public void ConfigureAuth(IAppBuilder app)
{
app.CreatePerOwinContext(ApplicationDbContext.Create);
app.C... | <p>Please check your global.asax.cs()-there we have to register GlobalFilters</p>
<pre><code>protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
... |
Powershell Save off attachments in Subfolders in Outlook <p>A little background first. </p>
<p>In my Inbox I have a Subfolder called One
Inside this is an email from someone with an attachment called One.pdf
In my Inbox I have a Subfolder called Two
Inside this is an email from someone with an attachment called Two.pd... | <p>Not sure why I was voted down, be intrested to know?</p>
<p>Anyway. I can to this solution for my issue. </p>
<p>Each "section" will drill down a sub folder level, build the folder structure then save off the attahments based on type. Its by no means pretty but it does the job I need. I have posted it here for ref... |
Why is jasper generated report not showing cyrillic (bulgarian) in Java? <p>I'm using <code>JDK 1.6.0_35</code> in a Java Project and I'm having a problem with java.util.ResourceBundle when recovering a properties file (encoded in <code>ISO8859-1</code>).</p>
<p>We've been asked to show an invoice with english labels ... | <p>I finally achieved it. I needed to change these two lines in the xml:</p>
<pre><code><pdfEncoding><![CDATA[Identity-H]]></pdfEncoding>
<pdfEmbedded><![CDATA[true]]></pdfEmbedded>
</code></pre>
<p>I changed in the Java code the BaseFont constant BaseFont.<strike>CP1252</strike> i... |
Permission denied when running stat command from android <p>Hey guys I have the following code to inspect file stats in Android </p>
<pre><code> Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("stat -c \"%x\" "+file.getAbsolutePath());
proc.waitFor();
int exitvalue=proc.exitValue... | <p>we can use Os.stat - since api 21, it returns StructStat which contains field st_atime with Time of last access (in seconds).</p>
<pre><code>example: if (Build.VERSION.SDK_INT >= 21) { try { StructStat stat = Os.stat("/path/to/my/file"); if (stat.st_atime != 0) { // stat.st_atime contains last access time, secon... |
Aggregations in Elasticsearch cutting string instead of taking everything <p>Having the following simple mapping:</p>
<pre><code>curl -XPUT localhost:9200/transaciones/ -d '{
"mappings": {
"ventas": {
"properties": {
"tipo": { "type": "string" },
"cantidad": { "t... | <p>It's because your <code>tipo</code> field is an analyzed string. The right way to do this is to create a <code>not_analyzed</code> field in order to achieve what you want:</p>
<pre><code>curl -XPUT localhost:9200/transaciones/_mapping/ventas -d '{
"properties": {
"tipo": {
"type": "string",
... |
multiple ids aria-labelledby Internet Exporer 11 issue <p>We are checking the accessibility of the following code sample in various browsers like IE 11, Mozilla Fire Fox etc using JAWS</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre... | <p>With radio buttons and checkboxes, you're over complicating this by using <code>aria-labelledby</code>. </p>
<p>The best pattern for screen reader support is to use a <code><fieldset></code> around the inputs, with a <code><legend></code>. </p>
<p>In your case this would look like:</p>
<pre><code><... |
How to make game like this by AS3? <p><a href="http://i.stack.imgur.com/MBHnc.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/MBHnc.jpg" alt="enter image description here"></a></p>
<blockquote>
<p>how to make game sort letter or guess pic Contains letters and spaces
can I use switch case or there is another... | <blockquote>
<p>can I use switch case</p>
</blockquote>
<p>Yes of course. A switch block is just one way to do a conditional statement. If you are actually to the point in your programming skills to begin making a game like this, then you probably shouldn't have to ask such a simple question. This is not intended t... |
regular expression for sentence <p>Please help me for regular expression of string like this <code>sp13-bse-018</code>.</p>
<p>I've got the following inputs:</p>
<ul>
<li>starts with <code>fa</code> or <code>sp</code></li>
<li>Followed by 2 digits and <code>-</code></li>
<li>Then <code>bcs</code>, <code>btn</code> or... | <p>It looks like the culprit is the obligatory non-zero digit <code>[1-9]</code>, and once you remove it, your regex will work.</p>
<p>You may shorten your pattern by removing unnecessary groups and using a case insensitive flag: </p>
<pre><code>/^(sp|fa)[0-9]{2}-?(bse|bcs|btn)-?[0-9]{3}$/i
</code></pre>
<p>See the... |
Hashtable getting null for existing key <p>I have a very strange error in this code from Vaadin's <a href="https://vaadin.com/api/7.6.8/com/vaadin/data/util/ContainerHierarchicalWrapper.html" rel="nofollow">ContainerHierarchicalWrapper</a>:</p>
<pre><code>for (Object object : children.keySet()) {
LinkedList<Obj... | <p>I put together an SSCCE and investigated the issue further. Turns out, this actually doesn't work at all:</p>
<pre><code> } else {
return method.invoke(this, args); //for equals, hashCode etc.
}
</code></pre>
<p>Instead I extended the <code>DynamicProxy</code> as shown in <a href="http://javahowto.b... |
How i can transfer data over voice using ultrasound in android? <p>I want to transfer some string data from one android device to another using ultrasound waves.</p>
<p>I tried this project but didn't work.</p>
<p><a href="https://github.com/skwarq/android-ultrasound" rel="nofollow">android-ultrasound</a></p>
<p>If ... | <p>This is quite easy to do, but don't expect a high bit-rate. If it is a string then make sure it's not a long one (the longer the higher is the error probability ). Lets assume we're working with the vital part of the ASCII code, namely up to character number 127, then all you need is 7 bits per character. Transform ... |
LIBGDX - adding Kidoz SDK crashes Android app <p>Whenever I am trying to add Kidoz SDK gradle dependency, the Android app will crash with these errors </p>
<pre><code>Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx' for target: Linux, 32-bit
Caused by: java.lang.UnsatisfiedLin... | <p>This answer belongs to Fringale from LibGDX forums. He/She doesn't have a Stackoverflow account.</p>
<p>Fringale:</p>
<blockquote>
<p>Iâm not sure why the error only appears after adding the Kidoz SDK,
but from the log it looks like the libgdx.so library for the desired
architecture (ARM64 Iâd say, since... |
MVC5 Bootstrap Datetimepicker CSS not formatting correctly <p>I'm currently working on adding a datetimepicker to my MVC5 project. I've decided to use Bootstrap.v3.datetimepicker by Eonasdan. Now, I have it working to an extent, but, the formatting is not correct. The current day is not selected, the month / year aren'... | <p>You might have missed <code>bootstrap-datetimepicker.css</code>.</p>
<p>Refer to the below link:
<a href="https://github.com/Eonasdan/bootstrap-datetimepicker/tree/master/build/css" rel="nofollow">Follow the GitHub Link- By Eonasdan</a></p>
|
Javafx TableView scrolling bug when editing text cell <p>When I'm editing a Textfield cell in a Javafx TableView I have noticed that if I scroll using mousewheel then it changes focus to another cell in the same column.</p>
<p>This seems like a bug to me.</p>
<p>In my specific situation I have setup a table where I o... | <p>In my case the following code has resolved the problem:</p>
<pre><code> table.addEventFilter(ScrollEvent.ANY, scrollEvent -> {
table.refresh();
// close text box
table.edit(-1, null);
});
</code></pre>
|
XCUITest Multiple matches found error <p>I am writing tests for my app and need to find the button "View 2 more offers" there are multiple of these buttons on my page but I would just like to click on one. When I try this, an error comes saying "Multiple matches found"
So the question is, what ways can I go around this... | <p>You should use a more elaborated way to query your button, since there is more than one button who's matching it.</p>
<pre><code> // We fetch all buttons matching "View 2 more offers" (accordianButtonsQuery is a XCUIElementQuery)
let accordianButtonsQuery = self.app.buttons.matchingIdentifier("View 2 more of... |
Django: accessing variable value from TemplateView <p>Say I have the following url that maps to a <code>TemplateView</code>:</p>
<pre><code>url(r'^path/(?P<var1>\d+)/(?P<var2>\d+)/$', TemplateView.as_view('a_view.html'))
</code></pre>
<p>I thought in the template view <code>a_view.html</code> I could acce... | <p>From template you can access the instance of <a href="https://docs.djangoproject.com/en/1.10/ref/urlresolvers/#django.urls.ResolverMatch" rel="nofollow">ResolverMatch</a> representing the resolved URL</p>
<pre><code><p>var1 value = {{ request.resolver_match.kwargs.var1 }}</p>
<p>var2 value = {{ re... |
Identifying which UITextField is being passed into a function <p>I'm trying to identify which UITextField is being passed into the delegate function <code>textFieldDidEndEditing(_:UITextField)</code>. I'm doing a comparison operation, but I'm not sure whether to use <code>==</code>, <code>isEqual()</code>, or something... | <p>According to <a href="http://stackoverflow.com/a/3741299/3131790">this response</a>, <code>==</code> checks if two pointers point to the same place, and are therefore the same object. <code>isEqual()</code> compares the values of the two objects. </p>
<p>You're looking to see if the UITextField passed into the func... |
Optional function argument with default value in Common Lisp <p>Here's a function I was writing that will generate a number list based on a start value, end value and a next function.</p>
<pre><code>(defun gen-nlist (start end &optional (next #'(lambda (x) (+ x 1))))
(labels ((gen (val lst)
(if (> v... | <p>The simple recursive version has a main problem: <strong>stack overflow for long lists</strong>. It's useful as a learning exercise, but not for production code.</p>
<p>The typical efficient loop iteration would look like this:</p>
<pre><code>(defun gen-nlist (start end &optional (next #'1+) (endp #'>))
(... |
Only one usage of each socket address is normally permitted Python <p>I wrote a basic program in to create a socket with a server and a client. But the problem is that when I run the code, it gives me an error saying that only one usage of each socket address is normally permitted. So I think the problem is due to the ... | <p>I think there's a fundamental misunderstanding of how sockets work here.</p>
<p>The <a href="https://docs.python.org/2/library/socket.html#socket.socket.bind" rel="nofollow"><code>socket.bind()</code></a> call is used to bind to a particular port on a particular interface, the pair specified using a network address... |
Facebook login in laravel 5.2 can't hold the session after redirect <p>I am using Facebook PHP SDK to log my user.</p>
<p>I created a guard called login for this</p>
<p><strong>Here is my config file of auth.php</strong></p>
<pre><code>'guards' => [
'web' => [
'driver' => 'session',
'pro... | <p>After digging very deep in laravel i finally found what i was doing wrong. And i am posting may be it help some in future.</p>
<p>Important thing :- Laravel save session very last in its request life-cycle. It saves session it sends header response. So if we echo something in controller class then it will send head... |
Python - File to Dictionary with specific substrings for key value pairs <p>I have a text file that looks like :</p>
<pre><code>AAAAA123123423452452BBBASDASAS323423423432
BBBBB453453453466123AAAAADDFFG6565656565665
</code></pre>
<p>...</p>
<p>I want to create a dictionary out of this, with keys the slices of each li... | <p>You should use:</p>
<pre><code>myhash = {}
with open('file.txt') as fi:
for line in fi.readlines():
key = line[5:11]
value = line[20:26]
myhash[key] = value
print(myhash)
</code></pre>
<p>You can get <a href="http://stackoverflow.com/questions/509211/explain-pythons-slice-notation">mo... |
How to set datepicker minDate? <p>I have a directive date-picker.js and view as selectDate.html. I want to set minDate for the date picker when the value of another datepicker changes. How to achieve that?</p>
<pre><code>.directive('selectDate', ['moment', function(moment) {
return {
restrict: 'E',
... | <p>Well you can user ui-bootstrap directive which is lot easier,below is the code </p>
<pre><code> $scope.dateOptions = {
formatYear: 'yyyy',
startingDay: 1
};
$scope.opened = true;
$scope.minDate= new Date();
var maxDate = new Date();
maxDate.setFullYear (maxDate.getFullYear() + 2);... |
AngularJS $http.post/service issue <p>I have a weird problem.. when I am loading my details page, the error part gets executed first in the controller.</p>
<p>Though the service <code>myService</code> gets executed and it does return value, in the controller error is executed and I am not getting my message details.<... | <p>Try this , return a deferred promise</p>
<pre><code>.service('myService', function($http, $q, $httpParamSerializerJQLike) {
return {
getdata: function(url, data) {
var deferred = $q.defer();
var postData = data;
$http({
method : 'POST',
url : url,
... |
routes not calling the function in express <p>When i go with routes in my browser,it shows the results in my console but in network the server call is running for long time ,can someone suggest help/.............</p>
<p>My controller,</p>
<pre><code> var express = require('express');
var router = express.Router();
... | <p>You need to send the HTTP response, using <code>res.send</code> in express</p>
<p>For example:</p>
<pre><code>exports.getlist = function(req, res) {
connection.query("SELECT * FROM profile", function(error, result, rows, fields) {
if (!!error) {
console.log('fail');
} else {
console.log(r... |
How to create a listview containing months of the current year with checkboxes? <p>Months including the current month and the months to come from the current year should be displayed.</p>
| <p>Lets try to answer:</p>
<p>In Android there is a class named <code>Calendar</code>. This is probably the best way to work with dates.</p>
<p><a href="https://developer.android.com/reference/java/util/Calendar.html" rel="nofollow">this is the documentation</a></p>
<p>You can istantiate a new istance by using </p>
... |
Javascript Alert won't alert a string? <p>I'm a bit confused and i'm guessing there's a simple fix so please help.</p>
<p>I have this code (Just a snippet)</p>
<pre><code>$new = "1";
<script language="javascript">
alert(<?php echo $new; ?>);
</script>
</code></pre>
<p>This works fine. It will ... | <p>You're not quoting your string within the Alert function.</p>
<p>Do this:</p>
<pre><code>alert('<?php echo $new;?>');
</code></pre>
<p>or this, for short</p>
<pre><code>alert('<?= $new ?>');
</code></pre>
|
Get 10 distinct projects with the latest updates in related tasks <p>I have two tables in a PostgreSQL 9.5 database:</p>
<pre><code>project
- id
- name
task
- id
- project_id
- name
- updated_at
</code></pre>
<p>There are ~ <strong>1000 projects</strong> (updated very rarely) and ~ <strong>10 million tas... | <p>Try a group by expression, that's what it's aimed for :</p>
<pre><code>SELECT project_id, max(update_date) as max_upd_date
FROM task t
GROUP BY project_id
order by max_upd_date DESC
LIMIT 10
</code></pre>
<p>Do not forget to put an index that begin with : project_id, update_date if you want to avoid full table sca... |
Return a boolean from generic method for boolean return type <p>I have a generic method <code>SendHttpRequest<TRequest, TResponse></code> that takes in a request-type and a response-type as its generic parameter inputs. The response-type can be either a boolean or a class representing the response.</p>
<p>My tas... | <p>I suppose you already understand that it's a bad design, but if you really want to make it exactly like this, you can do it:</p>
<pre><code>private async Task<TResponse> SendHttpRequest<TRequest, TResponse>(TRequest request)
{
using (var client = new HttpClient())
{
client.BaseAddress = ... |
Remove index.php from codeigniter in subfolder <p>My codeigniter is installed in admin_new folder on hostinger and path of installed codeigniter is <strong>public_html/vishwa/admin_new/</strong> and i am trying to remove index.php from url. </p>
<p>I have changed my .htaccess file as below.</p>
<pre><code>RewriteEngi... | <p>try this</p>
<pre><code>RewriteEngine on
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
</code></pre>
|
If else function....how to use return <pre><code>#include <stdio.h>
#include <cs50.h>
int GetPositiveInt();
int main (void)
{
int min; /*variable to hold minutes*/
printf ("How many minutes does it take you to use a shower?");
scanf ("%d", &min);
int numbtl = min * 12; /*computes number... | <p>Lets break down your program and see what it is doing; first</p>
<pre><code>int GetPositiveInt();
</code></pre>
<p>Is a <a href="https://en.wikipedia.org/wiki/Forward_declaration" rel="nofollow">forward declaration</a> for a function that is never used or defined, you can remove it entirely.</p>
<pre><code>int ma... |
Perfomance-consumption of realloc() <p>I'm wondering how much performance a realloc() really costs: I'm doing it quite often to extend an available memory area by one element (=specific structure). Is - thanks to the MMU - such an realloc() just the extension of the reserved memory area or is there a complete copying o... | <p><code>realloc</code> copies all the data. Assuming anything else is just asking for performance trouble. The situations when <code>realloc</code> can avoid copying are few and you should absolutely not count on them. I've seen more than one implementation of <code>realloc</code> that doesn't even bother implementing... |
How to use Rcpp to do numerical integration in C++ within R <p>I was wondering how <code>Rcpp</code> could be used to perform numerical integration by calling C++ in R. My current setup takes a really long time and is highly error prone.</p>
<p>I think I need something better than default R numerical integration packa... | <p>You'd have a lot easier time using <code>RcppNumerical</code> with <code>Rcpp</code> (and yes, it would make it faster).</p>
<p>The code is a port of <a href="https://github.com/tbs1980/NumericalIntegration" rel="nofollow">NumericalIntegration</a>, which combines relevant parts of Quantlib and a few other C++ libra... |
SonarLint displaying issues only in files changes <p>I'm looking to improve the code base of the department I'm working and I want to do it in a incremental way.
My idea is that I only want to be running SonarQube and SonarLint in the files that the developer is changing.
In sonarqube we have:
<a href="https://blogs.ms... | <p>This answer is not specific to SonarLint but to Visual Studio. In the "Error List" window there's a dropdown where you can select to only display issues in "Changed Documents".</p>
|
allow to auto generate DBs in sql server under windows authentication <p>In my <code>web.config</code> I have defined following connection string for a Database that not existing in sqlexpress (code first entity framework approach)</p>
<pre><code><connectionStrings>
<add name="cityconnectionstring" connec... | <p>When the connection is verified it checks that you have access to the database. If the database does not exist then you cannot verify the connection.</p>
<p>If as your question's title suggests, you want to create the database, then you will still need to connect to a database first. IF you have permissions to crea... |
load external xml file into js variable to be using jquery <p>I am trying to load an xml file containing config for a single page apps logic using jquery.</p>
<p>I can get the console to show the xml has been loaded and even display the xml in console but have yet to be able to get the xml to be declared as a string v... | <p>You can do something like this</p>
<pre><code>$.ajax({
type: "GET",
url: "dummy.xml",
success: function (xmContent) {
console.log(xmContent);
xmlDoc = $.parseXML(xmContent),
$xml = $( xmlDoc ),
$title = $xml.find( "title" );
console.log($title );
}
});
</code></pr... |
How to work with factors in matrices in R <p>I'm debugging someone else's code in R. I have data in a matrix called <code>seg</code> which looks like this-
<code>head(seg)</code></p>
<blockquote>
<p>id | chr | start | end | test | ref | position | log2</p>
<p>102G.bam.vs.ref1.hits | 1 | 100350001 | 101250000 | ... | <p>Ok, I found a way to avoid this, not very elegant, but it works.
Instead of changing the factor levels directly like I did, I created a new factor, with the same data, and replaced the previous one with it.</p>
<p>Instead of this-
<code>levels(seg$chr) = c(1:22, "M","X","Y")</code>
which changed the factor itself, ... |
Is it possible to use two Bluetooth adapters in Android? <p>I have checked two different bluetooth adapters(one with UART interface and other with USB interface Bluetooth dongle) separately in Android Lollipop 5.0. I have done this with kernel changes and HAL changes. (UART HAL and USB support HAL in libbt). </p>
<p>N... | <p>The short answer is not support yet. the Adapter here actually means the controller or the RF, now since you have two RFs, the Adapter does not know who should operate. however you can modify the code, e.g. add the index to make it support two RF's but this is lot of work to do. </p>
<p>Another option is that made ... |
16-bit color images with pyinsane <p>pyinsane's scan sessions return a list of 8-bit PIL images by default. This is true, even when the scan has been done in 16-bit mode (for instance using the transparency unit). Is there any way to get 16-bit images (I suppose PIL does not support that) or the original raw data out o... | <p>You're right, this is a limitation from Pillow (PIL). You can actually see the conversion from raw to PIL Image here : <a href="https://github.com/jflesch/pyinsane/blob/stable/src/pyinsane2/sane/abstract.py#L161" rel="nofollow">https://github.com/jflesch/pyinsane/blob/stable/src/pyinsane2/sane/abstract.py#L161</a></... |
Use Apple Touch ID for login with external database <p>I have an iOS application made in Swift, which is a little social network. User can connect with login/password which I save on a database on a private server. I would like to implement TouchID to help them login faster. However, my users' account are not linked to... | <p>Touch ID does not identify a person (it cannot tell you if it's user 1 or user 2). It authenticates a person (the owner of the phone).</p>
<p>So you cannot use Touch ID alone to login. What you can use it for, is avoiding entering the same credentials.</p>
<p>So it would work like this:</p>
<ol>
<li>The first tim... |
JS pass an object property as a parameter of function <p>I can't pass an object property <code>fullName</code> as a parameter of function <code>setData</code>.</p>
<p>Function <code>setData</code> should called after entering a some value in modal window.</p>
<p>I want to set <code>value</code> to <code>user.fullName... | <p>To use a runtime-defined property name, use brackets notation, not dot notation:</p>
<pre><code>user[data] = value;
</code></pre>
|
How to block a content editable at specific position if a div with style absolute position is overlapped on it <p>I am creating an application where I have created a MS-word type application in Jquery. Now I have a problem where I have an editor and I want to place a div 'footer' on it at some position which I can do t... | <p>I'm not sure this is easily possible with one contenteditable element. I setup a basic example using multiple contenteditable elements, one for each page.</p>
<p>Example: <a href="https://fiddle.jshell.net/d68ew9qc/" rel="nofollow">https://fiddle.jshell.net/d68ew9qc/</a></p>
<p>The following snippet adds a new pag... |
Extend object on Meteor <p>When i add/edit blogPost, i've my object with all properties. My code :</p>
<p>Add post :</p>
<pre><code>Template.postListAdmin.events({
'submit form': (e) => {
// Prevent default browser form submit
e.preventDefault();
let image = $('#js-image-uploaded'),
draft =... | <p>You should be able to achieve what you want to do by defining post without the <code>let</code> keyword.</p>
<p>For example:</p>
<pre><code>post = {
title: $('[name="title"]').val(),
image: image.attr('src'),
isSmall: isSmall,
description: $('[name="description"]').val(),
category: $('[name="category"]')... |
javascript converts regex pattern <p>Somehow browser converts regex pattern <code>[a-z0-9+&@#%=~_|!,.:;\?\/\-]</code> to this <code>[a-z0-9+ââ¬Åââ¬â¹&@#%=~_|\/\-]</code> in user side. JS file is coded with utf8 without BOM and every other symbols does not change just these. How it could be fixed?</p>
| <p><code>ââ¬Å</code> is a ZERO WIDTH NON-JOINER<br>
<code>ââ¬â¹</code> is a ZERO WIDTH SPACE</p>
<p>Maybe these came from copying the regex from elsewhere, but it's fairly obvious that they aren't intended parts of the regex.</p>
<p>Your problem can be solved by re-typing your regex (do NOT copy-paste it)</p>
|
SQL Select MIN in Subquery returns multiple records <p>I have a Table with Orders</p>
<pre><code>+----+-------------+--------+
| ID | OrderNumber | CartId |
+----+-------------+--------+
|1 | ABDE45677 | 1 |
|2 | ABFRTG456 | 2 |
+----+-------------+--------+
</code></pre>
<p>One with cart items for ... | <pre><code>SELECT o.ID,
o.OrderNumber,
MIN(SELECT MIN(type) FROM CartItemEvents cie WHERE cie.CartItemId=ci.Id
AND cie.EventDate=
(SELECT MAX(EventDate) FROM CartItemEvents WHERE ci.id=CartItemId))
AS 'status'
FROM... |
Create one object file for multiple files in directory <p>I have around 5 files(a.lua, b.lua, c.lua, d.lua, e.lua) in one directory say <strong>dir_1</strong>. Is it possible to create one object file for all the files in <strong>dir_1</strong>?</p>
<p>I want to use <strong>dir_1</strong> files in some other directory... | <p>Yes, you can create a composite compiled script. For example,</p>
<pre><code>luac -o all_in_some_order.lub *.lua
</code></pre>
<p>I gave it a .lub extension for Lua Binary. Nonetheless, Lua treats binary and text scripts the same. Like a text script, the composite is just like a body, except that the composite is ... |
Understanding IOC Container Injection <p>I am new to spring and not able to understand when to instantiate the class with new operator and when by using spring container.
example i found a code</p>
<pre><code>import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathX... | <p>From ProSpring book, </p>
<p>"Of the applications that we have built using Spring,
the only objects that are consistently not managed by Spring are domain objects. (Even though in Spring
itâs possible to have Spring manage domain objects by applying the @Component annotation to the classes
and assigning them with... |
Passing POJO class, object to another POJO <p>I am sure this question might have been asked couple of times here but I am not understanding what query I should use.
What I want to do is, Passing POJO to another POJO where parameter could be dynamic</p>
<p>like example below</p>
<pre><code>Class DataPOJO{
private ... | <p>You should declare <code>RequestmakerPOJO</code> as a generic class:</p>
<pre><code>class RequestmakerPOJO<T> {
...
}
</code></pre>
<p>Now you can use <code>T</code> as a type wherever you want. For example, the constructor can be </p>
<pre><code>RequestmakerPOJO(AuthPOJO auth, T data) {
...
}
</cod... |
Odoo template get value from input <p>In a custom template (website) I've added an input tag. I'd like to get the value of this tag in order to send it to the controller. By adding this to the URL, but I always get 'None' back.</p>
<pre><code><template id="InputTemp" inherit_id="website_sale.cart">
<x... | <p>Your t-attf-href is rendered before any data has been entered into the form field. To do it the way you are you need to update your href using javascript. In odoo9 you need to use requirejs syntax to load the proper libraries to run a post request to your controllers. If you are just using a get request then the fol... |
undefined method `where` for searchkick <p>I'm trying to add a date range filter to my searchkick</p>
<p>This is what i have</p>
<pre><code> @events = Event.page(params[:page]).per(10).search(params[:search], misspellings: { distance: 1 }, order: { date: :asc, eventname: :asc }, match: :word_start, page: params[:p... | <p>it looks like searchkick uses it's own query syntax. so something like this might help </p>
<pre><code>search_opts = {
misspellings: { distance: 1 },
order: { date: :asc, eventname: :asc },
match: :word_start,
page: params[:page],
per_page: 20
}
if params[:date_from]
search_opts[:where] = { date: {g... |
Unable to read bytes from specific blocks of MIFARE with SL018 <p>I am trying to read a specific block from a MIFARE card with a SL018 shield using an Arduino Uno. Writing it is no problem, but for a project me and a classmate are working on we need to be able to read an input (even a 0 or 1 would be enough). </p>
<p>... | <p>Have a look at this <a href="https://github.com/marcboon/RFIDuino/blob/master/SL018/examples/sl018demo/sl018demo.ino" rel="nofollow">example code</a> of the SL018 libary. You can use the userinterface of the code with a serial terminal. If you want to read a tag, the intresting part is <code>case 'R':</code> (Read s... |
DOMException: Invalid property name on dataset <p>I receive "<strong>Uncaught DOMException: Failed to set the 'child-count' property on 'DOMStringMap': 'child-count' is not a valid property name.</strong>" when the following code is executed: </p>
<pre><code>elem.dataset['child-count'] = "test";
</code></pre>
<p>wher... | <p>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset" rel="nofollow"><code>dataset</code></a> properties are camel-cased: <code>elem.dataset.childCount</code>. They are implicitly transformed to hyphenated attribute names (<code>data-child-count</code> in your case).</p>
|
Issue in removing Exif metadata from images without loss of quality or color <p>Referring to this link</p>
<p><a href="http://stackoverflow.com/questions/13646028/how-to-remove-exif-from-a-jpg-without-losing-image-quality/17516878#17516878">How to remove exif from a JPG without losing image quality?</a></p>
<p>I thou... | <p>Try <code>exiftool</code> as follows to remove all EXIF data without losing quality:</p>
<pre><code>exiftool -all= image.jpg
</code></pre>
<p>You can achieve the same with <code>jhead</code> too:</p>
<pre><code>jhead -purejpg image.jpg
</code></pre>
|
Golang map in order range loop <p>I'm looking for a definitive way to range over a <code>Go</code> <code>map</code> in-order.</p>
<p><a href="https://golang.org/ref/spec#For_statements" rel="nofollow">Golang spec</a> states the following:</p>
<blockquote>
<p>The iteration order over maps is not specified and is not... | <p>If you need a <code>map</code> and keys in order, that is 2 different things, you need 2 different (data) types to provide that functionality.</p>
<h3>With a keys slice</h3>
<p>The easiest way to achieve this is to maintain key order in a different slice. Whenever you put a new pair into the map, first check if th... |
Facing NoSuchMethodError for io.netty.util.AttributeKey.valueOf() method with grpc and protobuf Hello world example <p>After running GreetingServerTest.java tests I am getting below given errors. I am using grpc 1.1.0-SNAPSHOT libraries and trying to implement basic Helloword example of grpc given in there git repo. Ca... | <p>There could be multiple versions of netty jar in you class path during runtime. Use following command to check dependency tree.</p>
<pre><code>mvn dependency:tree -Dverbose
</code></pre>
<p>Or your container provides the netty jar might be clashing with the version of jar you packaging with your application.</p>... |
Meteor Angular 2 - autobind not working in the tutorial <p>I am following the Meteor - Angular2 tutorial and things work fine.</p>
<p>The only point not working is the automatic binding with Angular2 UI for the 'details view'. For instance, if I navigate to the details view of <em>Party1</em> the data of <em>Party1</e... | <p>I actually found the answer to my questions just reading more of the Tutorial.</p>
<p>I can get automatic update ofthe UI once the underlying Mongo doc changes just adding Meteo autorun() method appropriately in the subscription code.</p>
<p>Here is the code that works</p>
<pre><code>ngOnInit() {
this.route.p... |
UWP - How to ignore system text scaling settings <p>I have a "problem" with the text scaling setting (All settings -> Ease of Access -> More options). It increases the text size and creak my design. For example, texts of my menu are cut.
So, I have two questions:</p>
<ul>
<li><p>In applications developed by Microsoft,... | <p>If you do not want the text automatically scales according to the system text size setting, you can set <a href="https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.textblock.istextscalefactorenabled" rel="nofollow"><strong>IsTextScaleFactorEnabled</strong></a> property to <strong><code>false</c... |
Add to List Property using the properties Index C# <p>I want to user a foreach loop to add to a c# list without using the list properties Key name.</p>
<p>I have a list such as</p>
<pre><code>public class Bus
{
public string Val1 { get; set; }
public string Val2 { get; set; }
public string Val3 { get; se... | <p>Why not use</p>
<pre><code>public class Bus
{
public string[] Val = new string[127];
}
j = 0;
for (int i = 0; i<lines.Length; i++)
{
foreach(Bus BusProp in BusList)
{
BusProp.Val[j] = line[i + j];
j =+ 1;
}
}
</code></pre>
|
visual studio 2015 fatal error on test debug <p>Since today, i receive this message:</p>
<p><a href="http://i.stack.imgur.com/nh1dc.png" rel="nofollow"><img src="http://i.stack.imgur.com/nh1dc.png" alt="enter image description here"></a></p>
<p>After this i receive <code>visual studio 2015 remote debugger has stopped... | <p>This solved my problem :)</p>
<p><a href="http://i.stack.imgur.com/SplP0.png" rel="nofollow"><img src="http://i.stack.imgur.com/SplP0.png" alt="enter image description here"></a></p>
<p>from this post: <a href="http://stackoverflow.com/questions/31580182/visual-studio-2015-rtm-debugging-not-working">Visual Studio ... |
Video capture on windows 10 version 1607 <p>May be some of you have heard about video capture issues with Windows 10 Anniversary Update (1607). The essence of all discussions in social media is that there are problems with MJPEG. Our company has developed a camera that is an UVC device and uses the YUY2 Mediaformat. It... | <p>Windows 10 Anniversary Update problems are mostly related to appearance of new component between web camera and applications: Frame Server (see <a href="http://alax.info/blog/1686" rel="nofollow">related explanation</a>).</p>
<p>Broken support for M-JPEG was a side effect, which among other was later fixed or parti... |
Jupyter notebook and QT Console are calling different version of pandas <p>QTConsole is running the latest version of pandas (i.e. 0.18). However, when I import pandas in Jupyter notebook, it can only import 0.15. How can I resolve this?</p>
<pre><code>**QT Console:**
Jupyter QtConsole 4.2.0
Python 2.7.11 |Anaconda... | <p>You probably have different versions of Python installed via different distributions. If you are using Windows, I recommend uninstalling all Python versions/distributions, rebooting and then only installing one.</p>
<p>If you are using Mac, ensure that you have only one version of Anaconda installed and that it is ... |
Center absolutely positioned child element <p>I need to horizontally center the child element of an inline block. The issue is that the child sub menu is variable width and can be wider than its parent. My initial solution was to set the child element a left & right of -50px but this is not really a variable width ... | <p>Here's what I usually do in this kind of situation:</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>.parent {
/*....your existing css...*/
position: relative;... |
What version of Dokka goes with what version of Kotlin? <p>Whenever the Kotlin and Dokka versions are not compatible, things might break oddly in Gradle and Maven builds. I cannot find anywhere a list of the compatible versions between the two. What is the version compatibility?</p>
<p><strong>Note:</strong> <em>thi... | <p>Here are the matching compatible versions:</p>
<pre>
Kotlin Version Dokka Version
----------------|-----------------
1.0.0 0.9.7
1.0.1 0.9.7
all 0.9.8 or later
</pre>
<p>Since <code>0.9.8</code> Dokka no longer can conflict with the compiler classes since it embeds a shaded... |
Obtain specific cell-value based on another cell-value <p>Hope you're well.</p>
<p>I am currently working on trying to obtain the value of a specific cell based on another cell's value.</p>
<p>If you take the example below:</p>
<p><a href="http://i.stack.imgur.com/IErZz.jpg" rel="nofollow">Sample</a></p>
<p>What I'... | <p>In <code>C1</code> put the formula <code>=LOOKUP("Yes", D4:D1000, C4:C1000)</code>. </p>
<p>This will find the last occurrence of "Yes" and return the value in the adjacent <code>C</code> cell to <code>C1</code>. </p>
<p>Would you rather have a dynamic range? Or have it based on your dates? The above formula would... |
Matlab print does not keep background transparency <p>I am creating surface plots with a transparent figure background in Matlab R2015b. Consider the code</p>
<pre><code>n=49;
h=figure;
[x,y]=meshgrid(1:n,1:n);
surf(x,y,peaks(n),'EdgeColor','none')
set(h,'Color','none')
set(h, 'InvertHardCopy', 'off');
print(h,'-dpdf... | <p>The key is the property <code>set(h, 'InvertHardCopy', 'off');</code></p>
<p>From the MATLAB help:</p>
<blockquote>
<p>InvertHardcopy â Figure background color when printing or saving<br/>
'on'(default) | 'off'<br/>
Figure background color when saving or printing,
specified as one of these values:</p>
... |
Escaping escaped <p>I'm needing to PHP escape, the MySQL escape. The MySQL escape contains both star and backslash.</p>
<p>I've gotten the MySQL escape part correct and the MySQL query runs correctly. I am however struggling to escape the MySQL escape <code>"\*"</code> correctly in PHP.
I've tried and looked at sever... | <p>I'm not sure you need to escape the * in MySQL but if it needs, I would use the <code>CHAR()</code> method which looks cleaner</p>
<p><code>and StockCode != CHAR(42)</code></p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.