mark mark

14447 questions
1

votes
3

answer
3.6k

views

const reference and creating copy

(Newbie learning c++ with existing codebase) Consider the following snippet: class Filter { ... public: Filter(); int addFilter(gFilter &filterDesc); … }; class gFilter { public: …. inline const RangeOfUInt& getProto() const { return proto; } private: … RangeOfUInt proto; … }; typedef s...
Mark
1

votes
2

answer
2.4k

views

Golang MySQL Database Not Selected

I'm using github.com/go-sql-driver/mysql package to connect to MySQL. It works well except when I select a database (USE), I can't run queries against it. package main import ( "database/sql" "fmt" "log" ) import _ "github.com/go-sql-driver/mysql" func main() { dsn := "root:@/" db, err := sql.Open("...
Mark
1

votes
1

answer
2.7k

views

Kendo UI DropDownList - Html Helper (Razor) - Hardcode list options

I'm setting up a project with Kendo Ui for the first time, and I'm trying to create Kendo UI dropdown lists, but am getting: ArgumentNullException was unhandled by user code. --Value cannot be null. My code is: @(Html.Kendo().DropDownList() .DataTextField("Text") .DataValueField("Value") .BindTo(new...
Mark
0

votes
1

answer
23

views

Android Studio - Firebase. Making sure the user has verified there email

I am trying to make a firebase log in. However I have been struggling trying to find out how to make sure everything is verified before the user is signing into the app. This is what I have yet i cant find the right order to verify the users email before signing in. Any ideas? If you can help me tha...
Mark Woods
1

votes
2

answer
1.5k

views

Show/hide point label Androidplot

When my chart gets a lot of data the point labels overlap each other and as a result I want to give the user an option to turn them off by clicking a button but I can't find anything in the documentation on how to do this. Below is how I setup the point labels when the chart is created. BarFormatter...
Mark
1

votes
2

answer
70

views

why the `img right` collapse?

JSFiddle. img Left Text Center img Right .content { width: 100%; height: 80px; border:1px solid #333; } .center { width: 400px; margin:0 auto; text-align: center; } .left { float: left; } .right { float: right; } I used float to layout the page. the left and the center element perform well. But the...
Todd Mark
1

votes
1

answer
980

views

Autodesk Maya api - import geometry

Hi I am trying to create an API in Maya to load a custom file format then read in data to create vertices. My overall goal is to create vertices from data in a file then convert to polygons. Any help would be appreciated. Mark
Mark Moonie Griffiths
1

votes
2

answer
345

views

Rails where clause for :through association

I have the following associations... class Event < ActiveRecord::Base ... has_many :tags, :through => :taggings This allows me to do something like Event.last.tags and see all tags associated with an email. I'm trying to come up with a where clause for tags where I can do something like... Event.whe...
Mark Locklear
0

votes
0

answer
3

views

syslog-ng set custom variables in file destination

For example: destination foo { file("/var/log/remote/$foo/$HOST/$HOST.log") create-dirs(yes) dir-owner("user") dir-group("user") dir-perm(0750)); }; Where $foo is a custom variable and can be set/modified in one or more log statements.
Mark
1

votes
5

answer
12.5k

views

Move div onclick and back onclick

I have a jQuery code that moves a certain div element on right as I click it, i'd like to move it back to its original position when I click back on it. $(document).ready(function() { $("#wel1").click(function() { $("#sidemenu").animate({left: "80px"}); }); }); Give me a simple example of how to...
Mark
1

votes
1

answer
241

views

Rounding a float to an int in haskell

Problem 3 of Project Euler says: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143? I made a lazy list of primes, then I do a takeWhile they are less than the square root of 600851475143, and test each prime to see if it is a factor. primes :...
Mark Karavan
1

votes
3

answer
880

views

How to test if array has empty value in it?

I have an array that I want to test for empty elements, I have tried using array_walk to walk an array (a single dimension array) and return true if the array of elements (values) has got any empty elements. I naturally went to the PHP website, looked at the examples on offer and they don't make an...
Mark Giblin
0

votes
0

answer
29

views

JDBC is corrupting special characters from My

I have a MySql 5.7.20 database table called deliveries with a column called message which is of type blob. I want this to be able to support special characters like emojis. I can insert and view a row with an emoji: I know want to read this out with java. My code is: public class JavaMysqlSelectExa...
Mark
0

votes
2

answer
22

views

To summarize difference from present row to the previous

Calculating the difference from present row to the previous, I have a simple data set and codes below: import pandas as pd data = {'Month' : [1,2,3,4,5,6,7,8,9,10,11,12], 'Rainfall': [112,118,132,129,121,135,148,148,136,119,104,118]} df = pd.DataFrame(data) Rainfall = df["Rainfall"] df['Changes'] =...
Mark K
1

votes
1

answer
2.2k

views

Kendo Validate - Ignore Specific Inputs

I am using Kendo validation to do some light front end validation. I am using an external API, that does the back end validation for me, so I only need to validate a few inputs for format/required. Currently, it is validating every input. How can I specify elements to ignore. I realize I can specify...
Mark
5

votes
2

answer
745

views

KB4486563 broke Internet Explorer URLs

Our product runs exclusively in Internet Explore -- yes I know -- I know ... The problem is that when the code was written the html looks like this Since this update we are now getting access denied in the vbscript/javascript code that tries to access the DOM -- or just the images not displaying at...
Mark Summers
11

votes
1

answer
132

views

How to save/read inline images in html content to internal/extrenal memory

According to this question I used a custom ImageGatter class to display images that I'm getting from a server in TextView using Picasso public class PicassoImageGetter implements Html.ImageGetter { private TextView textView = null; Context mContext; public PicassoImageGetter() { } public PicassoImag...
Mark DeSpain
1

votes
1

answer
1.3k

views

Why is WinHttpHandler causing “Unable to load DLL 'api-ms-win-core-localization-l1-2-0.dll'” on production server?

We've started using the WinHttpHandler NuGet package in an ASP.NET application. On the development machines it's working fine, and also works on our staging environment. The application targets .NET 4.6.1. However, on production it throws the following error: System.DllNotFoundException: Unable to l...
Mark Vincze
1

votes
1

answer
436

views

How to chain SignalProducers passing along the results

Given functions multiply() and convert() (minimal examples of the concept, I'm actually planning to query a remote server inside each function), what is a shorter way to implement multiplyAndConvert()? // call two async functions passing the result the from the first // as the argument to the secon...
Mark Lilback
1

votes
4

answer
2.3k

views

Set Background image width 100% height auto

I have a banner section as such: .bannerImage { width: 100%; height: auto; } So instead of using background image, I am using an image with width 100% and height auto. Now I want to add a banner title over the banner section. So, since it is not possible to achieve the effect with just image, I a...
Mark Wilson
1

votes
1

answer
548

views

Javascript CustomEvent Detail is Null upon Firing?

Well I've made some progress since the last question a couple of days ago, but am still quite new at Javascript and Three.js, and am running into this new issue. I'm attempting to pass some three.js geometry loaded from an OBJ file as the detail associated with a custom event, so that I can process...
1

votes
2

answer
75

views

How to check TLS certificate expiration date with Clojure?

Normally I check a server's certificate expiration using the openssl command, but I'm learning Clojure and would really like to figure out how to do this without calling a shell command if possible. How would I replicate this functionality? $ openssl s_client -connect google.com:443 < /dev/null ^ /d...
Mark C
1

votes
1

answer
28

views

Draw Shape Based on Cell Values

All, I have code that creates a shape based on based on inputted values in the macro itself. I am wanting to have the values of shape type, width, and height specified by the user (location of shape on the sheet is indifferent to me right now). The user would input the aforementioned numerical val...
Mark
5

votes
0

answer
53

views

How to bundle AsciiDoctor gems in a Cocoa app

My app I have a Mac app that uses AsciiDoctor under the hood to generate PDF and ePUB files. I use the Process class (formerly NSTask) to run the AsciiDoctor commands. What I want I want people to be able to use my app without having to manually install the AsciiDoctor Ruby gems from the Terminal. C...
Mark Szymczyk
0

votes
0

answer
4

views

Error in gtkText() : could not find function “gtkText”

I installed R 3.4.4 version for Windows. I'm studying RGtk package but I can't to execute the instruction gtkText() Obviously, I installed the package: install.packages("RGtk2", depen = T, type = "source") library(RGtk2) After the command textx
Mark
0

votes
3

answer
32

views

AJAX on Button Click runs incrementally

I've implemented a simple AJAX call that is bound to a button. On click, the call takes input from an and forwards the value to a FLASK server using getJSON. Using the supplied value (a URL), a request is sent to a website and the html of a website is sent back. The issue is the AJAX call seems to...
mark barton
1

votes
1

answer
1.3k

views

How to divide div into 5 equal pieces using % width in CSS

I want to divide my div "tile-container" with the width of 100% into 5 equal pieces. I thought that creating 5 divs inside with the width of 25% would solve the problem but it didn't. Container seems to be to small. Here is my code: And stylsheet.css file: .tile-container{ position: relative; border...
Mark
1

votes
1

answer
417

views

Mongoose Default Date

Is there a specific setting you need to setup in order for mongoose to have this below Model working? // The Model let theModelSchema = new Schema({ created_on: { // type: Date, // Either Date or Number type: Number, default: Date.now(), // have also tried Date.now }, }) let TheModel = mongo...
Mark Owuya
0

votes
2

answer
23

views

waiting for fetch results in javascript

I'm calling fetch a lot so I'm trying to make it a reusable function. async function getXML(url) { const result = await fetch(url); const xml = await result.text().then(( str ) => { return new DOMParser().parseFromString(str, 'application/xml'); }); log(xml); //logs fine } I call it from var xml = g...
Mark
1

votes
1

answer
351

views

Jest tests broken after implementing detox

I'd like to be able to run my detox tests and my Jest unit tests separately. For example, run detox tests with detox build && detox test, and my Jest unit tests with npm test. After implementing detox (using mocha as the test runner), running npm test results in immediate error, and looks like its t...
Mark Newton
0

votes
2

answer
109

views

How to use impersonation to access a network resource from IIS?

I have a WebApi app that needs to access a network share on a different machine and open Crystal Reports files. I'm using LogonUser and WindowsIdentity.Impersonate to impersonate a user that has rights to the network share using this code (not complete): SafeTokenHandle safeTokenHandle; const int LO...
Ivan-Mark Debono
1

votes
1

answer
51

views

modifying font size with javascript on responsive website

I am making a responsive page with bootstrap. In the middle of the screen i have a text: enter shop The page is using bootstrap, so the p is inside a div that has a certain size. I made a script that creates an effect that the p gets bigger and smaller. The p has the size 7rem and it goes from 7 to...
Mark Witt
1

votes
1

answer
38

views

Why don't array types have Add() method although they implement IList<T>?

Array types such as int[] implement many interfaces, and IList is one of them. IList requires to implement the Add(T) method (because IList inherits from ICollection). I am writing a "CircularArray" class which contains an array in itself, but doesn't have any index out of range exceptions because o...
1

votes
2

answer
1.5k

views

Putting a WPF UserControl on the TaskPane of an Excel2007 Addin

I am making a Excel Addin in VS2010. The following code work fines if I make a winforms usercontrol private void ThisAddIn_Startup(object sender, System.EventArgs e) { var testControlView1 = new UserControl1(); var MyCustomPane = this.CustomTaskPanes.Add(testControlView, "Hello"); } Howe...
Mark Pearl
1

votes
1

answer
8

views

Ignore join if method argument is blank

I have the following method: def self.sap_qualified(start_at, stop_at, zip) course_ids = Course.where('sap_qualifying IS true OR sap_renewing IS true').collect{|c| c.id} if course_ids.any? course_class_ids = CourseClass.where(course_id: course_ids).collect{|c| c.id} if course_class_ids.any? joins(:c...
Mark Locklear
-1

votes
1

answer
25

views

How do I use variable inside a parentheses and single quotes?

Using Python 2.7 I am trying to put a variable inside a (' ') Orignial string r = search.query('Hello World') What I have tried so far and is not working... r = search.query('{0}').format(company_name_search) r = search.query('s%') % (company_name_search) Both methods are not working and output th...
Mark Wollerman
0

votes
3

answer
37

views

Why don't my SharedPreferences save on button click?

So I am trying to add some values to my SharedPreferences but everytime I click the button it just goes with the default value of 00 so my if statement is always returning true even though it shouldn't. private static final String SHARED_FREFS = "sharedPrefs"; private static final String STATE = "st...
Mark Denom
1

votes
1

answer
1.8k

views

Create table in dynamoDB with LSI using boto

I know how to create a table using boto, but I cannot find any online help on creating a table that also includes an LSI. I have searched the boto docs, and the AWS docs. If you have a simple example of how to create such a table, I can take it from there. Thanks
Mark
0

votes
0

answer
4

views

iOS custom keyboard squished on secure text

Our app uses an external barcode reader, which is seen as a keyboard to an iPad. Because of this, we had to implement a custom keyboard/input view in order to allow users to still access the soft keyboard. We achieved the input view replace by using this (now seemingly dead) open source project. It...
Mark
1

votes
1

answer
1.1k

views

ActiveAdmin custom filter from model attributes on the fly

I am updating an old ruby\rails application that has an ActiveAdmin component (ActiveAdmin 0.6, Ruby 1.9.3 and Rails 3.2). The user has requested a filter that searches all fields in a given model. I don't think this is practical because you can't search a date or numeric value for "a" so I have c...
Mark Davies

View additional