title stringlengths 13 150 | body stringlengths 749 64.2k | label int64 0 3 | token_count int64 1.02k 28.5k |
|---|---|---|---|
C++ sockets sending structures | <p>I can send/receive data over sockets using a char array but can't figure out a way to send structures . I found a lot of articles but they are to hard to understand .. As far as I know we have to use a function called snprintf to make packets of data and then some other to revive it . Please I am looking for a very ... | 2 | 1,123 |
How to properly inject dependencies with the built in Funq container? | <p>I have a cached repository </p>
<pre><code>public interface IRepository
{
void LogWebUsage(string html);
IEnumerable<ApiKey> GetApiKeys();
ApiKey GetApiKey(Guid key);
}
public class Repository : IRepository
{
private static readonly ILog Log = LogManager.GetLogger("API.Repository");
pub... | 2 | 1,516 |
Oracle SQL Repeated words in the String | <p>I need your suggestions/inputs on of the following task. I have the following table:</p>
<pre><code>ID ID_NAME
------ ---------------------------------
1 TOM HANKS TOM JR
2 PETER PATROL PETER JOHN PETER
3 SAM LIVING ... | 2 | 1,115 |
ThreeJS, Updating mesh.geometry at runtime | <p>Considering a scene and 3 <code>BoxBufferGeometries</code>, I don't want to re-render the scene (<code>drawObjects</code> is called once, the 'first' time), but rather update it (<code>updateScene</code> is called on user action for example), the following code sucessfully updates the color and texture material attr... | 2 | 1,116 |
Request.getPart is called without multipart jsp | <blockquote>
<p>java.lang.IllegalStateException: Request.getPart is called without multipart configuration. Either add a @MultipartConfig to the servlet, or a multipart-config element to web.xml</p>
</blockquote>
<p>I am getting this error above when i try to add image to my project</p>
<p>MY html is </p>
<pre><co... | 2 | 1,088 |
Android: Theme.resolveAttribute returns 0 cause Resources$NotFoundException: Resource ID #0x0 | <p><strong>Short Question:</strong> <code>Resources.Theme.resolveAttibute(attrId, typVal, true)</code> returns <code>typVal.resourceId</code> is <strong>0</strong>, cause that exception. This <code>ResourceReader.getResourceId()</code> works well in all places of whole app. But randomly, app update or after several res... | 2 | 1,899 |
Usage of NHibernate Interceptor(s) on Projections | <p>I have this situation:</p>
<p>I'm using Nhibernate to map an Entity '<strong>User</strong>' that is mapped on a large table in Sql, for perfomance reasons I've created a lightweight entity '<strong>LightweightUser</strong>' that has only a small set of properties and is <strong>NOT</strong> mapped in a hbm file or ... | 2 | 1,056 |
Use Iframe to embed csv and allow user to search from it | <p>I have a simple html/jscript code here which allow users to enter a keyword and return result from sample csv data (simulated as var CSV in this code) to table format in HTML, now I wish to use the iframe where the CSV is embedded instead of referring my DB to this simulated CSV, how can I do that?
This code is work... | 2 | 1,239 |
cmake precompiled header in shared library | <p>I'm trying to precompile my headers using gcc and cmake.</p>
<p>I know some scripts like cotire or customPCH do it, but I would like to write my own script.</p>
<p>The project is pretty simple : there is a shared library with some files, and a main calling functions defined in those files.
I have manages to build ... | 2 | 2,061 |
centered nav with flexible left and right widths - percentage padding does not work | <p><strong>UPDATE:</strong> Simplified HTML & CSS as per one of the answers below. The problem is still occurring however.</p>
<p>I have a working nav that is something like this:</p>
<pre><code> item11item2item3 Centered item4item5item6
</code></pre>
<p>I want to add padding between the it... | 2 | 1,534 |
application crashes when I use a broadcast reciever | <p>I wanted to start a service from a Broadcast reciever which takes "android.intent.action.BOOT_COMPLETED". When I write click on the Application in eclipse and launch it It runs well. But when I launch it from emulator on which it has already been installed, the application crashes. The following are the source codes... | 2 | 1,026 |
App crashes when starting service in onClick method | <p>I am a newbie to android and I got a weird problem...</p>
<p>I am trying to modify the WifiDirectDemo provided by Google, more specifically, the demo offers us the freedom to choose a image I want to transfer but I just want it to transfer a specific image. The original code is as follows:</p>
<pre><code>public cl... | 2 | 3,475 |
Fast way to compute cosine similarity w/o memory error on large data sets | <p>I need to compute cosine similarity on a scipy.sparse.csr.csr_matrix. With the most straightforward sklearn implementation I'm running into memory errors with larger matrix shapes. And even for smaller shapes the performance is not great and CPU load doesn't really exceed 25%. So I'd like to make this faster and sta... | 2 | 3,022 |
Understanding assembly of a simple C program | <p>I am trying to understand the assembly of this simple C program.</p>
<pre><code>#include<stdio.h>
#include<unistd.h>
#include<fcntl.h>
#include<string.h>
void foobar(char *a){
char c = a[0];
}
int main(){
int fd = open("file.txt", O_RDONLY);
char buf1[100]="\0";
char buf[... | 2 | 1,611 |
Pass Google Script Array to Javascript Function (Google Apps) | <p>I understand why my code does not work, however I can't find a solution searching online. Likely a simple syntax correction. Here is the code:</p>
<h2>Code.gs</h2>
<pre><code>function doGet() {
return HtmlService
.createTemplateFromFile('Index')
.evaluate()
.setSandboxMode(HtmlService.SandboxMode.IFRAME);... | 2 | 1,094 |
Deserialize Google Directions JSON | <p>First time working with JSON and related, I'm trying to get distance/duration of all possible routes from this request: <a href="https://maps.googleapis.com/maps/api/directions/json?origin=41.2091585,-8.5763016&destination=41.258913,-8.636942&mode=driving&alternatives=true&avoid=tolls&language=pt... | 2 | 1,170 |
jqTransform Select - Scroll to letter typed | <p>I've got a form that uses jqTransform to replace the standard select boxes and radio buttons. It all works fine and dandy, except one thing that annoys me:</p>
<p>Since it replaces the select box with a list of links, when you type a letter to scroll it doesn't do anything. For instance, you click to open up the ... | 2 | 2,121 |
Static files loading in production but not development | <p>Usually I have this issue exactly the other way around!</p>
<p>In my development environment my Django app will not load some of my static files, specifically ones that I have added myself: that is, the two packages I've added to my app (<code>admin</code> and <code>ckeditor</code>) are both loading up fine, but tw... | 2 | 1,168 |
Parse error, unexpected STRING_LITERAL, expecting PIPE or ROW VHDL | <p>I am trying to implement 32x32 Register File in VHDL. I have been struggling with this issue for a while... More specifically, I get the following error when I try to compile the code: </p>
<p>HDLParsers:164 - "//vmware-host/shared folders/Shared from MAIN/decoder.vhd" Line 26. parse error, unexpected STRING_LITERA... | 2 | 7,714 |
How to use <windows.h> on Ubuntu | <p>I have a C++ project that uses <code><windows.h></code> on windows. Now I need to run the program on Ubuntu. But I don't know how to make changes to the following codes that are related to the <code><windows.h></code>. For example, what are the equivalent of these functions on Ubuntu:</p>
<ol>
<li>GetStd... | 2 | 1,137 |
Logstash does not read Logfile | <p>I try to send a varnish-Access-Log provided by my admin as a .log file via Logstash to my Graylog2 instances. I am doing so with a lot of nginx log files, so i am wondering where I am stuck. Probably you can help me a bit further.</p>
<p>I have tested everything twice with the grok debugger and everything is coming... | 2 | 7,206 |
Fresh init React Native Build has CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler error on Xcode 12 | <p>Recently, Apple released Xcode to version <strong>12</strong>, and after update from <strong>11.7</strong> to <strong>12.0.1</strong> all of the React Native applications cannot build on a simulator, even a fresh initialized React Native project on a simulator with an earlier version of iOS, actually, I build it on ... | 2 | 10,878 |
-[__NSCFDictionary objectAtIndex:]: | <p>HELP! I have been pulling my hair out with this problem for 1 hour now.</p>
<p>I am creating an Array in my .h file</p>
<pre><code> @interface LeftMenuViewController : UIViewController <UITableViewDataSource, UITabBarControllerDelegate>
@property (strong, nonatomic) MKNetworkOperation *myNetworkOperation... | 2 | 1,193 |
Crystal Reports error "Invalid object format name." for field objects | <p>I'm making a dynamic report using Crystal Reports and .NET C#. The content of the report is not fully known until run-time.
The report template only contains Formula Fields and a connection to the database table.
At runtime I collect the wanted data collection, create a new reportDocument object and set the collect... | 2 | 1,311 |
CoreData Sort By NSDate not work? | <p>In Code:</p>
<pre><code>- (NSFetchedResultsController *)getFetchedResultsController {
if (_fetchedResultsController != nil) {
return _fetchedResultsController;
}
[NSFetchedResultsController deleteCacheWithName:@"LatestNews"];
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[requ... | 2 | 1,677 |
Scrolling fixed header not showing on mobile device | <p>I have a fixed header that changes to a sticky header on scroll using JS. </p>
<p>The dropdown menu works when in mobile view showing on Google Dev Tools and Firefox Responsive Design Mode, however it doesnt work on actual mobile devices. </p>
<p>I've tried changing the Z-index and webkit-backface-visibility.</p>
... | 2 | 1,413 |
Multiple PHP Web Servers to Share a Single Redis Server for User Sessions | <p>I have 2 web servers running PHP and Nginx... And I have 1 Redis Server. I want the web servers to use the Redis database for user login data. This will allow me to scale out the web servers without forcing logged-in users to re-authenticate if/when they hit a new server.</p>
<p>Both PHP/Nginx servers are using Red... | 2 | 1,586 |
Database connection error while celery worker remains idle for 24 hours | <p>I have a django based web application where I am using Kafka to process some orders. Now I use Celery Workers to assign a Kafka Consumer to each topics. Each Kafka Consumer is assigned to a Kafka topic in the form of a Kafka tasks. However after a day or so, when I am submitting a task I am getting the following err... | 2 | 1,368 |
How do I remove empty cells in table view? iOS Swift | <p>My table view currently looks like this:</p>
<p><a href="https://i.stack.imgur.com/xaT3p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xaT3p.png" alt="Contact Table View"></a></p>
<p>Note: I have blurred out actually names.</p>
<p>I import a json file and retrive names from it. The names app... | 2 | 1,657 |
Ag-Grid, React, Redux Filters Issue - can not set setFilterModel() | <p>Here is my scenario,
I am making a <code>onFetchEvents</code> Redux Action call and getting all events and passing it as follows. <code>rowData={this.props.events.data}</code></p>
<p>Everything works fine. Now I need to apply a filter, and this requires another call to the server.</p>
<p>I set <code>enableServerSi... | 2 | 3,832 |
Segmentation Fault in Function Call | <p>So I've got my program to the point where it compiles, but upon calling up the other functions the program drops with a Segmentation Fault(core dumped) error.
Everything works until then. I'll add the entire code in case the setup is wrong (possible as I don't particularly understand pointers or passing values and s... | 2 | 1,335 |
Django: How to create a Group through a command? | <p>I want to automate all the data creation on my data base, for this I'm using different commands.</p>
<p>I know how to do this for my models, because I know its fields. </p>
<p><strong>But how to do this for Group model?</strong></p>
<pre><code>from django.contrib.auth.models import Group
</code></pre>
<p>When I ... | 2 | 1,230 |
Docker nginx cannot reverse proxy within default network | <p>I'm having problems with nginx reverse proxying as a docker container. My question is about how to correctly proxy pass nginx in a default docker network?</p>
<p>Here's my docker-compose.yml (unnecessary details omitted for brevity)</p>
<pre><code> version: '3'
networks:
nginx_default:
exte... | 2 | 1,684 |
Error : NullInjectorError: No provider for CompilerFactory! when I try to run 2 angular elements in the same page | <p>I have two projects (2 widgets) , when I use these widgets individually it works fine but I want to use them in the same page so i follow this tutoriel : <a href="https://myview.rahulnivi.net/running-multiple-angular-elements-page/" rel="nofollow noreferrer">https://myview.rahulnivi.net/running-multiple-angular-elem... | 2 | 2,247 |
Error: Inflating class com.google.android.material.textfield.TextInputLayout | <p>I am getting the error, here is my XML file</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent&... | 2 | 10,420 |
How to Asynchronously load UITableViewcell images so that scrolling doesn't lag | <p>I've tried using <a href="https://github.com/nicklockwood/AsyncImageView" rel="nofollow">ASyncImageView</a> for this purpose, but I'm a bit confused as to how I'd implement it for my specific case. I currently have a <code>MatchCenterViewController</code> that contains a table inside of it. It's loading the images f... | 2 | 2,897 |
CPU usage less than a threshold and more than one node present - Prometheus | <p>I am trying to create a alert rule in prometheus so that it fires an alert when the avg CPU usage of all nodes with label agentpool="worker" for last 3 mins has been below 30%.</p>
<p>Right now, I am able to get alert for ANY node with CPU usage less than 30% for last 3 mins using</p>
<pre><code>- alert: NodeCPUUt... | 2 | 1,051 |
Can't get Coverity Scan to work (Java/Kotlin/Gradle 3.3 on Windows and Travis) | <p><strong>UPDATE: See the solution in Caleb's answer</strong></p>
<p>I am trying really hard to make Coverity work for my build, but so far with little success.</p>
<p>First the details:</p>
<ul>
<li>My project is run of the mill java library (no web or fancy containers), very few compile-only dependencies, built u... | 2 | 1,235 |
Detect focused widget in flutter listview | <p>I have an horizontal listview.builder widget, each child in the list is about 90℅ of the total width, how can I detect which widget is in focus. </p>
<p>This is my the widget.</p>
<pre><code>new ListView.builder(
scrollDirection: Axis.horizontal,
itemCoun... | 2 | 1,479 |
Databinding with Django channels in custom command | <p>I start work with Django channels. I need bind data of my model Device. I do it. When I change Device object in admin interface I get message about changing on client (web browser) but I also run simple WebsocketServer by means of custom django management command. And when Device-object has been changed in custom co... | 2 | 2,068 |
UIButton unrecognized selector sent to instance when using code in new ViewController | <p>I've started building a very simple app which has two screens. The first has two UIbuttons. One button plays a random sound using the code below in my first view controller (ViewController.swift) and the other button modally presents a second screen.</p>
<p>On the second screen there are also two UIbuttons one to p... | 2 | 1,810 |
Youtube login using c# | <p>I want to login youtube using c#. I am using HttpWebRequest.
Procedure I am following:</p>
<ol>
<li>load the login page using GET and parse GALX value</li>
<li>POST username/password along with GALX</li>
<li>get a meta refresh page, parse the url and load using GET</li>
<li>in every step cookies are handled using C... | 2 | 2,451 |
PowerBI - Select last non-blank value of a Measure based on most recent Date | <p>I have the following table in PowerBI :</p>
<pre><code>FullDate Visits Orders ConversionRate
01/02/2020 00:00:00 100 20 0,20
01/02/2020 01:00:00 550 78 0,14
01/02/2020 02:00:00 652 60 0,09
01/02/2020 03:00:00 0 0 ... | 2 | 1,246 |
Loading TensorFlow1 checkpoint in TensorFlow2 - "Function Call Stack: keras_scratch_graph" | <p>I want to load a checkpoint from TensorFlow1 that consists of <code>.index</code>, <code>.meta</code>, <code>.data-00000-of-00001</code> files into <code>tensorflow2.0.0</code> and convert it to a keras model so to be able to use it natively in eager mode without need for <code>tf.Session</code>. Here is the code I ... | 2 | 2,289 |
Django: error at / bad character in group name | <p>I was following Apress - Practical Django Project by James Bennet and I got this nasty error out of the blue. Could you help me?</p>
<p>Here it goes:</p>
<pre><code>Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.2.5
Python Version: 2.5.4
Installed Applications:
['django.co... | 2 | 1,514 |
Child component does not update when parent state changes | <p>I have a situation where I am passing props from parent to child component. The parent is connected to the redux store and, from the child (using bindActionCreators), I dispatch some action to change the state in the store which the parent is connected to. Now, when I change the state in the store from the child, th... | 2 | 1,061 |
The site cannot be reached in Apache Tomcat WebServer | <p>I have downloaded eclipse and tomcat. I tried to create a server in Eclipse. I do not have any project at this point.</p>
<p>It starts, It's HTTP port number is 8080.</p>
<p>But when I try to access it from browser. It does not work . It says the site cannot be reached.</p>
<p>I tried to access through
localhost:... | 2 | 10,425 |
Unable to resolve Static method? | <p>I'm new to android and heard about <em>retrofit</em>. But when I tried to implement this, I'm getting this error:</p>
<pre><code>11-07 10:57:59.969 8036-8291/com.example.first.servicefirst W/dalvikvm﹕ VFY: unable to find class referenced in signature (Ljava/nio/file/Path;)
11-07 10:57:59.969 8036-8291/com... | 2 | 4,395 |
uninitialized constant Spree::User::DestroyWithOrdersError | <p>I am a new to working with Spree and basically did the following: </p>
<p>git cloned the git hub repo and created a new project. I then looked in the core folder and took all the files I needed. The reason why I did this is purely because I wish to customise Spree and make some changes. I did a bundle install and t... | 2 | 3,250 |
Debugging a NotificationEvent in Kernel Debug (Windows) | <p>I'm debugging a process which is like frozen:</p>
<ul>
<li>I suspect the root cause is the thread below <code>THREAD 877f4030 Cid 0568.0fb8</code> that is stuck on the user-mode call to <code>GetOverlappedResult</code>.</li>
</ul>
<p>I have opened the dump with <code>kd.exe</code>.</p>
<p>Namely, I'm interested ... | 2 | 2,050 |
Spring-amqp- newer call listener | <p>Sorry I'am new in the <code>amqp</code> world. I try write simple app:</p>
<pre><code>public class HelloApp {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
final TestSender bean = context.getBean(TestSender.class);
bean.s... | 2 | 1,213 |
Airflow Can't Connect to SFTP with SSH Private Key | <p>I am trying to use the SFTP Operator/Hook with a SSH private key instead of a password.</p>
<p>My connection has the following extra arguments: <code>{"key_file": "/home/airflow/key_files/some_key", "no_host_key_check": "true"}</code>. My SSH Private key looks like the followi... | 2 | 1,682 |
React - "setState" is not a function | <p>I have a view which shows a table with rows of data from a local wamp database. Each row has a View, Edit and Delete button which allows a user to View, Edit and Delete records respectively.
<a href="https://i.stack.imgur.com/q1X5s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q1X5s.png" alt="en... | 2 | 5,616 |
C# Displaying text box (present in the list view) value in a message box (wpf) | <p>I have a list view in which each row contains 5 entries. The list box looks like this:</p>
<p><a href="https://i.stack.imgur.com/73SS7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/73SS7.png" alt="!["></a></p>
<p>I need to store (display) the name of variable and the value present in "Physical... | 2 | 2,279 |
XPath expression using idref | <p>I am reading about and testing XQuery and like test tools I use BaseX(www.basex.org) and saxon-HE 9.4.0.6N.
For the following simple XML file - no schema attached to the sample.xml: </p>
<pre><code> <rootab>
<l1>
<items p="a">
<itema x1="10" id="abc">testa</itema&... | 2 | 1,054 |
How to display percentage with 2 decimals in PieChart? | <p>I use Jasper Report 5.2 and I want generate PieChart and display percentage with 2 decimals.</p>
<p>I create the jrxml with one piechart and the datasource is filled with parameter piechart type List.</p>
<p><strong>The jrxml is:</strong></p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<jasperRepor... | 2 | 13,131 |
mvc3 datatables plugin and json | <p>I am trying to use the </p>
<ul>
<li>datatables plugin,</li>
<li>mvc3 framework and </li>
<li>entity framework</li>
</ul>
<p>for some reason it didn't render well
the result of this code is an output of the data on the browser like that </p>
<blockquote>
<p>[{"ServiceId":"8e651711-c837-4012-99f5-496549308b9... | 2 | 2,887 |
java.lang.ClassNotFoundException error for upgrading spring boot to 2.6.6 from 2.2.5_release | <p>I have a spring boot application and would like to upgrade to 2.6.6
it can be built but when trying to run , getting error:</p>
<pre><code> Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/core/metrics/ApplicationStartup
at org.springframework.boot.SpringApplication.<... | 2 | 9,754 |
Using ActiveRecord models from Rails app in a Sinatra app produces multiple warnings | <p>We are using Sinatra to provide HTTP API access to our service, while most of the user-facing functionality uses Rails 2.3.8. Both the Sinatra and the Rails application share the same ActiveRecord models, defined in the RAILS_ROOT/app/models directory.</p>
<p>In an setup script for the Sinatra application, all of t... | 2 | 1,218 |
heroku - postgres - operator does not exist | <p>I decided to give heroku a try (to save time) but I discovered they use PostgreSQL which I know little about. The <a href="https://github.com/alexreisner/geocoder" rel="nofollow">geocoder</a> gem works great with MySQL but PostgreSQL is throwing an error.</p>
<p>I think this error is saying lat is not defined?</p>... | 2 | 1,241 |
Method is returning 'System.Threading.Tasks.Task`1[System.Threading.Tasks.VoidTaskResult]' instead of the result | <p>I think it's an asynchronous task being left off at </p>
<pre><code>GraphServiceClient graphClient = new GraphServiceClient("https://graph.microsoft.com/v1.0", new DelegateAuthenticationProvider(async (requestMessage) =>
{
requestMessage.Headers.Authorization = new AuthenticationHeade... | 2 | 1,039 |
Check if there is a path that connects 2 vertices in C++ | <p>I'm trying to write a code for checking a path exists from vertex <code>v1</code> to <code>v2</code> in a given graph.
It <strong>works for certain test cases and gives runtime error (time limit exceeded) for others</strong>.</p>
<pre><code>bool HasPath(int V, int** edges, int* visited, int v1, int v2)
{
if (e... | 2 | 1,175 |
Nested dynamically generated forms using jQuery | <p>I am creating a survey generator. I want to be able to add multiple choice answers to dynamically generated forms. As seen in the image below.</p>
<p><img src="https://i.stack.imgur.com/4XgO2.jpg" alt="enter image description here"></p>
<p>Currently, adding questions and removing them works perfectly. The problem ... | 2 | 2,127 |
HTML fixed header is changing position when page is refreshed | <p>I am working on this HTML code which has a fixed header. It works just fine until I refresh the page, it gets down to the current section. I tried many ways but could not figure out the problem. Does anyone have a solution for this?</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-c... | 2 | 1,043 |
Bootstrap Admin Panel Radio Button Hide and Show | <p>Here is the link to the admin panel i am using, bootstrap themed
<a href="https://almsaeedstudio.com/themes/AdminLTE/index.html" rel="nofollow noreferrer">https://almsaeedstudio.com/themes/AdminLTE/index.html</a></p>
<p>I am trying to add a radio button that hides and shows a <code>div</code> holding some drop down... | 2 | 3,405 |
MEF can't find module's views when dll in subdirectory | <p>I try to make a little application with Prism and MEF in order to learn how it works. I'm stuck on a fairly frustrating problem.
I would like to have a "Modules" subdirectory in my base app directory where I copy all the module's dll as a post build event.
These modules are MVVM app with View and ViewModel.</p>
<p... | 2 | 2,582 |
Creating JavaScript object from MySQL DATABASE (ie multiple tables) | <p>Sorry to add another JavaScript object to the mix. I'm just having a little trouble wrapping my head around this as it is a little more complex than i have ever dealt with.</p>
<p>Like the title states, i'm trying to create a JavaScript Object or perhaps a multidimensional array of a MySQL Database. For testing pur... | 2 | 3,209 |
custom loss function in Keras with masking array as input | <p>I am trying to train an Autoencoder with a custom loss function shown below. The input, missing_matrix, is an n x m array of 1s and 0s corresponding to the n x m features array. I need to do an element by element multiplication of the missing_array with y_pred, which should be a reconstruction of the input features... | 2 | 1,198 |
Grunt pre-compile inline markdown | <p>I've been on the hunt for a method of pre-compiling inline markdown with grunt. I chose markdown because, I'm dealing with lots of plain text with simple formatting, but I would not be completely opposed to JSON (or similar).</p>
<p>Here is an example: what I'm looking for:</p>
<pre><code><body>
<div... | 2 | 1,354 |
Crash in relation to in-app purchasing | <p>I have an app just launched on the market which employs in-app purchasing which was cobbled together from other people's example code which I barely understand. The code does appear to work most of the time, but I have one device on which it crashes every time. It appears to crash within some "generated java files" ... | 2 | 1,831 |
How do I enable compression for WCF when using simple TCP? | <p>I am using WCF to transmit information between two identical copies of a program on separate computers, with the approach demonstrated on a single computer in the code below. I know that .NET 4.5 <a href="https://msdn.microsoft.com/en-us/library/aa751889(v=vs.110).aspx" rel="nofollow noreferrer">supports compressio... | 2 | 1,082 |
How can I add shard at mongodb cluster? | <p>I have setting-up mongodb 3.2 cluster as below configuration on my debian machines</p>
<pre><code># Config Server - mongod.conf
storage:
dbPath: /data/mongodb
journal:
enabled: true
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
net:
port: 27019
bindIp: 0.0.0.0
... | 2 | 1,099 |
WPF Error: Could not create an instance of type... when creating custom control | <p>I am trying to create a custom Tag Cloud control. The way it's supposed to work is that the user can give it a collection of strings in the itemsSource and the converted string will be displayed in the UI. The problem is when I try to drop the control into an application I get the following error:"Could not create a... | 2 | 1,423 |
How to solve unexpected token exception in Spring mvc and hibernate? | <p>My application is a Spring MVC and hibernate based one. In the below hql statement I'm mapping the resultset to the custom class named 'Result'. Here is my HQL statement, </p>
<pre><code> String hql=
"select new com.gavs.beans.Result(distinct(d.dept_name) as dept_name,distinct(c.college_nam... | 2 | 2,760 |
Close overlay on page refresh/revisit | <p>I have the following HTML, CSS, and Javascript:</p>
<pre><code><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
function getTarget(event){
target = (typeof window.event === "undefined")?event.target:w... | 2 | 1,398 |
Use IP and host with Jsoup | <p>I would like to access a webpage using ip and host, in order to save DNS lookup times by having stored values for domains. If via sockets, it'd be done by using sockets, transmitting a GET request of the following syntax:</p>
<pre><code>Socket s = new Socket([string_ip_address], 80);
</code></pre>
<p>Then transmit... | 2 | 1,106 |
youtube api does not fire ENDED event when video ends (using iframe) | <p>I'm trying to catch an event so that when a youtube player ends, I can then redirect to another web page. but it does not work. Can anyone spot anything wrong? The javascript does seem to compile OK.</p>
<p>Here's the code of the entire page (I actually pasted it from the view-source page of the browser below.<b... | 2 | 1,113 |
What should I teach a beginning Perl programmer? | <p>I am going to spend 30 minutes teaching Perl to an experienced programmer. The best way to learn Perl is by writing code. In addition to CPAN, what would you show a programmer so they would understand the expressiveness of Perl, the amount of functionality provided by CPAN, while keeping everything clean and tidy ... | 2 | 2,098 |
DecoderInitializationException occurs while implementing Drm Dash media source | <p>While implementing Drm Dash media source following exception occurs. MediaCodecRenderer$DecoderInitializationException: Decoder init failed: OMX.Exynos.avc.dec.secure</p>
<p><em><strong>Error report is listed below</strong></em></p>
<p>ExoPlayerImplInternal: Renderer error: index=0, type=video, format=Format(p0va0br... | 2 | 1,762 |
Spring mocked junit tests throw NullPointerException with spring-security 3.2.0.RC1 version | <p>I have got a junit test which performs a request using Spring MockMvc.</p>
<pre><code>private MockMvc mvc;
@Before
public void setUp() {
mvc = MockMvcBuilders.standaloneSetup(new LoginController())
.addFilter(new AnonymousAuthenticationFilter("anonymous"))
.addFilter(new SecurityContext... | 2 | 1,492 |
Recycleview RecyclerView: No adapter attached; skipping layout | <p>I have a recycle demo,but when I running the demo,is always show the error message"Recycleview RecyclerView: No adapter attached; skipping layout"</p>
<p>This is my main Activity class</p>
<pre><code>public class MainActivity extends BaseActivity{
// private ListView mListView;
private ArrayList<Note> note... | 2 | 3,330 |
react-native app freezes temporarily without activity in performance debugger | <p>This is hard to debug because there is no activity in the chrome performance debugger when this freeze happens. A ScrollView still scrolls so it's not Android that's lagging. On the other hand, the Perf Monitor still shows 60fps for JS and it does not freeze.</p>
<p>Perhaps it's something with asynchronous code not... | 2 | 1,290 |
System cannot find the file specify in jsf2.0 | <p>I have using jsf2.0 in eclipse ide.I have a problem to store a image in local folder.The images are stored in local folder with 0 bytes.The images are read and write into 0 bytes.</p>
<p>Backing Bean:</p>
<p>public class uploadImageAction {</p>
<pre><code>public void handleFileUpload(FileUploadEvent event) throws... | 2 | 1,647 |
How to deploy Nextjs/Laravel project with nginx? | <p>I am using Laravel-8 framework as Restful API server, and Nextjs as client render. I created two folders:</p>
<p>/var/www/domain/backend (Laravel 8 app)</p>
<p>/var/www/domain/frontend (Nextjs app)</p>
<p>To run nextjs app I am using pm2. (npm run build then pm2 start). I have two nginx configuration files:</p>
<p>/... | 2 | 1,051 |
lock wait timeout exceeded try restarting transaction | <p>I must say that I am fairly new to backend development and mysql programming as well. I just started learning how to develop backend using Node.js. To operate with mysql I am using Sequelize. When I call an api listed below I get an error - <strong>lock wait timeout exceeded try restarting transaction</strong> and t... | 2 | 5,440 |
java.lang.NoSuchMethodError: cucumber.api.CucumberOptions.snippets while running Cucumber Tests with Karate Dependencies | <p>I have run into an issue where I am trying to create Karate Tests in my Cucumber Project.</p>
<p>Here is how my Pom file looks:</p>
<pre><code> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
... | 2 | 5,232 |
Chrome-extension undefined response from background to popup | <p>I'm currently trying to write a Chrome extension that notifies me about DOM changes on the target page.
The content script uses a a long lived connection to send a message to the background page if the element changes. <code>Console.log</code> displays the content of the message and everything seems to be fine.
But ... | 2 | 1,269 |
Postgres discrepency in trigger execution speed? | <p>I have a trigger that executes a function on table insert or update. It looks like this:</p>
<pre><code>CREATE OR REPLACE FUNCTION func_fk_location_area()
RETURNS "trigger" AS $$
BEGIN
IF EXISTS (
-- there was a row valid in area when location started
SELECT * FROM location
WHERE NOT EX... | 2 | 2,042 |
Calling web service and getting null for response object | <p>I am working with a 3rd party web service which is written in Java/Axis. I have not worked much with WCF so I am trying to feel my way through this. I was able to generate the class from the wsdl and using Fiddler I am able to see the call being made to the service, and a response being returned. But in my code, ... | 2 | 8,242 |
TypeError when creating a new MatTable with Angular Material 2 | <p>I'm creating a table using <code>mat-table</code> (from <code>MatTableModule</code>) but I'm getting the following error:</p>
<pre><code>ERROR TypeError: Cannot read property 'addClass' of undefined
at MatHeaderCell.CdkHeaderCell (table.es5.js:275)
at new MatHeaderCell (table.es5.js:132)
at createClass (core.... | 2 | 1,433 |
Rewrite rule with time conditions in .htaccess | <p>This is my first post on stackoverflow, as usually I managed to find an answer in the existing discussions, this time I did not :-)</p>
<p>I need to create temporary url redirections based on day/time conditions for a few of my site pages. My site is hosted on OVH (Apache 2.4, mutualized) and I used Wordpress as CM... | 2 | 1,190 |
How to create request scoped web service port? | <p>I have Spring MVC based web application that calls web service. Web service requires http based authentication for every call.I hold web Service Proxy configuration in applicationContext.xml:</p>
<pre><code><beans...
<bean id="paymentWebService"
class="org.springframework.remoting.jaxws.JaxWsPortProxyF... | 2 | 1,629 |
Job with Kubernetes Pod Operator fail while running with kubernetes Executor | <p>I am currently using kubernetes executor with Airflow and all the operators in airflow are working correctly but All the dags scheduled in airflow containing kubernetes pod operator are failing.No logs are being displayed on airflow UI. I can only find Following error logs on the scheduler pod.</p>
<pre><code>[2019... | 2 | 2,171 |
django rest framework problems with passing the header | <p>I'm trying to pass the token to the backend but I'm having some issues.</p>
<p>when I'm writing this in the cmd:</p>
<pre><code>curl -H "Authorization: Token 3c9c6079602737a04fcb6b2e737804142ef93930e4e705c0598b2fc597759f7f" http://127.0.0.1:8000/api/auth/user/
</code></pre>
<p>I get the user like I wante... | 2 | 1,181 |
ContentPresenter not updating display correctly | <p>In my program's main window I have a <code>TreeView</code> and a <code>ContentPresenter</code>. The display of the <code>ContentPresenter</code> is determined by what node is selected in the <code>TreeView</code>. </p>
<p>The name of one of my nodes is allowed to be changed by the user via <code>contentMenu</code>.... | 2 | 1,157 |
Angular 4 - reference to 'this' in observable subscription appears to refer to old data | <p>I have an <code>EditItems</code> component that's use for editing <code>items</code>. Inside the <code>ngOnInit()</code>, I subscribe to an observable that's in my <code>dataService</code> (a central Angular service for handling all of my data calls).</p>
<p>When the observable's data changes, my <code>subscribe</c... | 2 | 1,231 |
LibGDX on Netbeans and Android | <p>I am trying to run my application that uses LibGDX on Andriod using the NetBeans IDE.
However the game crashes for some reason, I just got the "This application have stopped to work" message when I try to run the application. Everything works great on PC, so apparently I have missed something in the andriod set up. ... | 2 | 1,326 |
"The remote name could not be resolved" when running an Azure DevOps self-hosted build agent in Service Fabric | <p>I can successfully start a self-hosted agent on my Windows 10 machine following this article:</p>
<p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#windows" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-dev... | 2 | 3,334 |
zeromq: TypeError: string indices must be integers, not str | <p>I want to establish publish subscribe communication between to machines.</p>
<p>The two machines, that I have, are <code>ryu-primary</code> and <code>ryu-secondary</code></p>
<p>The steps I follow in each of the machines are as follows.</p>
<p>In the initializer for <code>ryu-primary</code> (IP address is 192.168... | 2 | 1,303 |
Issue importing CSV file with Logstash | <p>I have a CSV file, and I want to import it in my Elastic Search.</p>
<p>I am on Windows 10 and I also have a Kibana be able to browse data once imported. I use Logstash to try to make this import. </p>
<p><strong>All of my services (Kibana, ES and Logstash) are running on my localhost.</strong></p>
<p>I tried wit... | 2 | 1,081 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.