Posts

Showing posts from March, 2015

Entity Framework 6 and MySQL base first -

i want use exist db on mysql mvc asp.net . installed mysql plugin vs , mysql connector net . add connection string config. when start vs in server explorer see working connection, when in project try add new ado.net entity data model -> generate database wizard don't know mysql in general, there defaultconnection ms sql , 2 varients new connection: microsoft sql server microsoft sql server database file other maybe forgot install? help.

python - QTextEdit does not print text -

i using pyqt4 design interface of python program. want print in qtextedit called "answere", not print anything. tested text there (see print(n_text) ), , is. short overview of program: question entered, , program should answer it. here code: # -*- coding: utf-8 -*- import sys import database pyqt4 import qtcore, qtgui, uic class raspi(qtgui.qmainwindow): def __init__(self): qtgui.qmainwindow.__init__(self) self.ui = uic.loadui('main_window.ui') self.ui.setwindowtitle('fragen den raspi') self.ui.show() self.connect(self.ui.ask, qtcore.signal("clicked()"), self.reading) def reading(self): txt = str(self.ui.question.text()).lower() database.base().searching(txt) def answere(self, text): n_text = qtcore.qstring(text) print(n_text) self.ui.answere.append(n_text) if __name__=='__main__': app = qtgui.qapplication(sys.argv) raspi=ra...

file upload - Can I change current directory to parent directory using PHP __DIR__ constant? -

i using php magic constant move uploaded file new location, , upload handler file location inside " _inc " file inside main application folder this: "path/tasksapp/_inc/upload_handelr.php" so; when use __dir__ path upload hander exist: "path/tasksapp/_inc/" while new location uploaded file should be: "path/tasksapp/uploads" is there's option or attribute can use __dir__ constant can change current directory parent directory: change: "path/tasksapp/_inc/" to be: "path/tasksapp/" i recommend dirname(__dir__) : it's portable (works on windows a/b/../c not allowed) it's readable

html5 - Need help for disable particular hover jQuery animation in smaller device -

