Mocking a Protocol with a Generic Func
Vote count: 0 So I have the following Swift protocols... protocol MyMessage { func encodeMessage() -> [String:AnyObject] } protocol Sender { func send<T:MyMessage>(id:Int,event:T) } And I am using them just fine in some code I wrote. Now I want to write some unit tests and mock the Sender protocol. ...
Dynamic RecyclerView Not Populating Data
Vote count: 0 I have switched from a ListView to a RecyclerView, and I use data from Firebase to dynamically add RecyclerView items. However, I am unable to successfully generate a RecyclerView. My listener, I add to the mCommentArrayList here and then later pull from this data in my RecyclerView Ad...
Camel Redis Automatically Prepends String to Key
Vote count: 0 I'm using the Redis component in my Camel application. One issue is that it automatically prepends strings to keys. For example, let's say I run the following in my Camel app: from("direct://path/to/store/in/redis") .setHeader(RedisConstants.COMMAND, constant("SET")) .setHeader(RedisCo...
Best website to convert RGB Value to HEX value?
Vote count: 0 Can you please any one suggest the best website to convert RGB to HEX and vice versa. I want the mobile supported website name. I am using those colour codes for mobile application development. Thanks in advance asked 1 min agobalagurubaran Let's block ads! (Why?)
How to remove fields from collection with Lodash?
Vote count: 0 var characters = [ { 'name': 'ba ey', 'blocked': 'a', 'employer': 'slate' }, { 'name': 'fred', 'blocked': 'a', 'employer': 'slate' }, { 'name': 'pebbles', 'blocked': 'a', 'employer': 'na' }, { 'name': 'pebbles', 'blocked': 'b', 'employer': 'ha a' }, { 'name': 'wilma', 'blocked': 'c', '...
Stata Merging on Lagged Dates
Vote count: 0 I have another Stata date question. I have two datasets, one with IDs and Dates. Here is the first dataset: [CODE] * Example generated by -dataex-. To install: ssc install dataex clear input long ID double Date float Date2 104203 18820 18820 104203 18950 18950 104203 19294 19294 104203...
Undefined reference to macro on a static library
Vote count: 0 I'm trying to compile a binary linking it with a static library libfoo.a: gcc -L. -o myapp myapp.o -lfoo But I'm getting the following error from the linker: libfoo.c:101: undefined reference to `_TRACE' The problem is I don't have the source code for libfoo.a library. I tried to get t...
WPF Textblock with bound text will not scroll
Vote count: 0 The text in my TextBlock is bound to an element in my code. However, when I first open my window, the Textblock is completely empty. As I add text, I need the ScrollViewer to allow me to scroll down the text, or automatically scroll down as more text is added. Using the MVVM, so no cod...
High and low points on chart getting cut off
Vote count: 0 The low and high points on this chart are getting cut off, is there any way to fix this without knowing what numbers will be in the data? I've seen other people create some padding with the chart's minimum and maximum values, but I don't know what the values will be beforehand. chart i...
The current transaction cannot be committed and cannot support operations that write to the log file. (Merge encountered duplicates)
Vote count: 0 I get this error and it points to transaction processing and Try/Catch. I'm not very strong in SQL but particularly weak in these two areas. The code I inherited has both. The actual problem is a Merge encountered duplicates and tried updating same record twice. It would be nice to get...
Ethernet shield 400 bad request
Vote count: 0 I'm having a problem with my ethe et shield server co ection. I co ected my ethe et shield to a router ( client mode ) and then co ect this router to my phone hotspot. This is my code: #include <SPI.h> #include <Ethe et.h> byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; char serve...
Searching for multiple Like clauses Access SQL
Vote count: 0 I'm building a sql query in Access that searches across multiple fields (columns). So far I have for the where clause [name] Like '*A*' OR [email] Like '*A*' OR [project] Like '*A*' ; It doesn't work as it's giving me a syntax error. Problem is that if I just delete the very last part ...
Time zone settings in elastalert
Vote count: 0 I've been a few days implemented elastalert on my system. Everything is going well although I have problems with the dates fields reported in my notifications. The dates that I store on my system are in time zone UTC-5, but when elastalert notifies me an alert, sends these dates with t...
Meteor Striking out text in element when checked
Vote count: 0 I am lea ing Meteor and I am trying to check a box for a task and have in tu JQuery strike out the text when it is checked. I have helpers in place that show me data the way I want it to and also event handler so that when the inout is checked it updates the db. What I want is to be ab...
Carrierwave - storing file in dynamic public folder
Vote count: 0 I am using Carrierwave 0.5.8 for storing uploaded file. In my app users can upload any file. So I have to maintain folders like "public/uploads/1/", "public/uploads/2/", where 1, 2...etc will be user ids, and these folders will contain files uploaded by user in his corresponding id fol...
Parsing set of Json files one by one
Vote count: 0 I am trying to parse Json files using JsonCpp library. but I am facing a problem Which I can not fix it. the code shown below is working perfectly when I am parsing one file but when I added the part which iterates over files in directory the program crashes. The first function is used...