input
stringlengths
51
42.3k
output
stringlengths
18
55k
XPath expression: selecting text nodes between element nodes <p>Based in the following HTML I want to extract TextA, TextC and TextE.</p> <pre><code>&lt;div id='content'&gt; TextA &lt;br/&gt; &lt;br/&gt; &lt;p&gt;TextB&lt;/p&gt; TextC &lt;br/&gt; TextC &lt;p&gt;TextD&lt;/p&gt; TextE...
<p>The reason why the two text nodes aren't in the result of your XPath is because <code>*</code> only match <em>elements</em>. To match both element and text node you can use <code>node()</code> instead :</p> <pre><code>//node()[preceding::p[contains(.,"TextB")] and following::p[contains(.,"TextD")]] </code></pre> <...
R: setting label spacing and position on a bar plot <p>I want to present percentages over a 24h period in 15 min intervals as a bar plot. </p> <p>When I use barplot(), the labels for those timepoints are more or less randomly chosen by R (depending on how I format the window. I know it's not random, but it's not what ...
<p>I do not think you can force R to show every label if it does not have enough space. But at least if you want to add the labels every 1h, the following code should work :</p> <pre><code>x&lt;-sample(1:100,96) Labels&lt;-c("09","09:15","09:30","09:45","10","10:15","10:30","10:45","11","11:15","11:30","11:45","12","1...
Opentok library stopped working on S7 edge <p>it was working prev but its crashing from today Device</p> <blockquote> <p>Galaxy S7 Edge (hero2lte)</p> <p>Manufacturer Samsung Android version</p> <p>Android 6.0 RAM (MB) 4096 OpenGL ES version 3.1 Native platform</p> <p>armeabi-v7a CPU make Samsung C...
<p>Just found a solution: Add this to app level gradle .</p> <pre><code>defaultConfig { ndk { abiFilters "armeabi", "armeabi-v7a", "x86", "mips" } } </code></pre> <p>But i want to know in detail why and what is difference , after adding this code snippet .</p>
Can't use jQuery to target elements in Meteor <p>I have a home-template.html file: </p> <pre><code>&lt;template name="override-atPwdForm"&gt; &lt;div id="test"&gt;Test 1&lt;/div &lt;/template&gt; </code></pre> <p>And home-template.js.</p> <pre><code>Template['override-atPwdForm'].onRendered = function(){ $("...
<p>Can you try like below:</p> <p>template code:</p> <pre><code>&lt;template name="override-atPwdForm"&gt; &lt;div id="test"&gt;Test 1&lt;/div&gt; &lt;/template&gt; </code></pre> <p>JS code:</p> <pre><code>Template['override-atPwdForm'].onRendered(function() { Meteor.defer(function(){ $("#test").a...
Load Spark RDD to Neo4j in Python <p>I am working on a project where I am using <strong>Spark</strong> for Data processing. My data is now processed and I need to load the data into <strong>Neo4j</strong>. After loading into Neo4j, I will be using that to showcase the results.</p> <p>I wanted all the implementation to...
<p>You can do a <code>foreach</code> on your RDD, example : </p> <pre><code>from neo4j.v1 import GraphDatabase, basic_auth driver = GraphDatabase.driver("bolt://localhost", auth=basic_auth("",""), encrypted=False) from pyspark import SparkContext sc = SparkContext() dt = sc.parallelize(range(1, 5)) def write2neo(v):...
Custom Dictionary reference - Swift <p>I'm trying to work with a custom dictionary that is supposed to save to the user's phone. Unfortunately, I'm having trouble getting the dictionary to actually save and pull correctly. I think the problem might be (among possible other things) that I have the app reading my custom ...
<p>You should have a top level dictionary instance:</p> <pre><code>var allInfo = [String: DayData]() </code></pre> <p>Then you can update the data by using dictionary subscript:</p> <pre><code>allInfo["2016/09/02"] = DayData(sales: 0,...) </code></pre> <p>Note that using dictionaries in this way will only persist t...
How to create two custom table cell buttons? <p>I am preparing a table in which when I swipe the cell I need to get two rounded buttons. Each button should have one image and and a label.</p> <pre><code>override func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -&gt; [UITableV...
<p>First of all, there are some problems with your code :</p> <ol> <li>You return the result of <code>editButtonItem()</code> method, which basically discards your <code>hello</code> action. I'm gonna assume from the name of it, that this method returned a single action, and not two as you wanted.</li> <li>In your act...
Why is this function returning void and not false <p>In following code: </p> <pre><code>(define (memberi sl item (i 0)) (cond [(empty? sl) #f] [(equal? (first sl) item) i] [(memberi (rest sl) item (add1 i))] )) (define tstlst (list 1 2 3 4 3 5 2 6 2 6 8 5 3 9 2 4 2 5)) (println (memberi tstlst 10))...
<p>The reason is that in the last case of the <code>cond</code>, <code>(memberi ...)</code> is the test, and nothing is returned if it is true, since nothing follows it. </p> <p>Simply change the function to:</p> <pre><code>(define (memberi sl item (i 0)) (cond [(empty? sl) #f] [(equal? (first sl) item) i] ...
Apply heading style in VBA from Excel to Word <p>Here is the code i have in Excel to control a word document, and publish it with some data. I would like to create some of the text in different styles, but keep getting Run time error 430 (Class does not support Automation or does not support expected interface)</p> <p...
<p>you have to:</p> <ul> <li><p>set <a href="https://msdn.microsoft.com/en-us/library/office/ff821411.aspx" rel="nofollow"><code>Selection</code></a> object of the wanted document any window </p> <pre><code>Set objSelection = objDoc.ActiveWindow.Selection </code></pre></li> <li><p>explicitly reference <code>Word</cod...
Ionic loading not working <p>I'm working on an ionic app. I want to show a loading symbol while fetching data. So I used the following code:</p> <pre><code>function showLoading() { console.log("Loading") $ionicLoading.show({ content: 'Loading', animation: 'fade-in', showBackdrop: true,...
<p>you have to use $scope variable in angularjs functions.</p> <pre><code> $scope.showLoading = function () { console.log("Loading") $ionicLoading.show({ content: 'Loading', animation: 'fade-in', showBackdrop: true, maxWidth: 200, showDelay: 0 }); }; $scope.hideLoading = function (){ ...
disable submit button if error on datavalidation is not working <p>I am using a Jquery form validator to validate some input fields in my form, what I am trying to achieve is that, if a person does not validate all the fields, the submit button should not be able to be clicked by a user.(Should be disabled)</p> <p>Thi...
<p>First of all your form don't have 'toggle-disabled' class which you are targeting.</p> <pre><code> &lt;form action="#" method="POST" class="toggle-disabled"&gt; Then you need to disabled the button initially. The plugin will later enable it. &lt;button type="submit" value="Login" disabled="disabled"&gt;BI...
why does the cursor exit when there is null value in the column <pre><code>create or replace procedure data_quality_check( inface_id number default null) is v_src_clmn varchar2(400); v_tgt_clmn varchar2(400); v2_src_value varchar2(400); date_chk varchar2(200); v2_primary_key varchar2(400); CURSOR cur_1 is select temp...
<p>You have an early unconditional <code>exit</code> within the loop:</p> <pre><code>LOOP ... IF v2_src_value is NULL then Insert into BUNTERFACEDATA_QLTY_CHK ...; commit; **exit;** end if; </code></pre> <p>The first time the loop encounters a null, your code will exit the loop.</p>
Finding items that are common to all the input files <p>I have a series of files of the type-</p> <pre><code>f1.txt f2.txt f3.txt A B A B G B C H C D I E E L G F M J </code></pre> <p>I want to find out the ent...
<h3>Using python</h3> <p>This python script with find the common lines among a large number of files:</p> <pre><code>#!/usr/bin/python from glob import glob fnames = glob('f*.txt') with open(fnames[0]) as f: lines = set(f.readlines()) for fname in fnames[1:]: with open(fname) as f: lines = lines.inter...
Writing a bash file that runs in the background and checks the connection? <p>I have to solve a problem at my firm, which is that we use Raspbian(unix) based Raspberry Pi machines to connect remotely to Windows 7 machines and work from there. The problem is, all the easy to use, free, unix based rdesktop applications c...
<p>One way to solve it could be to create a daemon which continously checks the connection to the host machine.</p> <p>Doing it this way involves creating two files</p> <ul> <li>the script which pings the host <code>/usr/local/bin/checkconnection.sh</code></li> <li>the daemon file <code>/etc/init.d/checkconnectiond</...
GroupBy with multiple attributes in angular filter <p>I have the json data like below <code>[{ "id": 1, "address": "MG Road", "country": INDIA, "state": AP, "city": VIJ }, { "id": 2, "address": "Miyapur", "country": INDIA, "state": TS, "city": HYD }, { "id": 3, "address"...
<p>If you like you may try this one to get your output</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"&gt;&lt;/script&gt; &lt;script&gt; var myApp = angular.module('myApp', []); myApp.controller('myAppCtrl', function ($scope) ...
Oracle Managed DataAccess causes ORA-12537 Network Session: End of file <p>I could not create Oracle edmx in my asp.net solution when i use oracle.ManagedData access</p> <p>Below is the stack trace, Please advice. I have also tried the solutions provided in <a href="http://stackoverflow.com/questions/29847444/odp-net-...
<p>I have fixed this by recreating edmx with unmanaged driver instead of managed Driver. Application works perfect. !! used ODAC 12c Release 4.</p>
How to make a series sync call on javascript <p>I want to make a seres of function calls in order in javascript. My case is that I want to upload a few images to the server one by one but I don't know how to do that in javascript. Below is a method to solve a sync call for a know number of functions.</p> <pre><code> ...
<p>How about making an array with the 'yet to call' methods. And a recursive function which runs until the array is empty. Have a look at this simplified example:</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-j...
Is it safe to compile againts later JDK? <p>I have some big projects running on Java 6. But I plan to start building them in Java 8 since a lot of build tools have moved away from Java 6.</p> <p>Is it safe for me to simply compile them with Java 8 and then deploy them in a web container running Java 8? If not, what ar...
<p>It usually should be, since most of the features are backward compatible. However, there are no guarantees. Please do follow the proper process and do testing before rolling out to production.</p> <p>For web container , with jdk, version would also have changed. This may cause some problems depending upon the softw...
Get resolve variable and pass to controller <p>Hi I created a model named billerModel and a route that has a resolve with a variable of billers. Now I want to retrieve and assign this variable inside my controller but I get this billerData unknown provider error. Below are my code for the route:</p> <pre><code>app.con...
<p>Resolve data in <code>.when</code> blocks is only injectable into controllers defined by the <code>.when</code> block. Child controllers injected by the <code>ng-controller</code> directive can not inject resolve data.</p> <p>Also if you inject <code>billerController</code> in the <code>.when</code> block <strong>a...
JBOSS Application Server getting hanged on Production environment <p>Can someone please give detailed way to monitor JBOSS app server ? The production application running on JBOSS server starts working fine after restarting the server. How do I identify what is the cause behind it?</p>
<p>To see what is "hung", try getting a thread dump from your JBoss instance by running it in the foreground from a command shell. Then on Linux, send a kill -3 [PID] to JBoss to dump its thread state to stdout. On Windows, you would <a href="http://stackoverflow.com/questions/2124672/java-stack-dump-on-windows">type...
.htaccess can't read url with %20 <p>This is how my htaccess file look right now:</p> <pre><code>RewriteEngine On RewriteRule ^([\sa-zA-Z0-9_-]+)$ view.php?folder=$1 RewriteRule ^([\sa-zA-Z0-9_-]+)/$ view.php?folder=$1 RewriteRule ^([\sa-zA-Z0-9_-]+)\.html$ view.php?page=$1 </code></pre> <p>It accepts the url as:</p>...
<p><a href="http://stackoverflow.com/a/13722058/3536236">According to this answer</a> you should be using a url rewrite flag on your htaccess rewrite. </p> <p>(shameless quote of link to follow:)</p> <blockquote> <p>Try adding the <code>B</code> rewrite flag. This flag tells mod_rewrite to escape backreferences, ...
Create a desktop application using Electron api for existing Angular project <p>I have created a web based project in AngualrJs using Rest Api and now I want to create a desktop application using atom electron api, is there any way to create a desktop application in same with existing web based project?</p>
<p>Yes you can but you'll have to work a little, it don't have a magic project for this.</p> <p>So if your webapp is not responsive, it's a problem.</p> <p>And also read this : <a href="http://electron.atom.io/docs/faq/#i-can-not-use-jqueryrequirejsmeteorangularjs-in-electron" rel="nofollow">http://electron.atom.io/d...
How to read MSSQL CE SDF file in Linux Platform. <p>I want to extract some data from an SDF file where the server operates on Linux platform. There is no database access to the SQLCE DB which is present in a remote server. I want to achieve the task by using PERL but can use C or any language if required.</p>
<p>You can only open SQL Server Compact SDF files on Windows, you could expose the data to a Unix machine via a REST API or similar.</p>
How to Draw Line From Pointer to left, up, right, bottom in HTML using end point of line <p>Hellow Friend, I Want to Draw a simple Line (hr) using css and HTML. It is simple to draw From Left-Right and Bottom-Top. But While i want to draw Line From Right Pointer to Left and Top Pointer to Bottom, I Can't think about CS...
<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>#toptobottom{ height:100px; width:0px; border-left:solid black; } #lefttoright{ margin-left:100px; width:200px; borde...
python, pyspark : get sum of a pyspark dataframe column values <p>say I have a dataframe like this</p> <pre><code>name age city abc 20 A def 30 B </code></pre> <p>i want to add a summary row at the end of the dataframe, so result will be like</p> <pre><code>name age city abc 20 A def 30 B All 50 All <...
<p>A dataframe is immutable, you need to create a new one. To get the sum of your age, you can use this function: <code>data.rdd.map(lambda x: float(x["age"])).reduce(lambda x, y: x+y)</code></p> <p>The way you add a row is fine, but why would you do such a thing? Your dataframe will be hard to manipulate and you wont...
Issue in Joins when some fields are null <p>I want to get exactly one row with <code>car</code> data with the <code>carName</code> and the values, if they exist, for this car's <code>makerName</code> and <code>plateNumber</code>.</p> <p>For example <code>Ford Taurus, Ford, 4AD843</code>. </p> <p>If for some reason th...
<p>You should use SQL <a href="http://www.w3schools.com/sql/sql_join_left.asp" rel="nofollow"><code>LEFT JOIN</code></a> keyword, that returns all rows from the left table (<code>car</code>), with the matching rows in the right table (<code>maker</code> or <code>license</code>). The result is <code>NULL</code> in the r...
KeyDown event doesn't work when ComboBox is opened? <p>Why is the <code>KeyDown</code> event not triggered when the <code>ComboBox</code> dropdown is opened? Is there any way to trigger this.</p> <p>I'm trying to use <code>KeyDown</code> event to check which key is pressed and automatically selecting an item from the ...
<p>I can imagine the dropdown popup getting focus, so you'd have to get access to that and subscribe to key events on that as well. See the template <a href="https://msdn.microsoft.com/en-us/library/dd334408(v=vs.95).aspx" rel="nofollow">here</a> for reference. You could try subscribing to these events on the <code>Pop...
No provider for router in angular2 rc5 <p>in module.ts</p> <pre><code> import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { Router } from '@angular/router' import { AppComponent } from './app.component'; @NgModule({ imports: [ ...
<p>The <code>RouterModule</code> needs to be imported</p> <pre><code>@NgModule({ imports: [ BrowserModule, RouterModule ], </code></pre> <p>or as it's usually done</p> <pre><code>const appRoutes: Routes = [ { path: 'heroes', component: HeroesComponent } ]; export const routing: ModuleWithProv...
How to find & copy everything between two tags (Including tags) <p>I am looking for an faster way to find &amp; copy everything between two tags (Including tags) in the many html files I'm handling. I'm currently using sublime to manually copy within each file. The html tag is constant (<code>&lt;center&gt;</code> <cod...
<p>your regex is missing something I think. with <code>.*</code> u get all characters but not a line-feed(newline) try somthing like this</p> <p><code>&lt;center&gt;(.|\n)*&lt;\/center&gt;</code></p> <blockquote> <p>breakdown of the changed part <br> <code>.</code>= all characters<br> <code>|</code> = or<br> <cod...
Why i get error in sql server ROW_NUMBER()? <p>I'm new to SQL Server and write this query:</p> <pre><code>SELECT ROW_NUMBER() over (ORDER BY TelNo ) as RowNum, Telno FROM [ClubEatc].[dbo].[GetOnlineBills] where RowNum=1 </code></pre> <p>When I run that query, I get this error:</p> <blockquote> <p>Msg 20...
<p>Try it this way,</p> <pre><code>SELECT * FROM ( SELECT ROW_NUMBER() over (ORDER BY TelNo ) as RowNum, Telno FROM [ClubEatc].[dbo].[GetOnlineBills] ) AS tbl WHERE RowNum=1 </code></pre>
Linux Xlib erroneous alpha handling <p>I have two piece of source code copied from stackoverflow and GitHub, which demonstrates alpha channel handling on an Xlib form. First is simple Xlib, next is OpenGL. However at me, it's working erroneously.</p> <p>If i set the alpha channel value to 0, then any colour should be ...
<p>In another topic the problem was solved: <a href="http://stackoverflow.com/questions/39906128/how-to-create-semi-transparent-white-window-in-xlib/">How to create semi transparent white window in XLib</a> The answer was pre-multiplying the color channels with alpha.</p>
gdb: thread debugging will not be available? <p>I'm using gdb-7.11.1 and I get this message on my embedded powerpc system. Some more background, the libpthread I use has been stripped off all the non-dynamic symbols, including <code>nptl_version</code>, which libthread_db uses to make sure it is compatible with libpthr...
<p>On Linux (at least, and others), an important part of the threading library is implemented in the kernel: that the "kernel-thread", called LWPs (for light-weight process). </p> <p>GDB doesn't need <code>libthread_db</code> help to track them, as the OS itself can give the information the key information about them:...
Need to Pivot String values in SQL server <p>I have table described as:</p> <pre><code>Occupation String | Name String </code></pre> <p>With values:</p> <pre><code>Developer | A Developer | B Designer | X Coder | Y Coder | Z </code></pre> <p>I need values in pivot format as:</p> <pre><code>Designer | Deve...
<p>The basic PIVOT with ROW_NUMBER() will do things for you:</p> <pre><code>SELECT [Developer], [Designer], [Coder] FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY Occupation ORDER BY (SELECT NULL)) RN FROM #temp ) as t PIVOT ( MAX(Name) FOR Occupation IN ([Developer],[Design...
How to run command once line is detected from ADB Logcat? <p>As the titles says, I need to run some command/script after a particular log is printed from ADB Logcat, how can I go about it? Have tried things like </p> <pre><code>adb logcat | grep whatever | while read line do echo 'got it' done </code></pre> <p>but it...
<pre><code>adb logcat |grep --line-buffered 'whatever' | while read ; do echo "got it" ; done </code></pre> <p>Or using <code>awk</code> : </p> <p>General syntax :</p> <pre><code>tail -f &lt;log file&gt; | awk '/&lt;string to look for&gt;/ { system("&lt;shell command&gt;")}' </code></pre> <p>Command for your cas...
SimpleDateFormat adds 1 hour when convert UTC time to Australia time zone <p>I have used following code to convert UTC time to device current time zone time. It works fine on Indian Standard Time (IST). But it adds 1 hour additionally when device time zone is Sydney, Australia. </p> <p>For example, I give UTC time...
<p>I would advise trying</p> <pre><code>System.out.println(expectedSimpleDateFormat.getTimeZone()); </code></pre> <p>To see if all daylight saving schemes are correct on that device.</p>
Google maps API & HTML5 geolocation, map.getCenter() giving wrong value <p>I'm trying to write the users current location to a database but after the HTML 5 geolocation I get the wrong value for map.getCenter(). Here's the relevant code (from 2 different Google development sites). The complete code can be found at <a...
<p>The line <code>var latlng = map.getCenter();</code>, which you have added to Google's example code on <a href="https://developers.google.com/maps/documentation/javascript/examples/map-geolocation" rel="nofollow">https://developers.google.com/maps/documentation/javascript/examples/map-geolocation</a>, is executed BEF...
Symfony 3: How to use two choices/dropdowns from two tables in one form <p>Symfony version 3.1.3</p> <p>I have created a dropdown using the entity called <strong>Classes</strong> and you can see the Controller below,</p> <pre><code>public function studentAddClassAction( $id, Request $request ) { // get the studen...
<p>To have a custom set of entities as a choice list you need to use <a href="http://symfony.com/doc/current/reference/forms/types/entity.html#query-builder" rel="nofollow">a <code>query_builder</code> option</a></p> <p>So it will look like </p> <pre><code>$builder-&gt;add('parent', EntityType::class, array('...
Angular app http call custom service failing <p>I'm making a little angular app to show info about the english premier league. I want to make a service to deal with making http calls cos I do it a few times on the page and I don't want to repeat everything. Here is my table.js TableController, which is used for buildin...
<p>Check the controller you used, the controller function paramater is httpService, and you used inside is HttpService. Please chaeck that, Its case sensitive.</p>
Non-indexeed properties in Array <p>Can anyone explain how the result of <code>RegExp.prototype.exec</code> is made?</p> <p>If you try something like that: <code>/d/g.exec("d is a character, dd")</code> the result is an array structured as explained here: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScrip...
<p>An array is just an object. In fact, you can make simple array-like objects just like that:</p> <pre><code>var fakeArr = {} fakeArr[0] = 'foo'; fakeArr[1] = 'bar'; fakeArr.length = 2; </code></pre> <p>The only thing that distinguishes an array from a plain object is the behaviour of the <code>.length</code> proper...
Configure Eclipse IDE to move cache data out of eclipse installation direction <p>I believe this is normal user's behavior:<br> After downloading the eclipse IDE distribution, such as eclipse-jee-mars-2-win32-x86_64.zip file, you unzip it to a folder, e.g. C:. The eclipse executable is at C:\eclipse\eclipse.exe. (Here ...
<p>Here is the best I've got so far after some trial and errors: </p> <p>Take <strong>C:\eclipse</strong> as my eclipse home directory, which is extracted from eclipse distribution zip file. My goal is to keep this home directory clean.</p> <p>I created the following directories: </p> <pre><code>C:\eclipse-work.ws...
Custom textfield doesn't change default appearance <p>I have a few textfields in my view controller, I created a custom class for them: </p> <pre><code>class CustomTextField: UITextField { required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.layer.cornerRadius = 15.0; self.layer.bor...
<p>You set the UITextField subclass is <code>CustomTextField</code> &amp; then works...</p> <p><a href="http://i.stack.imgur.com/GMu8j.png" rel="nofollow"><img src="http://i.stack.imgur.com/GMu8j.png" alt="enter image description here"></a></p>
Binding Generic List in Asp.Net <p><strong>C#</strong></p> <pre><code>List&lt;Rating&gt; ratingList = new List&lt;Rating&gt;(); public class Rating { public string CustomerName; } RptCustomerRating.DataSource = ratingList; RptCustomerRating.DataBind(); </code></pre> <p>In the debugmode the List is filled. But i...
<p>You need to <code>get</code> and <code>set</code> the property <code>CustomerName</code></p> <pre><code>public class Rating { public string CustomerName {get; set;} } </code></pre>
Triggering CSS animations with jQuery; Fadein() is working but bounceIn() is not? <p>Does <code>fadeIn</code> work differently than the other animations? In this code only <code>fadeIn</code> works, if I change them all to <code>fadeIn</code> they all work:</p> <pre><code>$("#mainCenterBall").click(function(){ $("...
<p>That's not how to use CSS animations and functions like <code>bounceIn()</code>, <code>bounceInDown()</code>, etc. are not part of jQuery so they can't be used with a jQuery object like that. (<code>fadeIn</code> is a valid jQuery function.)</p> <p>To use CSS animations with jQuery triggering, you need to use CSS t...
(SQL) I want a specific row output from the given table <pre class="lang-none prettyprint-override"><code>Userid some_other_id phn_id date1 date2 date3 date4 3 21 1322 09-DEC-15 31-DEC-99 01-JAN-00 31/12/9999 3 22 1322 09-DEC-15 31-DEC-99 ...
<p>You could use <code>not exists</code> clause and write your criteria there or some analytic function to count occurences and then filter them. Sample SQL with <code>not exists</code>:</p> <pre><code>select t1.* from t t1 where userid &lt;&gt; some_other_id and phn_id = 1322 and not exists (select 1 from t t...
Scraping issues on a specific website <p>This is my first question on stack overflow so bear with me, please. </p> <p>I am trying to download automatically (i.e. scrape) the text of some Italian laws from the website: <a href="http://www.normattiva.it" rel="nofollow">http://www.normattiva.it/</a></p> <p>I am using th...
<p>Once you click any link on the page with dev tools open, under the doc tab under Network:</p> <p><a href="http://i.stack.imgur.com/orZHr.png" rel="nofollow"><img src="http://i.stack.imgur.com/orZHr.png" alt="enter image description here"></a></p> <p>You can see three links, the first is what we click on, the secon...
How can use ROW_NUMBER in this query? <p>I'm a new to SQL Server and has a this query:</p> <pre><code>SELECT distinct top 10 ExecuteDate FROM [ClubEatc].[dbo].[GetOnlineBills] ORDER BY ExecuteDate DESC </code></pre> <p>I should be use the <code>Row_Number</code> in that query, how can I write that query?</p> <...
<p>If you want a number for each row and the ExecuteDate should be distinct:</p> <pre><code>WITH CTE AS ( SELECT DISTINCT ExecuteDate FROM [ClubEatc].[dbo].[GetOnlineBills] ) SELECT TOP 10 ExecuteDate, RN = ROW_NUMBER() OVER (ORDER BY ExecuteDate DESC) FROM CTE ORDER BY ExecuteDate DESC </code></pre> <p>or wi...
error when using Union clause postgresql 9.5 <pre><code>CREATE OR REPLACE FUNCTION public.get_locations( location_word varchar(50) ) RETURNS TABLE ( country varchar(50), city varchar(50) ) AS $$ DECLARE location_word_ varchar(50); BEGIN location_word_:=concat(location_word, '%'); RETURN QUERY EXECUTE f...
<p>Try next corrected function:</p> <pre><code>CREATE OR REPLACE FUNCTION public.get_locations( location_word varchar(50) ) RETURNS TABLE ( country varchar(50), city varchar(50) ) AS $$ DECLARE location_word_ varchar(50); BEGIN location_word_:=concat(location_word, '%'); RETURN QUERY EXECUTE format(' ...
RDF - More than one Object for one Subject-Property <p>i've got one (maybe) simple question: Can i assign more than one ObjectResource to a fixed Subject-Property Statement?</p> <p>I want my RDF-Triples look like that:</p> <pre><code>[http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn, http://s...
<p>Yes this would be well formed data and it is a common way to define multiple values for a given property on a given subject.</p> <p>RDF has very few restrictions on what triples you can declare. Essentially these boil down to the following:</p> <ul> <li>The subject must be a URI/blank node</li> <li>The predicate ...
VBA: More questions about custom Type and Function with arrays <p>I am getting stuck on trying to pass array variable (custom type) to a function. The error comes up with the calling the function with <code>D1</code>, What am I getting wrong here please?</p> <p>I have tried declaring <code>D1()</code> etc which did no...
<p>The error message clearly tells you:</p> <blockquote> <p>Only user-defined types defined in public object modules can be coerced to or from a variant or passed to late-bound functions</p> </blockquote> <p>(It is helpful to include exact error messages in the question.)</p> <p>You did not declare parameter and r...
Need a mapping between Team name and Area Path in TFS <p>In TFS, Team can be associated with more than one AreaPath. I want to retrieve the mappings between AreaPath and TeamName. Is there any table in TFS databases which has mappings? or any REST API to retrieve that data?</p>
<p>You can try to use the <a href="https://www.visualstudio.com/en-us/docs/integrate/api/work/team-field-values" rel="nofollow">Team field values</a> Rest API.</p> <blockquote> <p>The team field is used to identify which work items belong to your team. By default, <strong>Area Path</strong> is the team field, but ...
How can we get Wifi IP in php (wordpress) and will the IP of connected user will be same as of wifi? <p>We need to give our website pages access to free users only and only if they are logged in through our Wifi. </p> <p>Is it possible that we can define such Wifi IP in the admin panel and user connecting through it w...
<p>See <a href="http://stackoverflow.com/questions/39505900/how-can-we-get-wifi-ip-in-php-wordpress-and-will-the-ip-of-connected-user-will#comment66328482_39505900">Carlos Fdev's comment</a> - or in other words: That's not possible.<br/> The Webserver will only receive the IP of the connection the Client used to receiv...
Why is it only displaying one result <p>This program is supposed to accept in valid candidates for voting, add the names typed in a text box to a list box. In the list box the user may double click on the candidate they choose. After the tally button is clicked a list box displaying the candidates' Names and votes will...
<p>Try this:</p> <p>Assuming the index of the <em>Candidate</em> and his/her <em>Vote</em> are the same:</p> <pre><code> Private Sub btnTally_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnTally.Click lstTallies.Visible = True lblTally.Visible = True For i = 0 To lstCandidates.Items.Count...
how to add an ordered score table with names <pre><code>import random number_correct = 0 def scorer(): global number_correct if attempt == answer: print("Correct.") number_correct = number_correct + 1 else: print('Incorrect. The correct answer is ' + str(answer)) name = input("Ent...
<p>I would recommend storing the names and scores as a csv, then you could read the names with the scores and then sort with the score as a key.</p> <pre><code>with open("scores.txt", "a") as file: file.write("%s, %s\n" % (name, number_correct)) with open("scores.txt", "r") as file: data = [line.split(", ") fo...
Run script with timeout and redirected output and then do something with output <p>I am trying to save analyze the output of a script that might not terminate. In order to do so I redirect the output to a file and run the script together with timeout follows by my analyze command, cat in this case.</p> <pre><code>time...
<p>The problem turnes out to be the exit code.</p> <p>Timeout return 124 as exit code while the &amp;&amp; composition only evaluates the second argument when the exit code of the first was 0</p> <p>solution:</p> <pre><code>timeout 24h php phpscript.php &gt; script.out || cat script.out </code></pre>
How can I create a list with button click and then loop through them with C# wpf? <p>I have a C# WPF application that has a form with two fields. Every time the form is submitted, I want to get the values and use the Instructor class to add the new item to a list. Then, I want to loop through the list and display the...
<p>Try replacing this line:</p> <pre><code>lvInstructorList.Items.Add("{0} {1}", inst.firstName, inst.lastName); </code></pre> <p>with this one</p> <pre><code>lvInstructorList.Items.Add(new Instructor { firstName = inst.firstName, lastName = inst.lastName }); </code></pre> <p>It is similar to how you added to the...
how to send push notifications to iphone using fcm(firebase console) in PHP? <p>While sending the notification from firebase console Notification is working fine. </p> <p><a href="http://i.stack.imgur.com/K7b0w.png" rel="nofollow"><img src="http://i.stack.imgur.com/K7b0w.png" alt="firebase console"></a></p> <p>I am g...
<p>Seems to return a success. Maybe check your app registration code to see whether the token has changed for the phone. Sometimes a new token will be generated.</p>
Wikimedia template doesn't rendered as expected? <p>I just installed wikimedia on my server, and found out that the templates don't rendered as expected.</p> <p>For example, <code>{{In use}}</code></p> <p>In <a href="https://en.wikipedia.org/wiki/Template:In_use" rel="nofollow">this page</a>, <code>{{In use}}</code> ...
<p>Templates are not built in. You have to import the templates from another wiki, e.g. <a href="http://templates.wikia.com/wiki/Wikia_Templates" rel="nofollow">Wikia Templates</a> (less obfuscated than from Wikipedia), or <a href="https://www.mediawiki.org/wiki/Help:Templates" rel="nofollow">write them yourself</a>. Y...
A different tax rate for one WooCommerce product <p>I want to change the Tax rate from 20% to 9% just for an product. So for example for the product "X" I need to have 9% VAT tax. </p> <p>I am using WooCommerce PDF Invoices &amp; Packing Slips plugin, and I would like to get this new rate on the Pdf invoice too.</p> ...
<p>In WooCommerce > Settings > Tax > Reduce rate rates, create an entry with a rate of 9%:</p> <p><a href="http://i.stack.imgur.com/037jX.png" rel="nofollow"><img src="http://i.stack.imgur.com/037jX.png" alt="enter image description here"></a></p> <p>Save.</p> <p>Then in Products > Edit your selected product, and se...
Using Regular Expression in find in Eclipse <p>I want to find calls to a specific method with digits in a <code>String</code> argument.</p> <p>Example of method call:</p> <pre><code>foo("123"); </code></pre> <p>I have tried the following Regular Expression but it doesn't work:</p> <pre><code>foo*\d{1,} </code></pre...
<p>Note that <code>foo.*\d{1,}</code> (equal to <code>foo.*\d+</code> and <code>foo.*\d</code> in the end) can also match <code>foo1</code> string because it matches <code>foo</code>, then 0+ chars other than a newline as many as possible up to the last digit (<code>\d</code>).</p> <p>If your method calls only have 1 ...
Cplex gives the solution status = 6, that means my prob don't have obtimal solution? <p>I have run my solution on Cplex and got the result below. It ran many iterations with star (*) character at last. I have printed the solution status = 6. Does that mean my problem can not reach optimal and the variables I got can no...
<p>Yes, it means that a solution is possible, but not optimal</p> <p><a href="http://eaton.math.rpi.edu/cplex90html/overviewcplex/statuscodes.html" rel="nofollow">reference 1</a></p> <p>I suggest you try a different algorithm, by default, the LP is set for either Automatic or Primal Simplex, maybe changing the algori...
xlrd named range example? <p>I have an excel spreadsheet that I am trying to parse with <strong>xlrd</strong>. The spreadsheet itself makes extensive use of named ranges. </p> <p>If I use:</p> <pre><code>for name in book.name_map: print(name) </code></pre> <p>I can see all of the names are there. </p> <p>Howe...
<p>I think that the naming support in XLRD is broken for XLSM files but I found an answer by switching to openpyxl. This has a function get_named_ranges() which contains all of the named ranges. The support after that is a bit thin so I wrote my own class to turn the named ranges in my spreadsheet into a class where ...
Intent ACTION_OPEN_DOCUMENT not filltering for RTF <p>I am setting up a file picker intent but its not filtering for RFT files.</p> <pre><code>private void openFilePicker(){ Intent fileIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT); fileIntent.addCategory(Intent.CATEGORY_OPENABLE); fileIntent.setType("*/...
<p>The list of mime types is missing <code>text/rtf</code> including this allows rtf files to be filtered for.</p>
How to map different actions to Web API methods that would have same signature <p>I am trying to create a REST service using Web Api best practices and I came to a situation I don't know how to handle. </p> <p>Imagine I have groups and inside of each group I have users.</p> <p>This is how my GroupController looks lik...
<p>Don't mix <code>MapHttpRoute()</code> style routing configuration and attribute-based routing. It's simpler to use one or the other (I prefer attribute-based as it's explicit and allows for clearer class method names).</p> <p>You also seem to not be calling the method necessary to enable attribute-based routing on ...
Cannot access values of explicitly defined array in php <p>I am fetching an object from the database, and I 'converted' it to array so that I can use foreach on it.</p> <pre><code>$my_obj = (array) json_decode( get_option('my_options') ); </code></pre> <p>This gets me array like this when I do a <code>print_r</code> ...
<ol> <li><code>json_decode</code> converts json to array so need to explicitly define array. </li> <li><p>For fetching an stdclass object you can pull data by <code>$object-&gt;key</code>in your case <code>$my_obj[0]-&gt;settings</code> or you can convert object as array from following code</p> <pre><code>foreach ($ob...
How to read data from specific buffer with glreadpixels based on GLES30 on Android <p>As I understood, from GLES30 there is no more <code>gl_FragColor</code> buffer (I saw it <a href="https://www.khronos.org/files/opengles3-quick-reference-card.pdf">HERE</a>)</p> <p>Since I can't read a "Special Variables ", how can I...
<p>Your shader code is totally irrelevant to what <code>glReadPixels</code> reads, and it has nothing to do with special variable names. It reads from the currently bound read framebuffer; i.e. <code>glReadPixels</code> in ES 3.0 works in exactly the same way as it used to work in ES 2.0. </p> <p>The only exception is...
ARM Neon: Store n-th position(s) of non-zero byte(s) in a 8-byte vector lane <p>I want to convert a Neon 64-bit vector lane to get the n-th position(s) of non-zero (aka. 0xFF) 8-bit value(s), and then fill the rest of the vector with zeros. Here are some examples:</p> <pre><code> 0 1 2 3 4 5 6 7 d0: 00 FF 0...
<p>This turns out to be not at all simple.</p> <p>The naïve efficient approach starts with trivially getting the indices (just load a static vector of <code>0 1 2 3 4 5 6 7</code> and <code>vand</code> it with the bitmask). However, in order to then collect them at one end of the output vector - in different lanes to...
Create Visual Studio project from existing Umbraco Website <p>So this is my problem: </p> <p>I currently have an existing Umbraco Website, <strong>v7.2.1</strong>, not installed with Visual Studio, so there is <em>no solution</em> file. I want to migrate this site to the typical Umbraco solution, so I can run it loca...
<p>It depends on how much customization has been done, I think?</p> <p>I would probably install UmbracoCms -version 7.2.1 (not "just" Core) from Nuget into a fresh solution, build it and then point the connection string to the existing database (if not an .sdf file already). Then you'll (hopefully) only have to copy o...
AspNet Core Consuming WebService (VS2015) <p>In my AspNet Core project I need to consume a SOAP/WSDL WebService. I am using VS2015 and have made a non-aspnet core project to test the webservice (went fine), but with AspNet Core, I cannot seem to find a way to make this happen. It looks like SOAP webservice isn't suppor...
<p>Find this similar question. I have not implemented/verified/tested it but hopefully yo can find some guidance. The sample is using the prior version of AspNet Core (AspNet 5)</p> <p><a href="http://stackoverflow.com/questions/28413756/asp-net-5-add-wcf-service-reference/28440491#28440491">ASP.NET 5 add WCF service ...
Swift - cellForItemAtIndexPath unwrapping an Optional value when resizing image <p>i need resize dynamically an imagView when scroll a collection view in swift...</p> <p>i use this function for get event of scrolling:</p> <pre><code> func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath inde...
<p>You could use safer code like below to avoid crashes while unwrapping an Optional value.</p> <pre><code>func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell { // get a reference to our storyboard cell let cell = collectionVi...
How to terminate Database connections created using dynamic JDBC credentials? <p>I followed the below article to create dynamic JDBC connection.</p> <p><a href="http://www.oracle.com/technetwork/developer-tools/jdev/dynamicjdbchowto-101755.html" rel="nofollow">How to support dynamic JDBC credentials</a></p> <p>I was ...
<p>In ADF, you do not manage the db connection directly. The Application Module manages the connection to be used by referring to a DB Connection pool JNDI name that is provided by the Application Server. </p> <p>Since it is expensive to create a db conn, the App server, WebLogic for example, maintains a set of db con...
fetching documents based on nested subdoc array value <p>I'm trying to get all documents in a collection based on a subdocument array values. This is my data structure in the collection i'm seeking:</p> <pre><code>{ _id: ObjectId('...'), name: "my event", members: [ { _id: ObjectId(...
<p>So after a long search in stackoverflow i came across the good answare here:</p> <p><a href="http://stackoverflow.com/questions/16198429/mongodb-how-to-find-out-if-an-array-field-contains-an-element">MongoDB: How to find out if an array field contains an element?</a></p> <p>my query changed to the following which ...
Wordpress: Doctype tag getting wrapped in php tags <p>At the top of my header.php file I have:</p> <pre><code>&lt;?php /** * @package WordPress * @subpackage Options Framework Theme */ $post_type = get_post_type(); $is_single = is_single(); global $header_image_url; ?&gt; &lt;!DOCTYPE html&gt; </code></pre> <p>Ho...
<p>I managed to fix the problem. In my shortcodes.php file I had removed everything leaving <code>&lt;?php</code> only, seemed that I needed a closing tag to make it <code>&lt;?php ?&gt;</code></p>
Maven: Get repository URL of a dependency <p>I want do display the URL to a JAR that was deployed to our maven repo at the end of my build job. (Basically the "link" where the dependency - the JAR - can be downloaded from the repository server)</p> <p>So how to display the remote repository URL of a dependency on comm...
<p>I suggest you to compose the URL from the parameters in the very pom. Example:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt; &lt;version&gt;1.8&lt;/version&gt; &lt...
href javascript: generated by visual force page not working in firefox and IE <p>First: I know you should not use href javascript: to put javascript o a link. It is bad practise and all I can find on the forums is don't use it and questions regarding this are rejected. But I am not generating the html. It is salesforce...
<p>I finally cracked it (and see more or less where it is coming from) so here is for anyone encountering a similar issue what seem to be the key factors. The is in an iframe. And the target is _top. I know this is a strange combinbination, but the original url was a simple link that needed the top target. It is only...
chart.js fixed bar width issue <p>I am using Chart.js as my charting library. I have created horizontalBar chart.</p> <p>I need to set the width of individual bar in the chart.</p> <p>I did not found anything specific in chartjs documentation but while looking at source code I found the option <code>barThickness</cod...
<p>The <code>barThickness</code> property is a fixed width, as you noticed in your issue.</p> <p>However, you have an other property called <code>barPercentage</code> which is a multiplier of the max width of your bars.<br> You should set <code>berPercentage</code> to a value (<em>let's say <code>0.95</code></em>) and...
CPU Consumption of apache spark process <p>I have a system with 6 physical cores and each core has 8 hardware threads resulting in 48 virtual cores. Following are the setting in configuration files.</p> <p><strong>spark-env.sh</strong></p> <p>export SPARK_WORKER_CORES=1</p> <p><strong>spark-defaults.conf</strong></p...
<p>As the per the information you provided, it looks like you are setting the information in spark-defaults.conf file only.</p> <p>In order to apply this configuration in your spark application, you have to configure these three properties in <strong><code>SparkConf</code></strong> object of code while creating the sp...
Report Builder optional and obligatory parameters <p>I have a problem with my report from a live query. In my report i have 5 parameters that allow to pick a date range <code>@DateFrom</code> and <code>@DateTo</code> and 3 parameters which should allow to select specific attributes:</p> <pre><code>@salesid, @batch, @s...
<p>You need to change your final 3 <code>or</code> statements to <code>and</code> statements.</p> <p>At the moment, your query is essentially checking for data items that match your criteria <strong><em>OR</em></strong> that any of those final three parameters is matched/null. This means that even if you data isn't t...
Finding a sub string and deleting it using regex, python <p>I have a data set which looks like thus,</p> <pre><code>"See the new #Gucci 5th Ave NY windows customized by @troubleandrew for the debut of the #GucciGhost collection." "Before the #GucciGhost collection debuts tomorrow, read about the artist @troubleandrew"...
<p>You can use regex</p> <pre><code>import re a = [ "See the new #Gucci 5th Ave NY windows customized by @troubleandrew for the debut of the #GucciGhost collection.", "Before the #GucciGhost collection debuts tomorrow, read about the artist @troubleandrew" ] pat = re.compile(r"@\S+") # \S+ all non-space characters f...
Tomcat, The requested resource is not available <p>i have some troubles with tomcat. I have simple REST-Service with Jersey/Tomcat. But my Get-Ressource could not be find and Post probably too.</p> <p>My Code:</p> <pre><code>@Path("/NothificationListner") public class NothificationListner { @GET @Consumes(M...
<p>You're supposed to list the packages where your resource classes are here</p> <pre><code>&lt;init-param&gt; &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt; &lt;param-value&gt;jersey&lt;/param-value&gt; &lt;/init-param&gt; </code></pre> <p>I don't know what <code>jersey</code> is...
google captcha: Captcha Field is not rendered after reset <p>I'm using the google captcha as described at <a href="https://developers.google.com/recaptcha/docs/display#auto_render" rel="nofollow">https://developers.google.com/recaptcha/docs/display#auto_render</a>. I have a form which is being sent over ajax.After clic...
<p>You need to pass a widget id to render again</p> <pre><code>var widgetId = grecaptcha.render(container); grecaptcha.reset(widgetId); </code></pre>
Why is standalone rendered differently than inline SVG in multiple browsers? <p>This arrow renders just fine when you save it as <code>arrow.html</code> and open it in a modern browser. (Edge, Firefox, Chrome).</p> <pre class="lang-xml prettyprint-override"><code>&lt;!DOCTYPE html&gt; &lt;svg width="490" height="3...
<p>standalone SVG is XML based which is case sensitive. </p> <p>HTML is not case sensitive and when you embed SVG in HTML the HTML parser tries to fix up any case sensitivity issues for you.</p> <p>You have the marker refX and refY attributes entirely in lower case which is invalid and causes them to be ignored in a ...
Mobile first Server 8 queries <p>I new new Mobile first platform and websphere application server(WAS)</p> <p>I installed mobile first server (MobileFirst-8.0.0.0)on my system and I am assuming the mobile first runs on WAS</p> <p>I am having following queries. </p> <ol> <li><p>How to deploy .war file in mobile first...
<p>Before all, you <strong>should google</strong>.</p> <blockquote> <p>How to deploy .war file in mobile first server 8 as it's console which is run 9080 port doesn't have option to deploy war file as it only have option to deploy adapter ?</p> </blockquote> <p>In v8.0 you no longer need to deploy .war files to...
windows 10 - UWP - drop down button <p>I'm trying to have a <strong>'drop down button'</strong>.</p> <p>I don't know if the is the good naming, but I need to have :</p> <p><a href="http://i.stack.imgur.com/PkWp5.png" rel="nofollow"><img src="http://i.stack.imgur.com/PkWp5.png" alt="enter image description here"></a><...
<p>It's not exactly what is on your mock, but what about MenuFlyout? It's almost the same and you don't need any magic for that. Plus it feels native for UWP users:</p> <pre><code>&lt;StackPanel&gt; &lt;Button Content="Button 1"&gt; &lt;Button.Flyout&gt; &lt;MenuFlyout&gt; &lt;M...
Java - Escape quotes in style attribute <p>In a Java application I have HTML, as a String, that looks like this:</p> <pre><code>&lt;DIV STYLE=&amp;quot;font-family:&amp;quot;Times New Roman&amp;quot;&amp;quot;&gt; </code></pre> <p>And I wish to decode the encoded quotes so that it is correctly displayed on the page. ...
<p>If it is defined in your java code</p> <p>you may try to add <code>\</code> before <code>"</code></p> <p>I assume you are expecting something like this right?</p> <pre><code>String randomHtmlCode = " &lt;DIV STYLE='font-family:\"Times New Roman\"'&gt; "; </code></pre>
Why does Android N throw TransactionTooLargeException when using Bundles? <p>On Android N whenever I pass some binary or large data in bundle I get a <code>TransactionTooLargeException</code>, however it runs without issues on android M and below.</p> <p>How can I solve this?</p>
<p>There has been a behavior change in Android N</p> <p>Quoting <a href="https://developer.android.com/about/versions/nougat/android-7.0-changes.html#other">the docs</a>:</p> <blockquote> <p>Many platform APIs have now started checking for large payloads being sent across <code>Binder</code> transactions, and the...
How to use logical operations in Outlook rules <p>I get loads of emails to "ABC" email-group which I am a member of. How do I create a rule in Outlook which will mark all these emails read except those which are TO or CC directly to me?</p> <p>So it should be like: If (TO "ABC group") AND ( NOT ( (TO "me") OR (CC "me"...
<p>I found the answer:</p> <p>Create rule using Rules Wizard. In Conditions step chose: Sent to "ABC" In Actions step chose: Mark as read In Exceptions step chose: With my name in TO or CC</p> <p>This will create rule for all emails sent to "ABC" with exception when my email is in TO or CC fields.</p>
MS SQL Query to find Name by joining over several tables <p>Project Table</p> <pre><code>Project ShortDescription Description DB_ID ProjektKMPoolStartDatum ProjektKMPoolEndeDatum </code></pre> <p>ProjectManager</p> <pre><code> DB_ID ProjektID KontaktID </code></pre> <p>Contact</p> <pre><code>Benutzeraccount EMa...
<pre><code>SELECT Description FROM Project INNER JOIN DB_ID on Project.DB_ID = DB_ID.ProjektID WHERE KontaktID=@KontaktID </code></pre> <p>assuming you have a variable <code>@KontaktID</code> or simply fill in the id there (I adapted the join according to your sample data)</p>
GenericForeignKey and on_delete=models.PROTECT <p><strong>Django 1.10</strong></p> <p>Say, I have an instance of Frame and two comments for it. Key moment: on_delete=models.PROTECT in the Comment model.</p> <p>In the shell: </p> <pre><code>Comment.objects.all() &lt;QuerySet [&lt;Comment: Some comment.&gt;, &lt;Com...
<p>You are passing <code>on_delete=models.PROTECT</code> to the foreign key to <code>ContentType</code>. This will only have an effect when you delete the content type, not when you delete the comment. </p> <p>The <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/contenttypes/#reverse-generic-relations" rel=...
Cloud Endpoints Extensible Service Proxy not honouring security definition <p>We are using the ESP inside the container engine (not as part of appengine). We have deployed the following swagger file:</p> <pre><code>security: - oauth_our_oauth: - default_auth # This section requires all requests to any path to req...
<p>The OAuth definition should be referenced in x-security section. </p> <pre><code>x-security: - oauth_our_oauth: audiences: # This must match the "aud" field in the JWT. You can add multiple # audiences to accept JWTs from multiple clients. - "echo.endpoints.sample.google.com" </code></pre>...
How to unpack variables from tuple and give them names from another tuple? <p>I have two tuples - one with the keys and another one with a collection of variables of different types (list, float64, int and array) generate with the help of the following formula from a dictionary:</p> <pre><code>keys, values = zip(*[(ke...
<p>If it's really not possible to store your key/value pairs in a <code>dict</code> and serialise them to data file in that format, you can use <a href="https://docs.python.org/3/library/functions.html#exec" rel="nofollow"><code>exec</code></a> to dynamically construct assignment statements</p> <pre><code>&gt;&gt;&gt;...
Groovy - working with big numbers <p>I just started to learn Groovy and I'm trying to run a for loop with a limit of a very large number(600851475143 to be exact). Every loop I print the current number.</p> <p>The problem is after I execute the code, the GroovyConsole and some programs that run in my computer get stuc...
<p>Instead of running in the Groovy Console, try running from a command-line:</p> <pre><code>$ groovy -e ' BigInteger num = 600851475143 def max = 0 for(BigInteger i = 1; i &lt; num; i++) { println i; } println "Largest Prime: $max"' </code></pre> <p>Now, however, you have another problem. Suppose you are able t...
How to set up filter options for search results in semantic html <p>does anyone have experience setting up semantically meaningful filter option alongside search results? I mean something like:</p> <pre><code>&lt;ol&gt; &lt;li&gt; &lt;label for=""&gt;&lt;input type="checkbox" name="filter-by-name" value="pete"&gt...
<p>As they are form controls, to be semantic they would need to use the correct markup.</p> <p>Based on the <strong>Grouping Controls</strong> section on <a href="https://www.w3.org/WAI/tutorials/forms/grouping/#checkboxes" rel="nofollow">w3.org</a></p> <pre><code>&lt;fieldset&gt; &lt;legend&gt;I want to receive&...
SignalR Web API send message to current user <p>I have web app project and an angular 2 project. I would like use SignalR to send message from the server. Then I found this <a href="https://blog.sstorie.com/integrating-angular2-and-signalr-part-1/" rel="nofollow">article</a> about implementing it. But I don't know how...
<p>The IHubContext object your are using has multiple methods, one of which is <code>Clients</code>, of type <a href="https://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.hubs.ihubconnectioncontext(v=vs.118).aspx" rel="nofollow">IHubConnectionContext</a>.</p> <p>In there you have <code>Groups</code>, <cod...
WMI query to select disk containing system volume <p>I need to get some information (model and serial) of the disk that contains the system volume (usually C:). I'm using this query:</p> <pre><code>SELECT * FROM Win32_DiskDrive WHERE Index=0 </code></pre> <p>My question is, is the disk with Index=0 always the disk co...
<p>As stated, add an extra query to get the index of the disk containing the boot partition:</p> <pre><code>{diskIndex} = SELECT * FROM Win32_DiskPartition WHERE BootPartition=True SELECT * FROM Win32_DiskDrive WHERE Index={diskIndex} </code></pre> <p>Unfortunatly WMI doesn't seem to support JOINs, which would have m...
Getting an sqlite error when migrating after heroku deployment <p>So I deployed my app to Heroku and installed gem 'pg' and removed sqlite. Now getting this error when I migrate locally or on Heroku</p> <pre><code>Gem::LoadError: Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` ...
<p>Add <code>"sqlite3"</code> in development and <code>"pg"</code> in <code>production</code></p> <pre><code>group :development, :test do gem 'sqlite3' end group :production do gem 'pg' end </code></pre>
Data type change in division SQL Server <p>When I run the below query in sql server 2014, the output datatype seems to be different from the input data type</p> <pre><code>DECLARE @i DECIMAL(18,2) = 2 ,@j DECIMAL(18,2) = 8 SELECT (@i/@j) </code></pre> <p>Expected Output is : 0.25 <br> But what I'm getting is : 0.250...
<p>Try with the below query. </p> <pre><code>DECLARE @i DECIMAL(18,2) = 2 ,@j DECIMAL(18,2) = 8 SELECT CAST((@i/@j) as decimal(18,2)) </code></pre>
Remove white Space on right side in Dygraphs <p>I'm developing a chart without legend or axis. In this chart I'm also drawing via the 2d context and the underlayCallback option. </p> <p>The Problem I can not resolve is a mysterious white space on the right side of the chart (about 5px).</p> <p><img src="http://i.imgu...
<p>Check out the <a href="http://dygraphs.com/options.html#rightGap" rel="nofollow"><code>rightGap</code></a> option. Your estimate of "about" 5px looks to be spot-on!</p> <blockquote> <p><strong>rightGap</strong></p> <p>Number of pixels to leave blank at the right edge of the Dygraph. This makes it easier to...
Add Jquery to simple PHP calendar <p>The idea is to load the calendar without refreshing the page. What am i doing wrong? it showing a blank page </p> <p>External file: Calendar.php </p> <pre><code>&lt;?php $year = (isset($_POST['year'])) ? $_POST['year'] : date("Y"); $week = (isset($_POST['week'])) ? $_POST['week'] ...
<p>Ok this is not really an answer, but i think you Need to understand this:</p> <p>Your PHP only generates the HTML for one week. So if you want to Change the week with JS you will have to generate the HTML for the new Weeks in JS. Then you can just do all the work in JS.</p> <p>Another way would be to generate more...
How to call function method inside ajax success function? <p>How to call pagePresets.setFilter() inside <code>$.ajax(){success}</code> method?</p> <p><code>self.setFilter.call('network', data.networks);</code> returns</p> <blockquote> <p>Uncaught TypeError: Cannot read property 'call' of undefined(…)</p> </blockq...
<p>The <code>call</code> function takes as first argument a "context object". Take a deeper look at the call function <a href="https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Function/call" rel="nofollow">here</a>.</p> <p>In the ajax callback function <code>this</code> or <code>self</code...
Using Shiny to insert records into a MYSQL DB <p>I wish to write back to a mysql database based on a shiny app. This code with some modifications come from the excellent <a href="http://shiny.rstudio.com/articles/persistent-data-storage.html" rel="nofollow">1</a>. I added a portion to give me the insertion timestamp of...
<p>The reason why it didn't work is because of the difference between the date formats of <code>Sys.time()</code> and MySQL <code>date</code> or <code>datetime</code> types.</p> <pre><code>&gt; Sys.time() ###[1] "2016-09-23 11:30:36 CEST" ###MySQL datetime: "2016-09-23 11:30:36" </code></pre> <p>After converting to M...