Posts

Showing posts from February, 2013

java - Embedded Tomcat doesn't execute jsf pages -

solved: used wrong namespace, see explanation after post. when trying run embedded tomcat , navigating jsf page, jsf tags rendered page , doesn't executed. edit: added maven project to https://github.com/traugott/embedded-tomcat-example-jsf-dont-work.git simply clone with git clone https://github.com/traugott/embedded-tomcat-example-jsf-dont-work.git the file create tomcat embedded server is: package launch; import java.io.file; import org.apache.catalina.context; import org.apache.catalina.core.aprlifecyclelistener; import org.apache.catalina.core.standardserver; import org.apache.catalina.startup.tomcat; public class main { public static void main(string[] args) throws exception { string webappdirlocation = "src/main/webapp/"; tomcat tomcat = new tomcat(); tomcat.setport(8080); tomcat.setbasedir("."); tomcat.gethost().setappbase("."); tomcat.setsilent(false); // add aprlifecyclelistener stand

Merge two data in one row cgridview yii -

Image
is there way merge 2 data in 1 row? have gridview, within it, there products can sold bundle. if have right now, user can delete 1 of product bundle, , still receive bundle price. that's not good. how can merge 2 rows one? or possible add row indicates following 2 rows bundle? see picture, there's row. other thoughts having cgridview in cgridview? my database has column indicates whether product bundle or not. let me know if there information needed. you on complicating things believe. why not create html yourself? easiest solution far. if want want have extend cgridview , create rendering yourself. if want go route try study http://yiibooster.clevertech.biz/extendedgridview#groupgridview of features need.

xcode - Get Phillips Hue framework SDK running with Swift -

i'm trying huesdk_osx framework running using object-c-bridging-header. here framework: https://github.com/philipshue/philipshuesdk-ios-osx/blob/master/documentation/apireference_osx.zip bridging-header: #import <huesdk_osx/huesdk.h> swift file: import phhuesdk when typing "import huesdk_osx/" known code completion list appears classes framework, when selecting on of them xcode keeps on saying build error: "no such module" then, when ommitting import-directive , calling let hue = phhuesdk() hue.startupsdk() then no build error occurs instead linker error undefined symbols architecture x86_64: "_objc_class_$_phhuesdk", referenced from: __tfc8testapp211appdelegate12awakefromnibfs0_ft_t_ in appdelegate.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) additionally adding huesdk_osx.framework project apparen

Regex Help, anti-query replacement -

how remove lines have 3 or less slashes, retain bigger links? a. http://two/three/four b. http://two/three c. http://two a stay nothing else would. thanks search: (?m)^(?:[^/]*/){0,3}[^/]*$ replace: "" on demo , see how lines 3 or fewer slashes matched. these ones nix. explain regex (?m) # set flags block (with ^ , $ # matching start , end of line) (case- # sensitive) (with . not matching \n) # (matching whitespace , # normally) ^ # beginning of "line" (?: # group, not capture (between 0 , 3 # times (matching amount # possible)): [^/]* # character except: '/' (0 or more # times (matching amount # possible)) / # '/' ){0,3}

c - local variable referenced by a global pointer -

i have question here. have following code #include <stdio.h> int *ptr; int myfunc(void); main() { int tst = 3; ptr = &tst; printf("tst = %d\n", tst); myfunc(); printf("tst = %d\n", tst); } int myfunc(void) { *ptr = 4; } the local variables stored in stack. made global pointer *ptr , made point local variable in main. now, when call myfunc, local variables of main gets pushed onto stack. in myfunc, change value of pointer , after returning main, check value of local variable has changed. want ask in myfunc, pushed variable tst poped again value changed? beginner please don't mind. when functions call made, not variables pushed onto stack. arguments of functions pushed onto stack, i.e: ones in parentheses, this: myfunc(arg); . in case, arg pushed onto stack use in myfunc . key remember in c values in variables pushed, not variable itself. you might after this #include <stdio.h> int *ptr; int myfunc(int v

Writing text all time hidden when write something on EditText in Android? -

Image
my images. such when write show image but want write , show also. my codes : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#ffffff" > <!-- header aligned top --> <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <include android:id="@+id/header" layout="@layout/header" > </include> <!-- footer aligned bottom --> <!-- content below header , above footer --> <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" >

