Posts

java - how to set multiple token in MultiAutoCompleteTextview Android -

i need set different adapters different token (i.e when type '@' should call atmentionedadapter , when type '#' should call hashadapter , both has in same multiautocompletetextview please find sample code have used working @ not hash multitextview.settokenizer(new multiautocompletetextview.tokenizer() { @override public charsequence terminatetoken(charsequence text) { int = text.length(); while (i > 0 && text.charat(i - 1) == ' ') { i--; } if (i > 0 && text.charat(i - 1) == ' ') { return text; } else { if (text instanceof spanned) { spannablestring sp = new spannablestring(text + " "); textutils.copyspansfrom((spanned) text, 0, text.length(), object.class, ...

c# - MSSQLLocalDb - How to create custom authentication with localDb connection in ASP.Net MVC? -

i'm trying make own authentication service using mssqllocaldb. have used connection string instantiate local instance of identitydbcontext class. connectionstring="data source=(localdb)\mssqllocaldb;attachdbfilename=|datadirectory|\aspnet-verisystems-20161025123601.mdf;initial catalog=aspnet-verisystems-20161025123601;integrated security=true;multipleactiveresultsets=true but whenever i'm publishing project iis localhost i'm unable execute login service. , error a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 50 - local database runtime error occurred. cannot create automatic instance. see windows application event log error details. ) stack trace: [sqlexception (0x80131904): network-related or instance-specific error occurred while establishing con...

angularjs - How to fix this Access-Control-Allow-Headers error -

i'm using angularjs post localhost api. got error message: xmlhttprequest cannot load "...api link..." request header field authorization not allowed access-control-allow-headers in preflight response. i can post api when use "allow-control-allow-origin" chrome extension. temporary, way works when use extension on borwser. users got problem when use in own browser. how fix client side. i don't think can fix issue client side. api server controls can access (using allow-control-allow-origin header) have change there.

cron - quartz scheduler to run on specific day and time, run every hour and should continue from there -

is possible fire job start on specific date , time run every hour 1:00 from there should continue till next 3 months for days ex: start job on feb 12 2017, 1:00 am, runs every hour i.e 2:00am, 3:00am and continue till april 12 2017 for days assuming current date 10 nov 2016 any solution unix cron fine below schedule on 12th of feb, mar , april 2017. |------------------------------------------------------------------| | seconds | minutes | hours | dayofmonth | month | dayofweek | year| | | | | | | | | | 0 | 0 | */1 | 12 | 2-4 | ? | 2017| |------------------------------------------------------------------| it can achieved using 3 cron jobs programatically . first job :- register second cron job on day should start. triggered(run) once. second job :- run every hour. triggered multiple times third job :- de-register second cron job . triggered once. explanantion:- ...

Find and replace text in all files using PHP -

hi everyone, i have list of php files in project.if want replace index.php text home.php , save it. change in php file in directory how can code this. i can find , replace in single file don't know way search in whole directory , replace kindly me know way. im new section.thanks in advance. you can use glob files in directory, glob(__dir__.'/*.php') give php files in current directory. if need in production server use if can run command line function since web server not should have write access files

android - Why PNG forms black edges around the image for PNG format? -

Image
i select image gallery, convert base64 , sends server. jpeg image, works fine; image upload gallery on server same gets shown in server folder. however, when upload png format image mobile gallery, doesn't show same on server; instead creates black edges around it. don't know what's going wrong? also, actual image equal given jpeg image. reference images: jpeg: png: i want rid of black borders should not appear png format images. below code snippet fileinputstream mfileinputstream = null; try { mfileinputstream = new fileinputstream(imagepathfromsdcard); bytearrayoutputstream bos = new bytearrayoutputstream(); byte[] b = new byte[1024]; int bytesread = 0; while ((bytesread = mfileinputstream.read(b)) != -1) { bos.write(b, 0, bytesread); } bitmap bitmap = safeimageprocessing.decodefile(uri); bitmap.compress(bitmap.compressformat.png, ...

mongoose - group collection data by multiple fields mongodb -

collection structure order = new schema index: { type: number, unique: true } number: date status: { type: string, enum: ['success', 'failure'] } created_at: { type: date, default: date.now } updated_at: { type: date, default: date.now } i need query returns me array of objects having data success count , failure count grouped date. ex- orders = { 28-10-2016:{ success_count: 10, failure_count: 10 }, 29-10-2016: { success_count: 10, failure_count: 10 } } with aggregation framework, result different "desired" output instead of having hash keys, array of objects _id key having value represents group field. instance, instead of { "28-10-2016":{ "success_count": 10, "failure_count": 10 }, "29-10-2016...