python3 singleton pattern with "with" statement
Vote count: 0 I want to write a class with singleton patte to provide some persistent data storage using pickle/dict: @singleton class Pdata: def __init__(self): self.cache = None self.dirty = False try: with open("data.pck","rb") as fp: self.cache = pickle.load(fp) except FileNotFoundError: pass ex...
how to make to scroll on mouse position div only?
Vote count: 0 i want to prevent scrolling other DIV of scrolling DIV. <div id="body"> <div class="long"> <div class="half-height" style="background-color:blue"></div> <div class="half-height" style="background-color:yellow"></div> </div> <div id="left-side" class="side"> <div class="long"> <div clas...
Aligning text link beside image link
Vote count: 0 I want to change from------------| IMAGE |------------TEXT To ------------| IMAGE | TEXT------------ is there any way i can align the text in [a] beside the image? my codes are as follow: < a href="link.html" >< img src="image.png"> text< /a > can anyone enlighten me on this? asked 5 s...
Should arriving GCM messages be displayed by Android?
Vote count: 0 The problem is that my GCM message arrives at my app but is not (automatically) displayed on screen. 07-06 21:33:11.525 11269-11269/com.example.myapp D/ActivityThread: BDC-Calling onReceive: intent=Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x10000010 pkg=com.example.myapp...
How to create a Stacked area chart with mpandroidchart
Vote count: 0 I've been looking for a way to create a Stacked Area chart with MPAndroidChart such as the one available with NVD3 I successfully managed to create a Line chart and tried to add several lines and filled the area, but the values can't be stacked. I don't want to use the Stacked Bar char...
How to Properly Format RetroFit Header for Django
Vote count: 0 I am trying to send an HTTP request using Django that includes a use ame and password in the header in order to retrieve a token. On my computer terminal I do the following command and it works properly: http POST 127.0.0.1:8000/api-token-auth/ use ame='admin' password='whatever' I am ...
Solving Bezier curve
Vote count: 0 I am writing a code for a motion controller for cameras, the bezier curve equation is used to make the motion smooth. As my math abilities are not so strong, i used the code found on this "stackoverflow" answer Interpolating values between interval, interpolation as per Bezier curve , ...
Enhanced FrogRiverN
Vote count: 0 I'm working some programming exercises. This one has been quite well known and answered in different places. FrogRiverOne Find the earliest time when a frog can jump to the other side of a river. https://codility.com/programmers/task/frog_river_one/ My question is, what if the Frog can...
Adding values to an array, sum or subtract depending on input
Vote count: 0 I have to create a new input text every time the user enters an integer and those integers should be add it to an array which at the end the program must sum or subtract depending on the values. For example, if the array is like this: [1, 5, 10] the final result is: 16 but if the array...
c++ how to partially add a chararray to vector
Vote count: 1 what is the best way to do code below: vector<char> content; char MESSAGE[1024]; SUCCESSFUL = recv(sock_CONNECTION, MESSAGE, 1024, NULL); for (int i = 0; i < SUCCESSFUL; i++) content.push_back(MESSAGE[i]); i just found something like: content.get_allocator = MESSAGE; has no error, but ...
tag not styling
Vote count: 0 I want to style text on my website inside a <pre> tag but it will never work. I have tried putting this in my CSS: pre { font-family: Georgia; } And I have also tried putting it inline like this: <pre style=”font-family: Georgia;”> But none of these work, the font stays as monospace. T...
Double Hop Delegation: Error retrieving for user IIS APPPOOL. The underlying provider failed on Open. Login failed for user 'DomainWebVM$'
Vote count: 0 Double Hop Delegation: Error retrieving for user IIS APPPOOL. The underlying provider failed on Open. Login failed for user 'DomainWebVM$'. I'm setting up a IIS VM server to access a separate SQL Server VM, both machines ru ing Windows Server 2016 and ru ing on intranet. We're using wi...
CUDA kernel error : Illegal memory access was encountered
Vote count: 0 I have a global function in which I am passing a 1D array of lengths, int *d_arrayOfLengths. In the ke el, I am calculating a variable "cellNo" and want to use this "cellNo" as an index for above array. Whenever I try to get the value of "d_arrayOfLengths[cellNo]", program shows an err...
uibCollapse nested in an directive element won't work,
Vote count: 0 When I click my-dir, collapsed elements won't expand. I have set size in css for .btn class to ensure actually click event. // index.html <body ng-controller="ctrl"> <p>{{hello}}</p> <div class="btn" my-dir></div> </body> // app.js var app = angular.module('app', ['ui.bootstrap']); app...
Making a button into a changing image
Vote count: 0 I'm trying to mimic a project I found on codepen: http://codepen.io/ChynoDeluxe/pen/pJxOQE/ At this point I can create the list items and delete them, but I want to tu the delete button into an image that will increase in opacity when hovered over. However I can't figure out how to mak...
How to conserve menu when creating an Intent
Vote count: 0 I am very new to Java / Android programing. Android Studio offered me a layout that consists in a menu like such: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkableBehavior="single"> <item android:id="@+id/n...