regex - find all links with regular expression in python -

this question has answer here: regular expression finding 'href' value of <a> link 7 answers i have text full of link address style href=\'http://address.com\' i use re.findall('"((http)s?://.*?)"', srccode) in python 3.4 extract links, doesn't work. how can fix it? swap quotes re.findall("'((http)s?://.*?)'", srccode)

c++ - How to use const qualifier with decltype? -

how use const qualifier decltype template -ed function ? current gcc rejects following : template <typename it> bool process(it first , last ) { return std::all_of( first, last, []( const decltype(*first)& ) // ^^^^^ without const works fine { return % 2 == 0; } ) ; } is legal/possible use i const reference inside lambda ? const decltype(*first)& doesn't work because decltype(*first) int& , expect int . can use std::remove_reference work around (although doesn't make code clearer): const std::remove_reference<decltype(*first)>::type&

javascript - Meteor: How to detect if users authenticated -

in app use accounts-github . works perfect, have 1 problem. in 1 of templates do template.bar.rendered = function () { if (meteor.user()) { // setup stuff } } the problem if user not logged in code not executed (thats ok). when user authenticates code not executed again. question how can listen change inside template (doesn't have in inside rendered function!)? you use deps.autorun . ( http://docs.meteor.com/#deps_autorun ) usually deps.autorun run whole meteor app. if want make runs per template need create , stop in rendered , destroyed template callbacks e.g var loginrun; template.bar.rendered = function() { loginrun = deps.autorun(function() { if(meteor.user()) { //stuff run when logged in } }); } template.bar.destroyed = function() { loginrun.stop(); } if don't need run per template (need run once app on template, can use deps.autorun on own, anywhere in client side code. meteor.user(

set datetime value in input html from php -

i try set value datetime input( change current value of variable date time), html show error ( seems it's fault format): the code : <input type="datetime" name="deadline" required value ='<?php echo date('c', $datedeadline); ?>'/> thx lot. if $datedeadiline indeed defined, should wrap strtotime() . on manual : string date ( string $format [, int $timestamp = time() ] ) you should provide timestamp , not string date. consider example: <?php $datedeadiline = '2014-06-21 12:32:00'; ?> <input type="datetime" name="deadline" required value="<?php echo date('c', strtotime($datedeadiline)); ?>" /> using datetime class timezone: <?php $date = new datetime('2014-06-21 12:32:00', new datetimezone('america/new_york')); ?> <input type="datetime" name="deadline" required value="<?php echo $date-&

java - How can i show the jpanel? -

i make movie theater system. , keep movies , movie theaters in jtable. i'm trying show movie theater. movie theater seats made jbutton , keep these seats in jpanel. how can show seats when movie theater selected? and code. final arraylist<jpanel> panels = new arraylist<>(); for(int k=0;k<theater.size();k++){ jpanel panel = new jpanel(); panel.setbounds(500, 0, 500, 500); contentpane.add(panel); int y = theater.get(k).getcapacity(); int x = 500/y; for(int i=0;i<y;i++){ for(int j=0;j<y;j++){ jbutton button = new jbutton(letters[i]+numbers[j]); button.setbounds(500 + x*j, 0 + x*i, x-5, x-5); panel.add(button); } } repaint(); panels.add(panel); } don't use setbounds() method instead leave layout manger set size , position of components why it's made for. use proper

vb.net - Data Access Layer Populate Combobox With Parameters -

i using vb.net (visual studio 2013) , n-tier architecture populate combo box list. code class below public shared function list() list(of appname.businesslogic.bll_rmcodecomboclass) dim dbo_rmcodelist new list(of appname.businesslogic.bll_rmcodecomboclass) dim conntemp sqlconnection = appclass.getconnection dim strselectsql string = "select [rmcode] [dbo].[rmmaster] [dbo].[rmmaster].[category] = '" & strrmtype & "'" dim strcommandselect new sqlcommand(strselectsql, conntemp) try conntemp.open() dim rdrtemp sqldatareader = strcommandselect.executereader() dim clsdbo_rmcodelist appname.businesslogic.bll_rmcodecomboclass while rdrtemp.read clsdbo_rmcodelist = new businesslogic.bll_rmcodecomboclass clsdbo_rmcodelist.rmcode = system.convert.tostring(rdrtemp("rmcode").tostring) dbo_rmcodelist.add(clsdbo_rmcodelist) loop rdrtemp.close(

sockets - Android library which works with scoket.io(1.0.4) using node js at server side -

i trying connect gottox ( https://github.com/gottox/socket.io-java-client ) socket.io (1.0.4)( http://socket.io/ ) unable connect think gottox doesn't work latest socket.io. is there other java/android library can use make socket connections between socket.io , android native application. i using node.js @ server side. looks https://github.com/nkzawa/socket.io-client.java supports latest socket.io 1.x version. haven't tried yet.

html - how to make the homepage responsive -

Image
i'm newbie css , want make responsive design mobile ie. "it appear blank page",but it's working in google chrome , other rest of browsers :-) below codes that's used html: <div class="main"> <div class="container"> <div class="marquee"> <marquee scrollamount="3" direction="right" dir="ltr"> <h3 align="center" style="color:#804000;font-size:large;margin-top:0px;"><strong> <img height="37" src="http://www.ghadaalsamman.com/new/images/image21.png"> </strong></h3> </marquee> </div> <a class="button" id="btn1" href="http://ghadaalsamman.com/new/site.html"></a> </div> </div> css: html { height: 100%; width: 100%; } body { background-image: url("

c# - Add reference to local folder -

i'm adding dll file reference , set copy local true everything ok , after build application, dll added output folder now question how Ι change local path? for example: my application path c:\myproject , want put dll c:\myproject\libs how can set dll path {applicatonpath}\libs not {applicationpath} ? when compile project, visual studio put has been compiled , set copy locally "output folder", depends on current compile configuration. if compiling in debug mode folder be: c:\your_solution_path\your_project_path\bin\debug if use release mode , be: c:\your_solution_path\your_project_path\bin\release however, reference lot of assemblies (dlls if will) , assemblies have dependencies of own. in order make "point , click" our convenience, must tell visual studio how act particular project build. so, totpero said, should go project properties , use functionality of pre-build , post-build events. name suggests, pre-build happens

How to subtract two string arrays in java as they are shown in code -

//what should subtract quan objin ? //means quan has values 1,2,7,9 , objin has values 5,6,7,8 how subtract result 4,4,0,1 want operation quan[]=quan[]-objin[] done? public static void equalizer(int i, int s, string quan[], string objin[]) { int j; scanner inp = new scanner(system.in); for(j=0;j<i;j++) { system.out.print(objin[j]+"="); objin[j]=inp.nextline(); } for(j=0;j<s;j++) { system.out.print(quan[j]+"="); quan[j]=inp.nextline(); } } there's subtract() method public string[] subtract(string[] sa1, string[] sa2){ list<string> r = new arraylist<>(); (int = 0; < sa1.length; i++){ if (i >= s2.length) { r.add(sa1[i]); continue; } try { r.add(string.valueof(integer.parseint(sa1[i]) - integer.parseint(sa2[i]))); } catch (parseexception e) { e.printstacktrace(); } } return r.toarray(new string[r.

Latest chrome 37.x.x font looks weird -

Image
i'm not sure if others have same problem, after upgraded chrome latest version (37.x.x), fonts become thinner , weird, below capture, as can see, 'neeson' looks little bit weird, should 1 word, in fact 'ees' combined together, gap between 'n' , 'ees' obvious, 'ees' , 'on'. anther 1 'about chrome' menu gone. i tried reset default setting, seems doesn't work @ all, bug or somewhat, i'm using 15.3 inch screen high dpi (1920x1080). any suggestion? enabling directwrite help, works me: https://www.tekrevue.com/tip/chrome-font-rendering-windows/

android - how to open different activities on clicking the items on navigation drawer? -

i start new app , in beginning select navigation drawer option eclipse ide gives me complete code of navigation drawer , running . but after clicking items increment numeric value present in xml . i want open different activities on click on sliding menu. where edit in code.let have 5 classes linked 5 different xml how can inflate them on screen on clicking item in navigation drawer button work. i'm new in plz guide me , tell me can edit mainactivity.java import android.app.activity; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.content.context; import android.os.build; import android.os.bundle; import android.view.gravity; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.support.v4.widget.drawerlayout; import a

Android Studio 6.0 merger fail -

just updated latest version of android studio , error in androidmanifest file manifest merger failed : attribute application@icon value=(@drawable/project_launcher_icon) androidmanifest.xml:48:9 present @ com.github.anupcowkur:reservoir:1.1.1:6:45 value=(@drawable/ic_launcher) suggestion: add 'tools:replace="icon"' element @ androidmanifest.xml:44:5 override i tried adding tools:replace="@drawable/ic_drawer" in manifest error: error:(44, 5) tools:replace specified @ line:44 attribute tools:drawable/ic_drawer, no new value specified any ideas? following android studio's suggestion , adding following attribute tools:replace="icon" should allow build app successfully, without resorting using old manifest merger (which isn't forward-looking solution indeed). of course, you'll first have declare namespace "tools" in order use it: <manifest xmlns:android="http://schemas.android.co

java - Simple Tomcat/ Servlets - Getting HTTP Status 404 -

i followed page's tutorial. http://www.coreservlets.com/apache-tomcat-tutorial/tomcat-7-with-eclipse.html , downloaded test-app zip file. file working perfectly. when try create simple helloworld servlet gives 404 error. have seen related questions on forum none of them seem address problem. using tomcat7 , java6 ee. able add links , access static web pages plain html pages 404 when try access servlets. servlet code. @webservlet(name="loginservlet1",urlpatterns={"/loginservlet1"}) public class loginservlet1 extends httpservlet { public void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { response.setcontenttype("text/html"); printwriter out = response.getwriter(); out.println ("<!doctype html>\n" + "<html>\n" + "<head><title>a test servlet</title></head>\n" +

c++ - What is the "right" way to use a GUID as the key in std::hash_map -

i want say std::hash_map<guid, int> foo; i believe must create bool operator < (const guid &guid1, const guid &guid2); std::size_t hash_value(guid const &b); what proper way compare guids? (memcmp?) - proper way generate hash? it'd great if flesh out these 2 functions, i've read dozens of posts give final clue :-) from documentation seems that: typedef struct _guid { dword data1; word data2; word data3; byte data4[8]; } guid; there several possibilities building own for comparison i'd go item item bool operator < (const guid &guid1, const guid &guid2) { if(guid1.data1!=guid2.data1) { return guid1.data1 < guid2.data1; } if(guid1.data2!=guid2.data2) { return guid1.data2 < guid2.data2; } if(guid1.data3!=guid2.data3) { return guid1.data3 < guid2.data3; } for(int i=0;i<8;i++) { if(guid1.data4[i]!=guid2.data4[i]) { retu

asp.net - How can bind list to GridView -

i have list in class , want use of list in other class , bind gridview. in class make list : namespace sample_table { public class classdal { public list<phone> getall() { using (practicedbentities1 context = new practicedbentities1()) { return context.phone.tolist(); } } } } and in class want use it: namespace sample_table { public partial class webform1 : system.web.ui.page { protected void page_load(object sender, eventargs e) { classdal obj = new classdal(); obj.getall(); gridview1.datasource = obj; gridview1.databind(); } } } but receive exception: data source invalid type. must either ilistsource, ienumerable, or idatasource. use tolist() extension method convert query list of items. classdal obj = new classdal(); list<phone> list = obj.getall(); gridview1.datasource = list.tolist();

app config - log file is not created using log4net -

i have downloaded log4net.dll , added service reference. 1 of project have created has app.config have made following configurations <?xml version="1.0"?> <configuration> <configsections> <section name="log4net"type="log4net.config.log4netconfigurationsectionhandler,log4net"/> </configsections> <log4net> <appender name="rollinglogfileappender" type="log4net.appender.rollingfileappender" > <param name="file" value="c:\\users\\<myid>\\desktop\\error.log"/> <appendtofile value="true" /> <rollingstyle value="size" /> <maxsizerollbackups value="10" /> <maximumfilesize value="10mb" /> <staticlogfilename value="true" /> </appender> <root> <level value="all" /> <appender-

tsql - SQL Server : how to move NOT NULL column(with its data) to another table? -

i have many many relation, want change 1 many relation. table has 2 fks dropped. one of fks in table moved table b. fks not nullable. my approach far this: add nullable column(fk) table b as. insert data table b table a. alter column not null . now question: can achieve without step 1? is there "better" approach? i see marc_s has mentioned in comment, people viewing question in future i'll again here. there no way in current version of sql server. if there shortcut, nothing more "syntactic sugar," say, you're talking about.

Cannot start my static file hosting server in ASP.NET vNext -

i have simple asp.net vnext wanted static file server. had used kvm upgrade install latest version , below project.json . { "dependencies": { "helios" : "0.1-alpha-*", "microsoft.aspnet.filesystems": "0.1-alpha-*", "microsoft.aspnet.http": "0.1-alpha-*", "microsoft.aspnet.staticfiles": "" }, "commands": { "web": "microsoft.aspnet.hosting server=microsoft.aspnet.server.weblistener server.urls=http://localhost:22222" }, "configurations" : { "net45" : { }, "k10" : { "system.diagnostics.contracts": "4.0.0.0", "system.security.claims" : "0.1-alpha-*" } } } and below startup.cs using system; using microsoft.aspnet.builder; namespace webapplication3 { public class start

java - Struts2 s:url for a image in s:submit not working -

i have jsp form: <s:form action="gestionpagos.action"> <s:hidden key="actividad.id" /> <s:submit type="image" src="<s:url value ="/internal resources/imagenes/alta.png"/>"> </s:submit> </s:form> but, when try render in browser, struts throws error: org.apache.jasper.jasperexception: /private/gestioncalendarios/menucalendario.jsp (línea: 144, columna: 1) /private/gestioncalendarios/listadoactividadcolaboradores.jsp (línea: 51, columna: 64) tag <s:submit not ended i'm pretty sure tag worked before, after update, didn't work anymore. i can make work using classic html input tag, or splitting button 2 steps: using url tag variable , then, using in src field of submit. want know why isn't working , correct form of tag. you can't use struts tags inside tag attribute. don't need provide action extension action attribute of s:form tag. rewrit

java - why hibernate no update field? -

i'm updating field in hibernate oracle database, doesn't. why hibernate doesn't update field leido ? if (mensajeid.getleido().equals("false")) { transaction tx = main.getsesion().begintransaction(); mensajeid.setleido("true"); mensaje mensaje = listamensajesrecibidos.getselectedvalue(); mensaje.setid(mensajeid); mensaje.setusuariobyemisor(mensaje.getusuariobyemisor()); mensaje.setusuariobyreceptor(mensaje.getusuariobyreceptor()); main.getsesion().update(mensaje); tx.commit(); } it seems try use update() method not managed instance. should use saveorupdate() or save() in case. if think entity in db instance not connected session should use merge() before.

oracle - Run SQL*Plus Script That Runs Other Script files -

ok, read this don't think answer matches question. believe op asking how create sql plus script runs other sql plus scripts chosen answer reveals how run sql script in sql*plus. i know how create sql plus script that, when run, executes other sql plus scripts within same directory. the given answer correct. create directory 2 files: control.sql second.sql make control.sql contain: set serveroutput on prompt "start of control" / @second.sql / prompt "end of control" / make second.sql contain: prompt "start of second" / prompt "end of second" / then run control.sql

How do I specify an object in ASP.NET Web API route decorations? -

i can understand this: [route("customers/{customerid}/orders/{orderid}")] [responsetype(typeof(ordermodel))] public ihttpactionresult getorderbyid(int customerid, int orderid) but how can set route decoration following 3 methods: // get: api/content public iqueryable<content> get() { return db.contents; } // get: api/content/5 [responsetype(typeof(content))] public async task<ihttpactionresult> get(int id) { content content = await db.contents.findasync(id); if (content == null) { return notfound(); } return ok(content); } // put: api/content/5 [responsetype(typeof(void))] public async task<ihttpactionresult> put(int id, content content) { if (!modelstate.isvalid) { return badrequest(modelstate); } } i cannot find examples of there no input parameters or input parameters contain objects json serialized in example working before tried user route decoration. not sure understand you'

generics - Java: Casting a List<?> without warning -

assume have following example code. first class: public class template<t> { private final t val; public template(t val) { this.val = val; } public t getval() { return val; } } second class: import java.util.arraylist; import java.util.list; public class app { public static void main(string[] args) { list<?> templates = new arraylist<template<?>>(); // how can cast without warning? list<template<?>> castedtemplates = (list<template<?>>)templates; // further code... } } so, question is: how can cast without warning , without @suppresswarnings("unchecked") ? why if can define list<template<?>> templates = new arraylist<template<?>>(); ?

php - How can I get mysql server to work in xampp? -

i have installed xampp in windows 7. when try run mysql following error: error: mysql shutdown unexpectedly. 12:27:51 pm [mysql] may due blocked port, missing dependencies, 12:27:51 pm [mysql] improper privileges, crash, or shutdown method. 12:27:51 pm [mysql] press logs button view error logs , check 12:27:51 pm [mysql] windows event viewer more clues 12:27:51 pm [mysql] if need more help, copy , post 12:27:51 pm [mysql] entire log window on forums within my.ini have changed port 3306 3307 because have different mysql server 5.6.19 running in computer well. still same error. please can me???? uninstalled xampp , installed again :(. just fixed same issue not 10 minutes ago. open xampp click on config click on service , port settings click mysql tab change main port click save then restart mysql service

c# - Get selected items in a RadGrid client-side -

i want values of selected checkbox in radgrid. have radgrid, textbox , button follows: this._radajaxpanel.controls.add(radgrid1); this._radajaxpanel.controls.add(textbox1); this._radajaxpanel.controls.add(buton1); the radgrid id set radgrid1 and button1.onclientclick = "getselecteditems("+ this._radgrid1 +")"; on click of button javascript called want know rows have been selected. javascript function follows not correct: function getselecteditems(grid) { var selectedrows = grid.get_selecteditems(); (var = 0; < selectedrows.length; i++) { var row = selectedrows[i]; var cell = grid.getcellbycolumnuniquename(row, "categoryid") //here cell.innerhtml holds value of cell } } please let me know how can selected rows. here how whether or not checkbox selected. using gridtemplatecolumn checkbox itemtemplate, telerik suggests using on gridcheckboxcolumn. the trick inner html in cell,

ios - How to draw (scribble) a route over map and get all lat-longs on that route -

i want give users ability draw route stop scroll when user drawing route. i want able draw route , lat-long points on route. you can transform cgpoint's of route they've painted cllocationcoordinate2d's.

javascript - AngularJS: Performing $http request inside custom service and returning data -

i have defined custom http service in angular looks this: angular.module('myapp') .factory('myhttpserv', function ($http) { var url = "http://my.ip.address/" var http = { async: function (webservice) { var promise = $http.get(url + webservice, { cache: true }).then(function (response) { return response.data; }); return promise; } }; return http; }); and can access service in controller so: angular.module('myapp') .controller('myctrl', function (myhttpserv) { var webservice = 'getuser?u=3' myhttpserv.async(webservice).then(function (data) { console.log(data); }) }); however need streamline process contained inside service static url , returns data. can call in controller so: angular.module('myapp') .controller('myctrl', function ($scope, myhttpserv) { console.log(myhttpserv.var1); console.log(myhttpserv.var2);

objective c - Swift nil values behaviour -

can send messages nil in swift same way can in objective-c without causing crash? i tried looking documentation , couldn't find relating this. not exactly, have use optional chaining . in swift, instance can nil if declared "optional" type. looks this: var optionalstring : string? notice ? after string makes possible nil you cannot call method on variable unless first "unwrap" it, unless use aforementioned optional chaining. with optional chaining can call multiple methods deep, allow nil value returned: var optionalresult = optionalstring.method1()?.method2()?.method3() optionalresult can nil. if of methods in chain return nil, methods after not called, instead optionalresult gets set nil. you cannot deal directly optional value until explicitly handle case nil. can in 1 of 2 ways: force unwrap blindly println(optionalstring!) this throw runtime error if nil, should sure not nil test if nil you can using simple if s

php - WordPress Child Theme including includes files -

i working @ wordpress setup on local computer using ampps localhost. using delta theme created child theme (delta2-child). initial setup works great. however, need change file in includes folder called home-slider.php. location of original file: c:\program files (x86)\ampps\www\armstrong\wp-content\themes\delta\includes\home-slider.php location of child theme files: c:\program files (x86)\ampps\www\armstrong\wp-content\themes\delta2-child\includes\home-slider.php if move home-slider file child theme folder[ delta2-child\includes\home-slider.php ], theme still uses parent themes home-slider file. if add following ct's functions.php file: require_once( get_stylesheet_directory_uri() . "/includes/home-slider.php" ); */ i following error: warning: require_once(c:\program files (x86)\ampps\www\armstrong/wp-content/themes/delta/includes/home-slider.php) [function.require-once]: failed open stream: no such file or directory in c:\program files (x86)\ampps

jquery - Long text will open on more button click -

i have long description text show users. @ first show short part of description. there "more >>" button open entire description. how can jquery or css. <div class="desc"> <h3>product description</h3> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. maecenas vel dui aliquam, semper mauris sit amet, imperdiet purus. fusce convallis, nisl @ imperdiet tincidunt, libero dui euismod tortor, eu ornare justo orci quis felis. morbi volutpat felis nisl, vel interdum nulla porttitor a. aenean est risus, malesuada orci at, aliquam mattis ipsum. proin porttitor metus dapibus nulla tempor scelerisque. morbi fringilla imperdiet dui, @ molestie justo rutrum mattis. nunc in ultricies lorem. quisque ut orci nec nibh facilisis imperdiet ac sit amet lacus. sed tempus condimentum velit et porta. etiam in lectus sapien. in hac habitasse platea dictumst. integer tincidunt pulvinar lorem, vel placerat diam.</p> </div> edi

sharepoint - Feature update on production server -

i'm not experienced sharepoint developer , have following scenario here. i've been working on sharepoint solution has 4 packages. after have done development, tried deploy wsp's on production server. went wrong. when updating first solution package, got following error message: directory "x" associated feature 'xxx’ in solution used feature 'xxx' installed in farm. features must have unique directories i've googled lot , recurrent solution retract solution package e add again, , maybe delete feature folder. i've been wondering why can't search id of features in production environment , hard code id on solution, in template xml of feature. best approach follow?

hdfs - browse file system link - hadoop - localhost link -

i using hadoop 2.2 on ubuntu. i able load link in browser. http://[my_ip]:50070/dfshealth.jsp from there, when click "browse filesystem" link, sent to http://localhost:50075/browsedirectory.jsp?namenodeinfoport=50070&dir=/&nnaddr=127.0.0.1:9000 while here think want my_ip instead of localhost , 127.0.0.1 also, if type manually http://my_ip:50075/browsedirectory.jsp?namenodeinfoport=50070&dir=/&nnaddr=my_ip:9000 it still not work. the my_ip external/global ip throughout whole question text. how can working? want able browse hdfs filesystem browser. core-site.xml <configuration> <property> <name>fs.default.name</name> <value>hdfs://localhost:9000</value> <!-- <value>hdfs://my_ip:9000</value> --> </property> <!-- fs.default.name hdfs://localhost:9000 --> </configuration> hdfs-site.xml <?xml version="1.0" encoding=&qu

PayPal Payment - Do a payment in one step -

i have form people can order 1 single item fixed amount of money. here steps: customer fills out form customer hits submit , proceeds review page can check inputs in review form should button pay paypal (button own design , text) customer hits button, proceeds paypal, makes payment after paid or not should redirected form on site can see result of payment wehter payment succeeded or not can see message generated form application out of paypal return string i tried thing can after submits form logs paypal, hits "continue" button , redirected site can review order again , needs hit "pay" again order processed. so want customer inputs , reviews on site , after hits "pay" button in own style , proceeds paypal pays order without getting site until payment done. should redirected site , receives appropriate message. what kind of paypal function need? hope clear enough. please let me know if need further information. thank in advance.