Mocking a Protocol with a Generic Func
◷
تاریخ انتشار: 1395/3/4 | ساعت: 9:10
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. ...
Is it safe to use ajax get method to load information for the site?
◷
تاریخ انتشار: 1395/3/4 | ساعت: 9:10
Vote count: 0 I have an html page and I need to load some usual information(can be seen by all people) from DB. so I put this code in the html: <script type="text/javascript"> $(document).ready( function() { setTimeout( "getRate()", 100 ); }); function getRate() { $.ajax( { type: "GET", url: "api.ph...
Dynamic RecyclerView Not Populating Data
◷
تاریخ انتشار: 1395/3/4 | ساعت: 9:10
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 7:55
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?
◷
تاریخ انتشار: 1395/3/4 | ساعت: 7:55
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?)
Firebase Facebook login: An invalid API Key was supplied in the request
◷
تاریخ انتشار: 1395/3/4 | ساعت: 7:55
Vote count: 0 Trying to get Facebook login to work with the new Firebase, but I keep getting this error: "An invalid API Key was supplied in the request." facebookLogin.logInWithReadPermissions(["public_profile", "email", "user_friends"], fromViewController: self) { (login, error) in if error != nil...
Get pc-intervall of an object reference on which a method is called
◷
تاریخ انتشار: 1395/3/4 | ساعت: 4:13
Vote count: 0 For a project I have to get java bytecode information of an object reference on which a method is called (static analysis): e.g. x.method(); If the method takes some arguments we can't separate the object reference from the arguments at bytecode-level, e.g. x.method(arg1, arg2, ...);. ...
How to remove fields from collection with Lodash?
◷
تاریخ انتشار: 1395/3/4 | ساعت: 4:13
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 4:13
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 2:27
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 2:27
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 2:27
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)
◷
تاریخ انتشار: 1395/3/4 | ساعت: 1:06
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 1:06
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 1:06
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 ...
HTML can't reach element with mouse/Can't click through parent divs
◷
تاریخ انتشار: 1395/3/4 | ساعت: 0:02
Vote count: 0 Ok, I have the following html code <div id="absoluteWrapper" style = "z-index:-11; pointer-events: none;"> <div id="wrapper" style = "z-index:-11; pointer-events: none;"> <div id="leftWrap" style = "z-index:-11; pointer-events: none;"> <div id="miniWrapL" style = "z-index:-11; pointer-...
Time zone settings in elastalert
◷
تاریخ انتشار: 1395/3/4 | ساعت: 0:02
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
◷
تاریخ انتشار: 1395/3/4 | ساعت: 0:02
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
◷
تاریخ انتشار: 1395/3/3 | ساعت: 21:20
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
◷
تاریخ انتشار: 1395/3/3 | ساعت: 21:20
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...