Vote count: -1 I added Image inside edit text for showing and hiding password..how to perform on click operation for showing and hiding password for that image on inside editText asked 2 mins agopruthvi v reddy Let's block ads! بخوانید...
ادامه مطلبVote count: 0 NSString *message = @"This part: "Is in quotations""; I'm wondering if it's possible to color the part of the NSString inside the quotations a different color? I understand this example: Is it possible to change color of single word in UITextView and UITextField but not sure how to convert it to my example since I have multiple slahes. asked 2 mins agoApollo Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Consider the following code public class myClass{ myClass instanceOfNotYetDefinedClass; ... //etc code } I don't understand how the compiler manages to understand that: I'm telling it to create a class, and then it says: "OK! Let me see what this myClass class has. Oh, its a myClass, let me see whats this has..." etc. It may be a pretty noobish question, but I really don't understand how this could be handled. asked 2 mins agoYoTengoUnLCD Let's block ads! بخوانید...
ادامه مطلبVote count: 2 I have a basic sketch of implementing a multithreaded web proxy: FILE *proxy_log_file; static void SIGUSR1_handler(int sig) { (void)sig; fflush(proxy_log_file); } int main(int argc, char **argv) { proxy_log_file = fopen("proxy.log", "a"); Signal(SIGUSR1, SIGUSR1_handler); } The idea is that network admins can flush buffered log entries to a log file by using the kill command to send a SIGUSR1 signal to the web proxy. However, I'm not sure it's a good idea to call fflush inside the signal handler. I know fflush is thread-safe but don't think it's async-signal-safe. What concurrency problem could arise from calling fflush inside a signal handler of a multithreaded? asked 1 min ag...
ادامه مطلبVote count: 0 I have a Signalr Hub called NotificationHub that handles sending new notification to coected clients. The NotificationHub class uses a NotificationManager class to retrieve notifications data. Now, I want to be able to use a session to store the last time a new notification has been accessed but when using HttpContext.Current.Session["lastRun"] in NotificationManager I get a NullReferenceException. To clarify more, here is some of the codes of both classes: NotificationHub [HubName("notification")] public class NotificationHub : Hub { private NotificationManager _manager; private ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); ...
ادامه مطلبVote count: 0 I have writte a restTtemplate class for an API. The response looks like: { "a":"A", "b":"B", "myList": [ {}, {}, {}]} I just need "myList" array and I want to map it to a List. What is the easiest way to do this usin Spring RestTemplate and Jackson ObjectMapper? asked 1 min agoGovan Let's block ads! بخوانید...
ادامه مطلبVote count: 0 To lea javascript, I implement and test classic algorithms with it. Here is my attempt at implementing binary search and tests for it: var assert = require('assert') function binsearch (xs, v) { if (xs === undefined || xs.length === 0) { retu null } var lo = 0 var hi = xs.length - 1 while (lo xs[i]) { lo = i + 1 } } retu null } var check_bsearch = function (bsearch, xs, x, i) { it(bsearch.name + ' [' + xs + '] ' + x + ' ' + i, function () { assert.equal(bsearch(xs, x), i) }) } describe('Test binsearch', function () { describe('on a sorted array', function() { var xs = [] for (var i = 0; i < 2; ++i) { xs[i] = 2 * i for (var j = 0; j...
ادامه مطلبVote count: 0 I have the following razor syntax inside the view: (@Html.ActionLink(SQPStrings.ForgotPassword, "ResetPassword", "User", new { Area = "Authentication" }, new { })) in the resx file I have the following text: Password: use your password (case sensitive) (insert the actionlink here) I caot seem to find how to proceed with this, can someone help me get in the right direction? I know I need to do a String.Format in the view and add the parameters but not excactly how... asked 1 min agoJanVanHaudt Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I know a dollar sign is a replacement for 'jQuerry' and is used for accessing functions and variables from the jQuerry object. Can this be considered the equivalent of a macro in C since it helps us not to type jQerry every time acting just like a macro in C? asked 49 secs agoyoyo_fun Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I would like to know if elasticsearch considers empty string as null value, but based on my mapping shown below, I don't see that it is doing that. How can I make elasticsearch consider empty string as a null and index using the value provided by null_value. My mapping is shown below: { "mapping": { "my_typee": { "properties": { "autoRank": { "type": "integer", "null_value": 0, "store": true, "index": "analyzed" } } } } } Thanks in advance. asked 4 mins agoSai Krishna Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I'm working on an Angular 2 app and keep wondering how to best componentize the UI design I have come up with: Basically, I have a side menu from where I can select a topic, e.g. "Sales". In addition, I pick an employee from the context menu on the right to display the topic for. The question now is, how do I go about making these into components now? It somehow would feel natural to have URLs such as http://foo.com/#/sales/123 with a route configured like so { path: '/sales/:employeeId', name: 'Sales', component: SalesComponent } However, if I change the topic from "Sales" to, say, "Contacts" (still within the context of the employee I have previously chosen), then the links i...
ادامه مطلبVote count: 1 What I am trying to do is use aws-lambda to import zipped sql files in aws-rds. In my case zipped sql files are inserted in s3 constantly by some crawlers. What I want to do is when any sql file is uploaded to an s3 bucket, I want aws-lambda to use a mysql-client to import these files into aws-rds. They way I have think of doing this is by packaging a mysql-client inside the zip for the aws-lambda handler. But I can't really figure out how to package mysql inside a zip. Is this possible? If yes, then a list of steps to achieve this would be really helpful! PS: I am using python-2.7 for writing the aws-lambda handler. I am not interested in using any python-mysql library to achi...
ادامه مطلبVote count: 0 Part of the code that I'm trying to understand as a begier java student is below: public class StandardGA extends GeneticAlgorithm { private static final long serialVersionUID = 5043503777821916152L; private final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StandardGA.class); /** * Constructor * * @param factory a {@link org.evosuite.ga.ChromosomeFactory} object. */ public StandardGA(ChromosomeFactory factory) { super(factory); } /** {@inheritDoc} */ @SuppressWaings("unchecked") @Override protected void evolve() { List newGeneration = new ArrayList(); // Elitism newGeneration.addAll(elitism()); // new_generation.size() < population_size while (!isNextPopulationF...
ادامه مطلبVote count: 0 I am using a gulp task to gzip my source files and set into a dist folder. I am able to successfully generate xyz.tar.gz file, but when I try to see the files in it using a 7zip on windows 7, I see a lot of files named "PaxHeader" each of different size. Tried searching on inteet, but results were more of gzip related and unable to understand. Can someone let me know why this is happening? Is it a gzip related issue or a wrong configuration of gulp-gzip? TIA asked 2 mins agovamshi4001 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I know this seems like a straight forward question - but although Moment.js and moment timezone are very powerful tools for getting/setting and formatting dates.. I'm having an issue snapping my application to a single timezone. What I want, is for a user to choose from a date/time picker - and to send that as a unix timestamp in UTC.. but the date/time picker MUST be considered to be BST. In other words, even if you're using the site from abroad - the date/time you select should be the UTC value for if you had chosen it in the UK. var local = moment(dateTime).unix(); var london = moment(dateTime).tz('Europe/London').unix(); var berlin = moment(dateTime).tz('Europe/Berlin').uni...
ادامه مطلبVote count: 0 I've the following setup: Jenkins environment ruing docker-compose but I need to pass environment variables to the yml file: sample docker-compose.yml version: '2' services: logon_server: build: . image: my_server:0.0.1 ports: - "9200:9200" command: ${DOCKER_CMD_EXEC} networks: - my_ntwrk networks: my_ntwrk: When I run the following script from a shell prompt on my mac, I can pass different commands to be executed and everything works: exec-tests.sh #!/bin/bash chmod 755 docker/exec-*.sh # Setup env variables export DOCKER_CMD_EXEC=/ci_e2e.sh # Optional: record current versions docker -v && docker-compose -v echo `whoami` echo `sudo -E -u admin printenv` # Build, deploy and run...
ادامه مطلبVote count: 0 I want to know if it's possible to implement the SIP stack outside the servlet container and interact between them with an interface. I want to have SIP transactions and dialogs the first part and can host the servlet inside the servlet container like Tomcat. whenever a SIP request comes, the first part receives it, parses it, SIP transaction and dialog will be created, the servlet and application which should be invoked is chosen and the the message is sent to the servlet container through and interface, then the servlet which is hosted in servlet container, is invoked and creates a response, then the response goes back to the first part and will be sent to the destination. An...
ادامه مطلبVote count: 0 I used custom metaboxes inside custom post type pages and now I can't migrate the data from one site to another (from stage to production). Any tips on how to do this? It seems that they either don't get exported or imported. asked 1 min agogoncalomarques Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a requirement, that involves with the manipulation of an excel sheet. I was thinking about using Apache POI library for the same, and then I came across an incredibly awesome parser in Javascript : http://oss.sheetjs.com/js-xls/ http://oss.sheetjs.com/js-xlsx/ Now my question is ,whether there is a trade-off in doing the parsing at the client side? What are the potential problems I may face if I do it client-side. Thanks a lot in advance. asked 3 mins agojava_maniac Let's block ads! بخوانید...
ادامه مطلبVote count: 0 This is a working program that I've been trying to lea C++ from that inputs from a file strings and doubles and puts them into their perspective arrays. What I'm stuck on is while sorting the strings I want to sort the array of doubles in ascending order and keep the scores with the name they are associated with. I'm trying to lea it without using vectors before I go on to lea how to manipulate them, that's the reason for not using vectors before anyone asks. Is it best to sort the columns of the 2d array and than sort them with the 1d array or just to have a statement that does it all? Also what would be the best sorting algorithm for this application? My attempts have all fai...
ادامه مطلب