Posts

Showing posts from April, 2012

android - How to use streaming of YouTubePlayer when power button is pressed(that is,screen off) -

i want make android application can listen music through youtubeplayer api. people turn off screen when listen music using android phone. so, want make that. that is, how youtube video streaming when power button pressed (screen off) - can use? you need create application service read here

php - CakePhp, How do i add to check if the uploaded file is image only? -

have been trying add codes old written program, did not write because have no idea how code might working. following codes acts in 2 different pages different forms. $type = $this->data['gallery']['type']; if (!empty($this->data)) { if (!isset($this->data['gallery']['gallery_category_id'])) { if ($this->data['gallery']['type'] == 1) { echo "<script>alert('" . infogallerysection . "')</script>"; } elseif ($this->data['gallery']['type'] == 2) { echo "<script>alert('" . infoshrotsection . "')</script>"; } else { } } else { // set upload destination folder //$destination = realpath('../../app/webroot/img/gallery') . '/'; $bigimg = www_root . 'img/gallery/big/'; $smallimg = www_root . 'img/gallery/small/&

switch statement - Trying to set a textField on top of a keyboard in swift -

i trying set textfield on top of keyboard programmatically in swift. using switch statement determine size screen user on affect size of keyboard , textfield should place. code not running can help. i still trying head around swift. var mytextfield : uitextfield! var windowheight = uiscreen.mainscreen().bounds.size.width switch windowheight { case 667: //iphone 6 , 6+ mytextfield = uitextfield(frame: cgrect(x: 20, y: view.frame.size.height - 258.0, width: view.frame.size.width - 40, height: 40.00)) case 568: //iphone 5 5s , 6zoom mytextfield = uitextfield(frame: cgrect(x: 20, y: view.frame.size.height - 253.0, width: view.frame.size.width - 40, height: 40.00)) default: //segue or alert view here println("the screen size incorrect") } mytextfield.becomefirstresponder() mytextfield.borderstyle = uitextborderstyle.line self.v

html - Php T_encapsed and whitepasce error -

i error parse error: syntax error, unexpected '' (t_encapsed_and_whitespace), expecting identifier (t_string) or variable (t_variable) or number (t_num_string) in c:\xampp\htdocs\atestat\addate.php on line 51 on line else if ($_post) { if (($_post['p_nume'] == "") || ($_post['p_nume'] == "")) { header("location: addate.php"); exit; <?php include 'ch20_include.php'; if (!$_post) {//nu se vede,arata $display_block = <<<end_of_text <form method="post" action="$_server[php_self]"> <fieldset> <legend>prenume/nume:</legend><br/> <input type="text" name="p_nume" size="30" maxlength="75" required="required" /> <input type="text" name="nume" size="30" maxlength="75" required="required" /> </fieldset> <p&

java - Data structure for continuous additions and cheap deletions -

i reading blog post making animations gnuplot , cairo -terminal algo's plan simply to save png-images working directory, and to save latest video working directory. i have more such user can browse images real time when images being converted: data-parallelism model - data structure regularly arranged in array to give user list in interface user can browse arrow buttons in interface, new images being added end of list the user can remove bad images stream in real time which may work in data parallelism model of parallel programming i.e. data set regularly structured in array. operations (additions, deletions) can operate on data, independently on distinct processes. let's assume there no need efficient searches simplicity in version 1. however, if come model can also, happy consider - let's call version 2. i think list not data structure here because of wanted opportunity deletions , continuous easy addition end of data structure. data structur

android - Starting a BroadcastReceiver from activity -

i'm trying start broadcastreceiver activity - , seems receiver doesnt start , dont output in logcat it. im trying start receiver doing this: intent intent = new intent(); intent.setaction(getpackagename()+".mybroadcast"); sendbroadcast(intent); also here receiver class: public class triggerreceiver extends broadcastreceiver implements googleapiclient.connectioncallbacks, googleapiclient.onconnectionfailedlistener, locationlistener { private vibrator v; private countdowntimer timer; private final long interval = 1000; private final long two_minutes = interval * 60 * 2; // === variables private context context; private final string tag = triggerreceiver.class.getsimplename(); @override public void onreceive(context context, intent intent) { this.context = context; log.e(tag, "trigger receiver starting"); v = (vibrator) context.getsystemservice(co

Number-system conversion in Matlab -

i wrote following program matlab converts numbers decimal-system other systems base 2 (binary) through 16 (hexademical). faced problems when program translates systems, starting base 10. in case remainder must written in way, 10=a , 11=b , on. how possible make it? should use switch-case purpose? thank you! clc clear dec = input('dec='); n = input('select number system n='); if n>=2 && n<=16 = 0; p=dec; while p>0 dec=p; = + 1; p = fix(dec/n); r = mod(dec, n); base(i) = num2str(r); end base = fliplr(base); disp(['base=' num2str(base)]); else disp('error'); end this function exists builtin dec2base . if have @ source code via edit dec2base you see function builds vector of numbers first , uses index character array symbols = '0123456789abcdefg...' . use same approach instead of num2str . base(i) = symbols(r+1) should it. btw: in disp line

ios - Variable Type convention for binary or yes/no variables in Core Data -

ios novice php background learning core data here. what variable type best practice binary i.e. yes/no or true/false values in core data? in php convention use tinyint or 0,1. core data seems have boolean primitive can use nsnumber, int etc. i'm using boolean variable type in .xcdatamodel file running lot of problems capturing binary variables switches, trying if else comparisons , forth right way. thx. coredata's bool type not "real" boolean, since boolean not object. should store them nsnumber , convert them boolean. set: [entity setbinary:[nsnumber numberwithbool:yes]]; get: bool isbinaryon = [[entity binary] boolvalue]; i hope helps!

security - Login Credetials: Why not drop the username? -

Image
i write hundredth login form when thought crossed mind: why need username? a while ago dad had change e-mail-address, , still didn't figure out, why can't log various websites new address. i'm not huge fan of individual per-site usernames. , wouldn't easier remember password? what usernames for? need unique string identify user by. if had password, work until user picks taken password , have tell him “sorry, 'greatpassword123' belongs user” — bad idea. so part of password needs unique. idea: predetermine first 3 characters! choose lower- , uppercase letters , digits, providing (26+26+10)^3 = 373,248 unique prefixes. @ registration, user dialog, telling him needs password, , starts “n0i” example, has pick rest (“deawhy” comes mind). can log in password only, being “n0ideawhy”, not knowing (or caring) “n0i” unique username. i see following pros , cons: pros independence e-mail-addresses user needs remember 1 string might reduce password reuse

nvd3.js - Chart not rendering with Shiny R and NVD3 -

i have been attempting create shiny timeseries plot using nvd3 library. relatively new r, shiny , nvd3. problem when run shinyapp, no chart renders on browser. using chromes developer tools, can see div mychart created , populated data, not understanding why cannot see chart itself. would appreciate , on matter... code so: #ui.r require(rcharts) shinyui(pagewithsidebar( headerpanel("population trend age group:"), sidebarpanel( selectinput(inputid = "agegrp", label = "choose agegroup", choices = c("0-4", "5-9", "10-14", "15-19", "20-24", "25-29", "30-34", "35-39", "40-44",

Flickr Authorisation with oAuth using Swift -

i wanted flickr authorisation oauth, got empty response. here how did. created base string (xxx..xx oauth_consumer_key): get&https%3a%2f%2fwww.flickr.com%2fservices%2foauth%2frequest_token&oauth_callback%3doob%26oauth_consumer_key%3dxxxxxxxxxxxxxxx%26oauth_nonce%3d91133798%26oauth_signature_method%3dhmac-sha1%26oauth_timestamp%3d1427542658 genarate signature hmac-sha1: 128974f0e49251f6bd705f7bf9dadbd3dafe90a4 created request string base string , signature this: https://www.flickr.com/services/oauth/request_token?oauth_callback=oob&oauth_consumer_key=xxxxxxxxxxxxxxxx&oauth_nonce=61061285&oauth_signature=128974f0e49251f6bd705f7bf9dadbd3dafe90a4&oauth_signature_method=hmac-sha1&oauth_timestamp=1427542658 i called request string "requeststringsignature" var url = nsurl(string: requeststringsignature) var request = nsurlrequest(url: url!) nsurlconnection.sendasynchronousrequest( request, queue: nsoperation

c# - Why navigation propery sometimes return null? -

Image
i have 2 models public class indicator { public long indicatorid { get; set; } public string name { get; set; } public int maxpoint { get; set; } public string comment { get; set; } public datetime datechanged { get; set; } public datetime datecreated { get; set; } public virtual ilist<calculationtype> calculationtypes { get; set; } } public class calculationtype { public long calculationtypeid { get; set; } public string unitname { get; set; } public int point { get; set; } public datetime datecreated { get; set; } public datetime datechanged { get; set; } public virtual indicator indicator { get; set; } } i have database factory public class databasefactory { private stankinquestionnaireentities datacontext; public stankinquestionnaireentities get() { return datacontext ?? (datacontext = new stankinquestionnaireentities()); } } and property refers databasefactory protected stankinquesti

Can I develop reports in Visual Studio 2013 without having a local copy of SQL Server? -

i'm migrating new computer, , have following installed on old machine: sql server 2012 business intelligence tools visual studio 2013 sql server management studio ssrs 2012 i'm creating reports in visual studio 2013 use remote sql server database. my question need have sql server 2012 installed on new machine able create reports? you need bids (business intelligence development studio) if sql server 2008r2 , before (2005-2008r2) , ssdt higher versions. convenient have ssms not necessary. excellent article on how install (and find ssdt) please see: using ssis bids visual studio 2012 / 2013

codeblocks - C - get character issue -

when run following code: #include <stdio.h> #include <stdlib.h> int main() { int n; char y; printf("message\n"); fscanf(stdin, "%c", &y); printf("message\n"); fscanf(stdin, "%c", &y); return 0; } i this: message {enter character} message the problem not asked enter character twice if there 2 scanf functions. output should this: message {enter character} message {enter character} i have issue getc() too: #include <stdio.h> #include <stdlib.h> int main() { int n; char y; printf("message\n"); y=getc(stdin); printf("message\n"); y=getc(stdin); return 0; } also, fflush() not help: #include <stdio.h> #include <stdlib.h> int main() { int n; char y; printf("message\n"); y=getc(stdin); fflush(stdin); fflush(stdout); printf("message\n"); y=getc(stdi

multithreading - Python: how to use pickle to dump Queue objects? -

the problem directly using pickle dump queue raise exception. have read similar post not got answer yet: pickle queue objects in python i can't replace queue collections.deque because i'm running multithreading program, in queue used synchronization. so how can this? if need save queue remaining content the (one , one) master thread after consumer , producer threads have terminated, have dump queue plain of list -- , use pickle persist list. def qdumper(q): try: yield q.get(false) except queue.empty: pass remaining = [item item in qdumper(my_queue)] pickle.dump(remaining, ....)

ssl - How to disable Firefox's untrusted connection warning using Selenium? -

trying find way disable firefox raising warning every time connection uses "untrusted" certificate, selenium. believe kind of solution work best set 1 of browser preferences. thanks much! suggestions appreciated! i found this comment on enabling functionality in selenium java . there this stackoverflow question same issue, java python, desired target language, came this, through browsing firefoxprofile code: profile = webdriver.firefoxprofile() profile.accept_untrusted_certs = true which, far have tested, has produced expected behavior. hope helps somebody!

ios - Prevent Restkit from adding escape characters? -

i trying encode image using base64 encoding , pass through json , generate json request , call restful api using restkit. what have seen in log restkit adds escape characters encoded image, preventing server end decoding image , fails. i want know whats best option stop restkit adding escape characters below example vpt\/x8wwdcpj1xbpj1zpbduwlhlnpczgnmlx3exaffi0p7nklapgo7hzsmxzc\/xitc\/k4iwrsg one can see slashes ( \/ ) added string. here code m using encoding string nsdata *originalphoto = uiimagepngrepresentation([uiimage imagenamed:@"time_icon.png"]); nsstring *base64photostring = [base64 encode:originalphoto]; base64.m follows + (nsstring*) encode:(const uint8_t*) input length:(nsinteger) length { nsmutabledata* data = [nsmutabledata datawithlength:((length + 2) / 3) * 4]; uint8_t* output = (uint8_t*)data.mutablebytes; (nsinteger = 0; < length; += 3) { nsinteger value = 0; (nsinteger j = i; j < (i + 3); j++) {

html5 - Phonegap/Cordova: How to add Javascript Multi-Touch Events? -

i'm trying make simple app using cordova. since beginning i've been using the: c.addeventlistener("mousedown", function (event) { mousedown(); }, false); method. problem that i can not specify coordinates (otherwise doesn't work @ all) the touch executes when "release" finger, rather executing right away when screen touched. i'm huge amateur , can't find answers on how handle touch events. in summary, want use touch (like mouse click) coordinates, , use multitouch events, such -> 2 fingers swipe outward = "zoom out", 2 fingers swipe inward = "zoom in" stuff. any appreciated :) you can use library lets handle kind of touch events hammer.js or use do, can download custom build of jquery mobile methods lets handle that.

sql server - how to check if a field of a column is null or not , if NULL then update -

create procedure:-i have table named evaluator column tag. need find if column tag has null values or not. if update values present in tag table. tag tabel: tag_id tag_name tag 1 c++ cp 2 oracle orc 3 java jv evaluator table: eval_id eval_name domain specialization tag 1 john database oracle null 2 matthew programming java jv 3 edward programming c++ null generally can update empty tag values this update evaluator set tag = 'some_tag' tag null

java - Maven compiling javax.ejb does not exists -

i created maven project in eclipse , when try run in project directory mvn clean install gives errors: [info] compiling 3 source files c:\users\florin\documents\facultate\master\tm is\anul1\sem2\orm\teme\lab1_5\shop-interfaces\target\classes [info] ------------------------------------------------------------- [error] compilation error : [info] ------------------------------------------------------------- [error] /c:/users/florin/documents/facultate/master/tmis/anul1/sem2/orm/teme/lab 1_5/shop-interfaces/src/main/java/ro/unitbv/ishoppingcart.java:[5,17] package ja vax.ejb not exist [error] /c:/users/florin/documents/facultate/master/tmis/anul1/sem2/orm/teme/lab 1_5/shop-interfaces/src/main/java/ro/unitbv/ishoppingcart.java:[7,2] cannot find symbol symbol: class remote [error] /c:/users/florin/documents/facultate/master/tmis/anul1/sem2/orm/teme/lab 1_5/shop-interfaces/src/main/java/ro/unitbv/productdao.java:[6,17] package javax .ejb not exist [error] failed execute goal org.apa

parsing - Simple "If-Then-Else" descent parser in Java (homework) -

there's no code snippets around web shows how parse ambiguos "if-then-else" grammar (at least pseudo code worth) in following grammar (upper-case non terminals, quoted terminals , other symbols regular expressions done both terminals , terminals) stats ::= (stat)* stat ::= if_stat if_stat ::= "if" exp "then" stat ("else" stat)? | exp exp ::= ident ident ::= ('a'-'z''a'-'z')+ the if statement ambiguos infact following code if if b c else d can readed both as if then{ if b c else d } or if then{ if b c } else d now. disambiguating seems simple (given did correctly): stats ::= (stat)* stat ::= if_stat if_stat ::= "if" exp "then" stat | "if" exp "then" if_stat_ex "else" stat | exp if_stat_ex ::= "if" exp "then" if_stat_ex "else" if_stat_ex |

hadoop - PIG - matching toDate function -

i trying cast string datetime object in hadoop pig. grunt give me strange error message : can't choose correct 'todate' function. asking 'explicit cast', have no clue how so. idea ? => error 1045: not infer matching function org.apache.pig.builtin.todate multiple or none of them fit. please use explicit cast. grunt> describe infos_by_nu_affa; infos_by_nu_affa: {nu_affa: bytearray,affaires: {(nu_affa:bytearray,nu_pcp: bytearray,debut: bytearray,fin: bytearray)},prestations: {(nu_affa: bytearray,montant: bytearray,date: bytearray,nu_presta: bytearray,beneficiaire: bytearray)},clients: {(nu_pcp: bytearray,nom: bytearray,prenom: bytearray)}} derivees = foreach infos_by_nu_affa generate *, todate(affaires.debut, 'dd/mm/yyyy') (debut:datetime); 2015-03-28 15:46:36,089 [main] error org.apache.pig.tools.grunt.grunt - error 1045: <line 155, column 0> not infer matching function org.apache.pig.builtin.todate multiple or none of them fit. please

Executing Curl in PHP to do a Stripe subscription -

the stripe api allows curl calls made. example, command: curl https://api.stripe.com//v1/customers/cus_5ucscmnxf3jssy/subscriptions -u sk_test_redacted: returns subscription of customer cus_5ucscmnxf3jssy. how can use php call curl command (i trying avoid using php stripe libraries). i trying following: <?php // create curl resource $ch = curl_init(); // set url curl_setopt($ch, curlopt_url, "https://api.stripe.com//v1/customers/cus_5ucscmnxf3jssy/subscriptions -u sk_test_redacted:"); //return transfer string curl_setopt($ch, curlopt_returntransfer, 1); // $output contains output string $output = curl_exec($ch); print($output); // close curl resource free system resources curl_close($ch); ?> however, seems curl not take -u parameter of url. following error: { "error": { "type": "invalid_request_error", "me

javascript - How can I format minutes into hour and minutes but only show hour if it's > 60 minutes? -

i have function converts minutes hour / minute format: return math.floor(diffmins / 60) + " hour " + diffmins % 60 + " minutes."; what make if there no hours "0 hours" not show. can recommend way can this? floor; check if more 0 hours; if not, output empty string; otherwise check if 1 hour, if yes, output "1 hour", if not, output number of hours + "hours" var h = math.floor(diffmins / 60); var hours = (h > 0 ? (h==1 ? "1 hour" : h+" hours") : ""); var mins = diffmins % 60; return hours + mins > 1 ? mins + " minutes." : " 1 minute." ;

javascript - Read a Jquery Data from File -

hi im trying read json data , display data in nested table have give expected result , posted script have tried. my data.json {"data":[ { "label":"node1", "color":"red", "children":[ { "label":"vip1", "color":"red", "children":[ { "label":"obj1", "color":"gray", "id":"539803eae4b0ffad82491508" }, { "label":"obj2", "color":"green", "id":"5395635ee4b071f136e4b691" }, { "label":"obj3", "c

powershell - Seach for a word in a .txt files and write few lines into a new .txt file -

please me create script perform task per described below. i have 2 files, a.txt , b.txt . content of a.txt below item name ticky title nice coffe drink type drink item name apple title sweet tasty apple type fruit item name juice title nice tasty drink type drink item name orang title niice nice orange type fruit item name chery title nutritious rich fruit type fruit now need search in a.txt word "fruit" , copy 2nd line on top of "fruit" new file named list.txt . but need name of fruit, list.txt should looks below. apple orang chery this coding (powershell) this... $source = "c:\temp\a.txt" $destination = "c:\temp\list.txt" $hits = select-string -path $source -simplematch "type fruit" -casesensitive $filecontents = get-content $source foreach($hit in $hits) { $filecontents[$hit.linenumber-3]| out-file -append $destination "" |out-file -append $destination } this extract 2nd top line per belo

html - Align responsive div to the right within container -

i have 1 parent div , 2 child divs. aim center 1 div , align other div right , make both responsive . i can't seem find conventional way align second 1 right within type of setup: <div id="container"> <div id="middle">centered middle</div> <div id="right">i want to right</div> </div> css: #container { position: relative; width: 100%; } #middle { margin: 0 auto; position: relative; width: 100%; max-width:150px; height:300px; } #right { max-width:150px; width:100%; } here jsfiddle . how crack puzzle? make inline-block , otherwise second div on second line reduce width in percentage, making 33% remove max-width #container { position: relative; width: 100%; text-align:middle; } div{ display:inline-block; } #middle { background: #ddd; margin: 0 auto; position: relative; width: 100px; margin-

java - trouble with do-while loop. compiled successfully using BlueJ -

every perfect cube (for eg. 8, 27, 216 etc) can expressed sum of series of consecutive odd numbers. fact such series contain 'n' consecutive odd numbers 'n' cube root of given cube. example: 1) 8=3+5= 2^3 (2 odd numbers) 2) 125=21+23+25+27+29= 5^3 (5 odd numbers) 3) 1000=91+93+95+97+99+101+103+105+107+109= 10^3 (10 odd numbers) the following code generates series of consecutive odd numbers sum equal perfect cube taken input (variable name 'cube'). problem-in given code there no syntax errors , runs once inspite of do-while loop ensures user can try different cubes entering yes/no (y/n) when asked. import java.util.*; class cube { void main() { /*gives series of consecutive odd numbers sum equal input value. input cube of number less 1000*/ int i,odd,t,sum,cube,n; string c="y"; scanner sc=new scanner(sy

Getting Data From Multiple Rows in PHP & MySQL -

i have university assignment have create dynamic gallery website using php , mysql, , idea create portfolio myself, have not done php in past , struggling bit getting work. basically, want 'thumbnail' row each column in table below , display them separate images, can seem first column's image in table display, therefore if knows how can multiple display, of great help. http://i.gyazo.com/00dde8157ba75ecd81cc52ca59effa32.png here code: $result = mysql_query($queryselect); //-------------- store content id = 1 in array -------------- ------------------- $row = mysql_fetch_array($result); //---------------- display results in html ----------------------------------------------------- ?> <?php echo "<img src=\"" .$row["thumbnail"]."\"/>";?> note: there code above connect database. try this: $result = mysql_query($queryselect); //-------------- store content id = 1 in array -------------

go - How to return slice by reference? -

the returned slice reference empty: package main import "fmt" func getitems(items *[]string) { list := make([]string, 0) list = append(list, "ok") items = &list } func main() { var items []string getitems(&items) fmt.print(len(items)) // expect 1 here, got 0 } how return slice function reference? by assigning items , alter items points, not value items points to. latter, instead of items = &list write *items = list .

wordpress - Getting ACF field value in functions.php -

i try add link file (uploaded in acf field) in gravity form notification, in wordpress. so, given in gravity form , acf documentation, tried in functions.php add hook gravity form notification mail function : add_filter( 'gform_notification_1', 'my_gform_add_link', 10, 3 ); function my_gform_add_link( $notification, $form, $entry ) { $postid = intval($entry[2]); //return id of post int $notification['message'] .= '\n <a href="'.get_field('spec-file', $postid).'">see furniture specs</a>'; return $notification; } in code above : $postid works expected (it returns expected post id). thing : get_field('spec-file', $postid) (which recommended method field value outside loop - http://www.advancedcustomfields.com/resources/how-to-get-values-from-another-post/ ) returns empty. why ? idea ? edit : the post id wasn't correct , fixed , code above works expected.

asynchronous - Can Dart streams save data? -

it not clear me whether the single subscriber streams in dart save data receive. if do, there way disable this, since seems major memory leak? with new async* functions in dart, streams produced these store data? the code-doc on streamcontroller constructor says the controller buffer incoming events until subscriber is registered. to avoid queued events can use broadcast stream new streamcontroller.broadcast(...); or pause subscription streamsubscription sub; sub = s.listen((e) { sub.pause(); // process event sub.resume(); }); a stream created async* behaves same import 'dart:async'; stream<int> a() async* { (int = 1; <= 10; ++i) { print('yield $i'); yield i; } } main() { a().listen((e) async { await new future.delayed(const duration(seconds: 1)); print(e); }); streamsubscription sub; sub = a().listen((e) async { sub.pause(); await new future.delayed(const duration(seco

html - How can I style a link based on my current page? -

i made navigation bar on top of screen. if i'm on specific page, let's "contact", want word highlighted. if switch "home", word "home" highlighted, , on. allowed use css , html. body { background: black; } nav { padding:0; right:1vw; margin: 0 0 0px 0; position: fixed; top: 0vh; text-align:center; background-color:rgba(255, 255, 255, 0.4); width:98%; -moz-border-radius: 15px; border-radius: 15px; } nav li { top:2vh; font-family:verdana, geneva, sans-serif; font-size: 13pt; display: inline-block; margin-left:2vw; margin-right:2vw; margin-bottom:2vh; margin-top:2vh; } nav li { white-space: nowrap; display: block; text-decoration: none; text-transform: uppercase; text-shadow: 1px 1px 2px rgba(71, 80, 23, 0.3); color: #fff; padding: 0; letter-spacing: 1px; -webkit-transition: 0.4s ease-in-out;

Vb.net/C# make classes store value types -

i need declare class properties stored value types. need make class inheritable, can't make structure. class myclass ... end class class inheritingclass inherits myclass ... end class is there other way without converting structure , using interfaces? (example below) structure mystructure implements myinterface ... end structure structure inheritingstructure implements myinterface ... end structure interface myinterface ... end interface ps: can post answer in c# if don't know vb if need type value-type, there no other way making struct . maybe, if give more context, leading question, might find better solution actual problem.

ios - Swift - Why init(coder) is required in AFHTTPSessionManager? -

i'm not experienced in ios development. while making subclass of afhttpsessionmanager xcode suggested me include required init(coder) : import uikit let _sharedapimanager = apimanager(baseurl: nsurl(string: api_url)!) class apimanager: afhttpsessionmanager { /** * singleton service * (https://github.com/hpique/swiftsingleton) */ class var sharedinstance : apimanager { return _sharedapimanager } init(baseurl url: nsurl!) { super.init(baseurl: url, sessionconfiguration: nil) self.responseserializer = afjsonresponseserializer() afjsonresponseserializer self.requestserializer = afjsonrequestserializer() afjsonrequestserializer self.requestserializer.setvalue(api_key, forhttpheaderfield: "x-api-key") self.requestserializer.setvalue("3", forhttpheaderfield: "x-api-version") } // inserted xcode required init(coder adecoder: nscoder) { fatalerror(&