this jquery code $('.sol-card-container').hover(function () { $(".card-content", this).stop().animate({top: '160px'}, {queue: false,duration: 100}); $(".cta-txt-link", this).stop().animate({bottom: '-65px'}, {queue: false,duration: 600}); }, function () { $(".card-content", this).stop().animate({top: '0px'}, {queue: false,duration: 100}); $(".cta-txt-link", this).stop().animate({bottom: '0px'}, {queue: false,duration: 600}); }); html part have using bootstrap 3 version. issues is, these jquery code working fine in desktop layout, need disable animation in <767px breakpoint. can suggest me how disable you can wrap inside resize event : $(document).ready(function(){ var $w = $(window); var breakpoint = 768; $w.on('resize', function(){ if ($w.width() < breakpoint) return false; $('.sol-card-container').hover(...

lucene - Weighted keywords on elasticsearch document -

i want create index in elasticsearch has field of weighted keywords list, when search term in keywords - give better scores documents has key higher weight? for instance: doc1 "id" : "111" "keywords" : "house"(20), "dog"(2) doc2 "id" : "222" "keywords" : "house"(3), "dog"(40) i want when searching "dog" doc2 higher score. how build mapping , query? note it's different searching regular boost, boost per each term different per document. what elasticsearch payloads? see drtech's answer delimited payload token filter separate unrelated question might out. but, describing seems lend use of payloads , using script scoring access these payloads , influence scoring. take note of performance cost mentions.

C# add list of strings to combobox and when item is remove automatic affect to list -

i want add strings list combobox, , when 1 of item removed ui, want automatically effect on list (that list remove selected string). what best tehnic kind of problems. example: list<string> users = new list<string>(){ "frsuser", "secuser", "thruser", "fouuser" }; private void frmmain_load(object sender, eventargs e) { foreach(var user in users) cmbuser.items.add(user); } private void btnremove_click(object sender, eventargs e) { cmbuser.items.removeat(cmbuser.selectedindex); // should removed here? users.removeat(cmbuser.selectedindex); } this done using bindingsource handles interaction between collection of combobox items , list private void frmmain_load(object sender, eventargs e) { bindingsource bs = new bindingsource(); bs.datasource = users; c.datasource = bs; } now @ button click event use code private void btnremove_click(object sender, eventargs e) { if(c.s...

javascript - Getting HTTP Response Header in Firefox Addon -

i trying http response reading response header. not able retrieve anything. missing exactly? here code in index.js var {cc, ci} = require("chrome"); var httprequestobserver = { init: function() { var observerservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); observerservice.addobserver(this, "http-on-examine-response", false); }, observe: function(subject, topic, data) { if (topic == "http-on-examine-response") { subject.queryinterface(ci.nsihttpchannel); this.onexamineresponse(subject); } }, onexamineresponse: function (ohttp) { console.log("header :"+json.stringify(ohttp)); try { var header_value = ohttp.getresponseheader("<the_header_that_i_need>"); // uri nsiuri of response you're looking @ // , spec gives full url string var url = ohttp.uri.spec; } ...

node.js - how to "dont vote twice" mechanism -

i thinking of creating voting app. general idea browse gallery an awesome pic grabs attention hit vote button underneath it code magic happens vote counted at date, vote buttons become non-active , app counts votes this web app, means html5-css3-express.js-redis framework, or similar. how can ensure user cannot vote same pic twice? making him sign up? huge procedure voting app, dont think? plus, guess need captcha thing avoid unwanted, mass sign up. but if use coockies of html5 local storage api, stopping same user clear his/her coockies , vote same pic again , again? what best method? thanks alot the secure way using accounts keep track of has voted. accounts easy implement in application , don't need hold account data if use service passport.js. you'll have database set makes easy keep account data well. the other method keep track of ip addresses has issues (say, if user uses proxy). ip address cover clients on network means if 1 person vot...

excel - pop a random value from a list of cells -

Image
i have question similar this one , little different: let's have data this: car name color list of colors car1 ? red car2 ? blue car3 ? green car4 ? black and want randomly distribute of colors of cars without repetition, i.e. car name color list of colors car1 green red car2 black blue car3 blue green car4 red black is there way have cell randomly select list excluding values input in range? in d2 enter: =rand() and copy down. in b2 enter: =index(c$2:c$5,match(large(d$2:d$5,row()-1),d$2:d$5,0)) and copy down:

ruby on rails - Issue with docker and bundler -

i'm running issues docker/docker-compose , bundler. after building image can run rails server correctly without issue, but, when try run console rails console get: could not find i18n-0.7.0 in of sources run `bundle install` install missing gems. if try run bundle install in container there no problem, seems correctly installed. docker-compose run web bundle install ... using spring 1.3.6 using therubyracer 0.12.2 using turbolinks 2.5.3 using uglifier 2.7.2 using web-console 2.2.1 updating files in vendor/cache bundle complete! 24 gemfile dependencies, 119 gems installed. bundled gems installed /usr/local/bundle. my docker-compose.yml looks this: db: image: postgres web: build: . command: rails s -p 3000 -b 0.0.0.0 ports: - "3000:3000" volumes: - .:/app - ./github_rsa:/root/.ssh/id_rsa links: - db i need mount volume ssh key because there gems need pulled private repositories. my dockerfile looks this: from ruby:2.2.0...

Racket - How to look a specific of a list of lists. (Finding average) -

let's have list of structures , have list contains list of these structures. how can specific list? you can use list-ref access determined element in list.

github - Having problems with "git revert" after merging my branch -

i have 3 branches: master, , b. branch "a" , "b" should independent each other. after pull requests, master got updated , b. now, have accidentally merged b a. immediately, have reverted merge via git revert -m but when pull b master, revert merge in destroys changes branch b. happening because of branch have "revert merge b" commit. how can remove "revert merge branch b" , "merge branch b" commits? tried use git -rebase command, doesn't me, git creates anthoer branch not in pull request. simple answer: git docs revert revert because so if think of "revert" "undo", you're going miss part of reverts. yes, undoes data, no, doesn't undo history. adding more it: unfortunately, hit the popular problem in history of git users :) your problem faulty merge git merge branch b/branch a , tried recover git revert remember, "revert" undoes data changes, it's...

odk - Android Javarosa innerText repeat groups -

i trying retrieve innertexts of repeated group unable retrieve appearance attribute or hint. other 2 hint tags can retrieve. pointers? <group> <label ref="jr:itext('/data/question0/question3/question6:label')" /> <appearance>evil</appearance> <hint>stuff</hint> <repeat nodeset="/data/question0/question3/question6"> <input ref="/data/question0/question3/question6/question7"> <label ref="jr:itext('/data/question0/question3/question6/question7:label')" /> <hint>i work</hint> <hint ref="jr:itext('/data/question0/question3/question6/question7:hint')" /> </input> <input ref="/data/question0/question3/question6/question8"> <label ref="...

html - Cannot find the text inside `<span>` -

i have html below: <div class="info"> <h5> <a href="/aaa/">aaa </a> </h5> <span class="date"> 8:27am, sep 30</span> </div> i'm using ruby , want text "8:27am, sep 30" inside <span class="date"> . cannot find via command below. find('div.info span.date').text could please tell me why doesn't work? if find text inside h5 following command, can "aaa" correctly. find('div.info h5').text full ruby code then(/^you should see (\d+) latest items$/) |arg1| within("div.top-feature-list") # validate images of items exist, print report expect(all("img").size.to_s).to eq(arg1) puts "the number of items on current site " + (all("img").size.to_s) # list of items' details (image, headline, introduction, identifier, url) $i = 1 while $i ...

Are unaligned android APK's the same as unsigned APK? need to generate release apk that is unsigned -

i need generate apk in android studio unsigned. saw few other questions this. export unsigned apk gradle project in android studio the best answer saw go gradle tasks execute assemblerelease. generates 2 apks in /build/output/apk folder 1 says app-release-unaligned.apk. is unaligned same thing unsigned ? is debug build type same thing unsigned ? i tried adding second build type don't specify signing config ide complains t no , no. unaligned refers how data structured within apk (zip file). utility called zipalign modifies apk align data in way optimised readers. unaligned skips zipalign stage. has nothing apk signing. debug mode flag set within app indicate android app can launched (or attached by) debugger. again, technically, has nothing signing app, common practise use different signing key debugging app , signing final/release build real app signing key (which should kept secure).

Deleting nodes of a value in a Linked List in C++ -

i'm practicing coding exercises website , can't figure out i'm doing wrong in implementation. can please let me know i'm going wrong in code? the function removeelements should delete elements given value list. i'm trying obtain using function called removeelement (singular), , running until isn't able remove anything. /** * definition singly-linked list. * struct listnode { * int val; * listnode *next; * listnode(int x) : val(x), next(null) {} * }; */ class solution { public: bool removeelement(listnode* head, int val) { if (!head) return false; listnode* iterator = head; //deal case head value deleted if (head->val == val) { head = head->next; delete iterator; if (head == null) delete head; return true; } //head didn't match iterate through list while (iterator->next) { if (iter...

docker - Is there any reason to favour concatenated RUN directives over RUNning a script? -

when i'm creating dockerfile generate image, have options when comes installing , building stuff. i do run && \ b && \ c or copy install.sh /install.sh run /install.sh where install.sh is a b c are there substantial reasons favour 1 approach on other? in contrast other answer, prefer: run && \ b && \ c the main reason being clear happening. if instead use script, you've hidden code. new user understand what's happening, need find project build context before can script. it trade-off , once things complex, should refactor script. however, might prefer curl script known location rather copy it, dockerfile remains standalone.

asp.net mvc - Ckeditor does not show content in edit page -

i using ckeditor editor in blog, works charm in post page, in edit page can not load content. here way load ckeditor. <div class="editor-field"> <textarea id="ckeditor" name="content"></textarea> @html.validationmessagefor(model => model.content) @section scripts { <script type="text/javascript"> ckeditor.replace('ckeditor', { filebrowserimagebrowseurl: '/ckfinder/ckfinder.html?type=images', filebrowserimageuploadurl: '/statics/upload/' }); ckfinder.setupckeditor(null, "@url.content("/ckfinder")"); </script> } the content of textarea empty, there's nothing edit. must fill contents want edit.

Python - JIRA - Modify Labels -

This summary is not available. Please click here to view the post.

c++ - Why does my "string mingling" method return unexpected results? -

i'm trying implement simple "string mingling" method, recursively mingles 2 strings of equal size (e.g. cat , dog becomes cdaotg -- first letter string 1, first letter string 2, , on). my method follows: string minglestrings(string s1, string s2, int index) { if (index >= s1.length()) { return ""; } else { string mingled = ""; mingled += s1[index] + s2[index]; mingled += minglestrings(s1,s2,++index); return mingled; } } when use subscript operator on string (s1[index]), returns entire string index. specific character of string @ index, need type s1[index,index]. new me. the problem code on line: mingled += s1[index] + s2[index]; what adding codes of characters @ index , , appending result of addition string single character. it should 2 separate operations: mingled += s1[index]; mingled += s2[index]; this way append single character string each time call += , producing...

c# - How to open a pdf file in a WebForm application by search? -

when click on listbox search pdf file, it's not opening. the code below. thoughts? protected void button1_click(object sender, eventargs e) { listbox1.items.clear(); string search = textbox1.text; if (textbox1.text != "") { string[] pdffiles = directory.getfiles(@"\\192.168.5.10\fbar\report\clotho\h2\report\", "*" + textbox1.text + "*.pdf", searchoption.alldirectories); foreach (string file in pdffiles) { // listbox1.items.add(file); listbox1.items.add(path.getfilename(file)); } } else { response.write("<script>alert('for wafer id report not generated');</script>"); } } protected void listbox1_selectedindexchanged(object sender, eventargs e) { string pdffiles = listbox1.selecteditem.tostring(); string.format("attachment; filename={0}", filename)); processstartinfo infoopenpdf = new processstartinfo(); infoopenpdf.filename = pdffiles; ...

java - Why is my method returning infinity? -

the fifteen.monthypayment()); returning infinity every time run it. cannot figure out why. believe has years, because if change years value equal number, 15, not return infinity. thought myloan fifteen should change 15 me. can body tell me why code returning infinity? public class myloan { // instance members private double amountborrowed; private double yearlyrate; private int years; public double a; public double n = years * 12; // public instance method public myloan(double amt, double rt, int yrs) { this.amountborrowed = amt; this.yearlyrate = rt; this.years = yrs; } public double monthlypayment() { double = (yearlyrate / 100) / 12; = (amountborrowed) * ((i * (math.pow(1+i,n))) / ((math.pow(1 + i, n))-1)); return a; } public static void main(string[] args) { double rate15 = 5.75; double rate30 = 6.25; double amount = 10000; } myloan ...

c# - How can i update in live real time listBox adding items from another class? -

i have code in new class: private static bool enumwindowscallback(intptr hwnd, intptr lparam) { bool specialcapturing = false; if (hwnd == intptr.zero) return false; if (!iswindowvisible(hwnd)) return true; if (!countminimizedwindows) { if (isiconic(hwnd)) return true; } else if (isiconic(hwnd) && usespecialcapturing) specialcapturing = true; if (getwindowtext(hwnd) == programmanager) return true; windowsnaps.add(new windowsnap(hwnd, specialcapturing)); dostuff(new windowsnap(hwnd, specialcapturing)); return true; } public static void dostuff(object objtoadd) { foreach (form frm in application.openforms) { if (frm.gettype() == typeof(form1)) { form1 frmtemp = (form1)frm; frmtemp.additemtolistbox(objtoadd); } } } when running program it's getting line: dostuff(new windowsnap(hwnd, specialcapturing)); but it's never pass line: if (frm.getty...

io - Dislaying an output decimal with 2 places in java -

i'm trying find out why %.2f declaration when outputting decimal isn't working in code, i've check other questions similar cant seem locate issue in specific logic error i'm receiving. when go compile program compiles fine, go run , outputs fine till final cost i'm trying display decimal value 2 decimal places. i exception in thread "main" java.util.illegalformatconversionexception f! = java.lang.string @ java.util.formatter$formatspecifier.failconversion(unknown source) @ java.util.formatter$formatspecifier.printfloat(unknown source) @ java.util.formatter.format(unknown source) @ java.io.printstream.format(unknown source) @ java.io.printstream.printf(unknown source) @ cars.main(cars.java:27) here code: import java.util.scanner; public class cars { public static void main(string [] args) { scanner input = new scanner(system.in); int caryear, currentyear, carage; double costofcar, salestaxrate; double totalcost...

java - Error handling, throw exceptions, and user inputs -

i'm trying to user inputs(eg. file names) , store them arguments in function. however, both println's displayed simultaneously. blocks me entering arguments properly. think has throwing exceptions. cannot run program if don't add exceptions. public class demon { static scanner input = new scanner(system.in); public static void main(string [] args) throws exception { mainmenu(); }//end main public static void mainmenu() throws exception { system.out.println("welcome demon. please select option below:"); system.out.println("1: encrypt file"); system.out.println("2: decrypt file"); system.out.println("3: exit"); int useroption = input.nextint(); if (useroption == 1) { optionencrypt(); } else if (useroption == 2) { optiondecrypt(); } else if (useroption == 3) { system.exit(0); }else { system.out.println("invalid entry"); system.exit(0); ...

c# - Can I programmatically create a directory and add a page default.aspx whose content I wish to provide from code behind? -

what trying making directory each video upload , in each directory there default.aspx page show video. how can this? what have tried far :- directoryinfo di = directory.createdirectory("~/movies/" + next_id + "-" + txt_title.text); string filepath="~/movies/" + next_id + "-"+ txt_title.text+"/default.aspx"; if (file.exists(filepath)) { label1.text = "failed!"; return; } else { file.create(filepath); } but after if have no clue how append aspx elements file. please give hint

c++ - Emscripten can't find path to cmake -

Image
i've gone on instructions several times , looked in countless forums, , still can't resolve issue. i'm running windows 10, , trying install emscripten. i've got emscripten installed: i run # fetch latest registry of available tools. emsdk update followed by # download , install latest sdk tools. emsdk install latest but continues throw same warning being unable find path cmake. i've downloaded , installed cmake-3.3.2-win32-x86 . cannot create path installation though, because says file length long. odd, because installed here: c:\program files (x86)\cmake\bin i figured set path myself, as seen in post . therefore, used command after image above: set path="c:\program files (x86)\cmake\bin\";%path% and have same issue. i'm fresh out of ideas. have fact 64 bit versions of clang , sdk being installed, cmake comes in 32bit flavor? quotes aren't needed in path environmental variables on windows. set path=c:\progra...

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

this question has answer here: why spring mvc respond 404 , report “no mapping found http request uri […] in dispatcherservlet”? 3 answers i trying making simple bbs i'm encountering following error, warn : org.springframework.web.servlet.pagenotfound - no mapping found http request uri [/board/] in dispatcherservlet name 'appservlet' i have tried solve error many times, have failed. how can solve error? here web.xml, controllerand , servlet-context. my web.xml <?xml version="1.0" encoding="utf-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <filter> <filter-nam...

javascript - why does "HTML file select" changes the order of selected files and sort them alphabetically? -

i trying name of files selected "file" input in html: <input type="file" class="filestyle" name="file-select[]" id="file-select" accept="image/*" multiple> i wrote javascript code that: $('#file-select').on("change", function(){ var selectedfiless = this.files; (var = 0; < selectedfiless.length; ++i) { var name = selectedfiless.item(i).name; alert(name); } }); however, noticed names sorted in alphabetical order, not in selection order. example, if select z.jpg , a.jpg, when print names, have a.jpg, z.jpg (alphabetical order). want z.jpg, a.jpg (selection order). it'll appear based on how have sorted in system. mean if have set sort by ascending in system irrespective or order select, selected in ascending order , vice versa descending. have tested in code , results have mentioned above. a demo test in local systems.

javascript - How to show one image in modal -

<div class="row mt-xlg"> <h5 class="text-semibold text-uppercase mt-lg">timeline photos</h5> <?php $query1="select * user_photos_offline ssmid='$ssmid' , status='1' order date_uploaded desc"; $sql=mysql_query($query1); $count=mysql_num_rows($sql); $results=array(); while($row=mysql_fetch_assoc($sql)){ // $results[]=$row['image']; ?> <div class="col-md-3"> <img src="upload_images/<?php echo $row['image']?>" class="img-responsive" id='image' alt="" style='height:200px;' data-toggle="modal" data-target="#largemodal"> <!--here got images database--> <!--for example got total 10 images database--> <!--for exam...

Azure Cloud Service Startup task that needs to run a PowerShell script -

Image
all, note: have updated question after feedback. thanks @jisaak far. i have need run powershell script adds tcp bindings , other stuff when deploy cloud service. here cloud service project: here cloud service project , webrole project: here task in servicedefinition.csdef: and here powershell script want run: here attempt @ startup.cmd: when deploy in azure log: and in powershell log: any appreciated. i think there following other people syntax on web doesn't seem me there. thanks russ i think issue working directory of batch command interpreter when runs startup.cmd runs not expected. the startup.cmd located in \approot\bin\startup directory working directory \approot\bin . therefore command .\rolestartup.ps1 not able find rolestartup.ps1 looking in bin directory not in bin\startup directory. solutions know are: solution 1 : use ..\startup\rolestartup.ps1 call rolestartup.ps1 startup.cmd. soltuion 2 : change current working...

canvas - Android drawing on bitmap is disappear after touch up event -

i trying implement application image device , add canvas start drawing on using brush , eraser (like snapchat idea) used drawing app base http://code.tutsplus.com/series/create-a-drawing-app-on-android--cms-704 my problem when draw on bitmap start drawing when finished , touch drawing disappear. this video problem https://vid.me/rgnf (try mute sound there noise :) ) ‏any appreciated. thank you public class drawingview extends view { //drawing path private path drawpath; //drawing , canvas paint private paint drawpaint, canvaspaint; //initial color private int paintcolor = 0xff660000; //canvas private canvas drawcanvas; //canvas bitmap public bitmap canvasbitmap; //brush sizes private float brushsize, lastbrushsize; //erase flag private boolean erase=false; public drawingview(context context, attributeset attrs){ super(context, attrs); setupdrawing(); } //setup drawing private void setupdrawi...

c# - Dont create new user with ParseFacebookUtils and Xamarin -

i looking through documentation parsefacebookutils class , see there method can used login user in facebook id , token. great , want. however, when looked further documentation, saw if user given facebook credentials not exist, new user created. this deal breaker me. there no way disable , show user not authenticated? not want create new user if happens, want show login unsuccessful. you should associate user facebook details if want him login facebook account, according guide : if (!parsefacebookutils.islinked(user)) { // make browser control visible try { await parsefacebookutils.linkasync(user, browser, null); // user logged in facebook! } catch { // user cancelled facebook login or did not authorize. } // hide browser control } if dont want , want check if current facebook account exists, there written method this, have create own.

java - Issue with toString() Implementation in Android -

Image
i have more advanced class trying write tostring() for in order accomplish trying need able change assignment of variables when doing tostring() . to make simple going remove bunch of stuff except allows work. public enum packetelementtype { none((byte)0, "none"), byte((byte)1, "byte"), short((byte)2, "short"), int((byte)3, "int"), long((byte)4, "long"), float((byte)5, "float"), string((byte)6, "string"), bin((byte)7, "bin"); private final byte typevalue; private final string typename; packetelementtype(byte type, string name) { this.typevalue = type; this.typename = name; } public string gettypename() { return typename; } public byte gettypevalue() { return typevalue; } } public class packet { private final int default_size = 1024 * 2; private final int add_size = 1024; private b...

javascript - jquery.pep.js - Calling a function on droppable -

i'm using plugin called jquery.pep.js , it's working fine. have questioned isn't answered anywhere, google searches or docs included in plugin, how call function through event droppable area accepting draggable element? so far have found adding class built-in event aforementioned. calling function possible through method or have find plugin?

svn - XCode 7 Source Control commit fails -

i attempting commit xcode project server based svn. have configured, open source control window, , click on 'commit' button. chunks bit, gives me the error: working copy "xxx" failed commit files. couldn't communicate helper application. what helper application??? i've seen similar posts git, don't seem relevant (or @ least not enough info me) deal svn. there appears bug in xcode 7 may or may not encounter: when creating new project git repository, xcode 7 may tall “couldn’t communicate helper application”. same bug may tell “couldn’t commit files”. this happened me after upgrading xcode 6.x i’ve never had problem. turns out “helper application” in fact git: reason xcode 7 eager associate (the committer) name , email address. xcode offers access mac contacts upon first launch. to fix it, need launch our trusty terminal app (the command line tool) , tell xcode are, , errors thing of past. news has happen once. here’s how it: on ...

ios - Custom variable 'layer' used before being initialized -

i create custom calayer set items corner radius. func getlayercorner(radius:cgfloat) -> calayer { let layer:calayer layer.cornerradius = radius layer.maskstobounds = true return layer } i'm getting variable 'layer' used before being initialized i'm still learning swift , not sure how init it. the error states wrong code. need initialise layer before using: func getlayercorner(radius:cgfloat) -> calayer { let layer = calayer() layer.cornerradius = radius layer.maskstobounds = true return layer }

java - Add additional field in forgot_password.jsp in liferay -

i created hook , added 1 additional field in forgot_password.jsp . problem how handle it.i read should create action , action should change forgotpasswordaction.java . don't know struts , new liferay. u know how make input in forgot_password.jsp works: <aui:input label="<%= firstname %>" name="<%= firstnameparameter%>" size="30" type="text" value="<%= firstnamevalue%>"> <aui:validator name="required" /> </aui:input> i guess should name here: user user2 = (user)request.getattribute(webkeys.forgot_password_reminder_user); but should put in firstnameparameter? should it? the point add field forgot_password.jsp make user write first name in order change password. additional requirement page. here source of forgot_pasword.jsp: https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/login/forgot_password.jsp