Posts

Showing posts from August, 2010

c# - How to set programmatically baseAddress for both client and server? -

currently baseaddress fixed in app.config file both service , client app.config both service , client <host> <baseaddresses> <add baseaddress="http://localhost:8080/service" /> </baseaddresses> </host> is possible programmatically? like baseaddress = txtbaseaddress.text; or any? you cannot update base address using servicehost readonly. have pass set of baseaddress servicehost constructor or have use configuration file. please refer following links msdn msdn blog

loops - How to remove the gap between lopping an audio file Android -

i'm trying play audio file x number of times, , show value of x user. problem can use mp.setlooping(true) inorder loop audio without gaps between looping, cant handle number of repetitions it. used oncompletionlistener fine, produces 1sec gap @ end or beginning of each repetition. if use mp.setlooping(true) no gap between looping. if use oncompletionlistener noticeable gap between looping. the gap produced on android 4.x.x , 3.x.x . how can rid of gap ? in advance.. my code: int n = 1; int maxcount = 15; //this value changes according user input. private void mpplay() { // todo auto-generated method stub mp.start(); mp.setoncompletionlistener(new oncompletionlistener() { @override public void oncompletion(mediaplayer mp) { if (n <= maxcount) { mp.start(); n++; tv.settext("counter:" + n); if (n >= maxcount) { n = 1;

php - Symfony2: class included in AppKernel can not be found on webserver -

i added project fosuserbundle, on localhost it's works fine. on web server fatal error: class 'fos\userbundle\fosuserbundle' not found in /home/zone24/domains/zone24.linuxpl.info/public_html/worldclock/app/appkernel.php on line 22 i can't cache:clear because same message. autoload.php <?php use doctrine\common\annotations\annotationregistry; $loader = require __dir__.'/../vendor/autoload.php'; // intl if (!function_exists('intl_get_error_code')) { require_once __dir__.'/../vendor/symfony/symfony/src/symfony/component/locale/resources/stubs/functions.php'; $loader->add('', __dir__.'/../vendor/symfony/symfony/src/symfony/component/locale/resources/stubs'); } annotationregistry::registerloader(array($loader, 'loadclass')); return $loader; the line appkernel.php make mistake new fos\userbundle\fosuserbundle(), folder friendsofsymfony in /vendor has 775 permisions are using apc ?

Couchbase document dates search - DateTime.Now() -

i have document in cb has 2 dates, start date , end date. let's say, product's price discount. 10% off starting today , ends next friday. how can documents cb have valid discount today? i made view , have following in it: var dt = new date(); which gets today's date. can simple if(doc.fromdate < dt && doc.todate > dt){ emit([ ..... ]); this filters documents how want. but... question is approach re view , index updating? index update every day because date changed? trying understand working of cb in respect what best approach type of searching? if not possible please tell me! cheers robin note: please note, question not here or here the index won't updated because system date changed, have update document. view indexer doesn't allow pass arguments defined user. in case should emit data , use date part of key filter on view query. guess same behaviour sql indexes too. cannot predict when document indexed, in example f

c# - Can't find myDockPanel.DockAsMdiDocument() -

i can't find dockasmdidocument() method of dockpanel. added available devexpress references still there no such function. i want docpanel fill form in load event ( because know not possible in design view ). missing ? how can without dockasmdidocument method ? i'm using devexpress version 11.1.4 c3 visual studio 2010 on windows 7 x64. instead of using dockasmdidocument alternatively can dock dockpanel creating new document object following: mydockpanel.dock = dockingstyle.float; //this because documentmanager can dock floating dockpanel, because works forms. document doc = tabbedview1.controller.registerdockpanel(mydockpanel.floatform) document; tabbedview1.controller.dock(doc); put on dockmanager's load event if want use code on start up.

php - Saving fields and loading them -

i making program diving coach calculates dive score judges enter judgement. problem having fields clear when press submit. additionally, able save dive sheet , able reload data within after navigating away, reloading, or closing , reopening. maybe later allow multiple sheets of different dates per diver, can later. i hiding lot of errors setting variables $_get code, filling lot of space warnings. this code: <tr> <td> <form action='guest6.php' method='get'> 1. <input placeholder='judge 1 score' autocomplete='off' name='score1a'> </td> <td> <input placeholder='judge 2 score' autocomplete='off' name='score1b'> </td> <td> <input placeholder='judge 3 score' autocomplete='off' name='score1c'> </td> <td> <input placeholder='enter dd' autocomplete='off' name='dd1'> <input

Jquery get tr value -

this question has answer here: select <tr> class before button using jquery 1 answer in below code want values specified in jquery.means want value of tr class=2 how can achive this? <div class="fav"> <table> <thead></thead> <tbody> <tr class=1"> <td>........ </td> >/tr> <tr class=2> <td>......</td> </tr> <tr class="3"> <td>........ </td> </tr> </tbody> if want html of row, try this, should meaningful name class , should alpha numeric if not aphabetical. live demo $('tr.2').html() you have many errors in html of not closing class attributes in quotes , using angle bracket of tr . check corrected html . <div class="fav">

regex - Java―escape string to use in RegExp -

i bit new java, unsure if doing things should or not. developing program, more learning java purpose , thought commandline use. 1 of features should kind of search replace. starting program commandline this: java -jar pro.jar -s ${ftp://www.stuff.com} -r foo means: search exact string ${ftp://www.stuff.com} , replace foo . want search regexp, have escape escape-characters ($,(,{,},\,…) in search string. ${ftp://www.stuff.com} --> \$\{ftp:\/\/www\.stuff\.com\} therefore wrote function: private static pattern getsearchpattern() { string searcharg = cli.getoptionvalue( "s" ).trim(); stringbuffer escapedsearch = new stringbuffer(); pattern metas = pattern.compile( "([\\.\\?\\*\\{\\}\\[\\]\\(\\)\\^\\$\\+\\|\\\\])" ); matcher metamatcher = metas.matcher( searcharg ); while( metamatcher.find() ) { metamatcher.appendreplacement(escapedsearch, "\\\\\\\\$0" ); } metamatcher.appendtail( escapedsearch );

ios - UIViewController -dealloc method not called -

i working automatic reference counting. have custom uiviewcontroller subclass , whenever call -presentviewcontroller: animated:completion: or remove view superview nslog "i dealloced" know view controller has been removed. have implemented -dealloc method in view controller. started test project had 2 uiviewcontroller instances (no retain cycles) , -dealloc not called either when push second uiviewcontroller modally or when remove superview or when remove parent view controller. missing ? in original project (not test case) instruments shows me controllers leave memory footprint can't rid off. if want switch view controllers, , have 1 you're switching away deallocated, switch root view controller of window. so, if you're in vc1 , want go vc2, in vc1: vc2 *vc2 = [[vc2 alloc] init]; // or else appropriate instance of class self.view.window.rootviewcontroller = vc2; if haven't created property point vc1, deallocated after making switch.

c# - How to create table set from several XSD in SQL Server 2012 or with VS 2012 -

Image
is there solution in t-sql or in c# how create xml schema collection in t-sql or c#. problem cannot use: use database_test go create xml schema collection collection_from_xsd n' ................. text of xsd ............... go because have lot of xsd (about 30) having dependency among themselves. i´d like: use database_test go create xml schema collection collection_from_xsd n'c:\work\xsd\exange_format\vymennyformattypy.xsd' but throws me error msg 2378, level 16, state 1, line 2 expected xml schema document. so i´d ask how create schema xsd in t-sql or in c# in visual studio 2012 project. have access sql server 2012 full permission managing database, i´d prefer t-sql, if there won´t other choice use c#. database used local database of exchange format of addresses , real estates, first step populate database xml second step update database every week other xml files example attached picture of xsd , xsd summary visual studio. thank much

grails cloud-hosting recommendation -

i'm looking cloud-hosting grails app. in past, i've tried several including cloudfoundry, jelastic, appfog, never deploy app. app needs: mysql database file system access in order store searchable plugin index files , images uploaded users i'll using site qa, not concerned performance. i'd simple possible deploy app, , i'd pay little possible hosting. i've tried using cloudfoundry grails plugin deploy cloudfoundry, without success. i have hosted grails based websites on amazon ec2. reduce cost, used small reserved instance. think it's ok use amazon ec2 ami temporary files such searchable index files since can re-index if ami crashes. to store user images, used amazon s3 using grails aws sdk plugin ( http://grails.org/plugin/aws-sdk ). easy upload files s3 using amazon sdk http://blanq.github.io/grails-aws/1.2.12.1/index.html - to upload file public read permissions. amazonwebservice.s3.putobject(new putobjectrequest('some-gr

javascript - How to include .js file in google app engine project -

i have .jsp page frontend of app. need include seperate .js file in page. my directories this src |--->com.stuff |--->servlet.java war |-->web-inf |--->pages |---->page.jsp include.js from java servlet call requestdispatcher jsp = req.getrequestdispatcher("/web-inf/pages/page.jsp"); which works fine in page.jsp have this <!doctype html> <html> <head> <title>page</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"type="text/javascript" ></script> <script src="./include.js" type="text/javascript" ></script> </head> <body> <h1>page</h1> </body> </html> i've tried few differnet things in place of "./include.js" , error firebug saying "networkerror: 404 not found - http://localhost:88

java - When I change servlet content in doPost, nothing happens -

Image
here piece html code: <form action="loginservlet" method="post"> username: <input type="text" name="username"><br> password: <input type="password" name="password"> <input type="submit" value="log in"> </form> and here servletcontextlistener: public class datalistener implements servletcontextlistener { private accountmanager accs; servletcontext context; /** * default constructor. */ public datalistener() { // todo auto-generated constructor stub } /** * @see servletcontextlistener#contextinitialized(servletcontextevent) */ public void contextinitialized(servletcontextevent e) { accs = new accountmanager(); context = e.getservletcontext(); context.setattribute("accounts", accs); } /** * @see servletcontextlistener#contextdestroyed(servletcontextevent) */ public void contextdestroyed(servletcontextevent e) { con

How to open intent and add value android -

i have trouble returning value intent in android. situation: have activity a, opened when start application. when click on button start activity b. in activity b fill in edittext , return string. click on button in activity b return activity a. don't know method should use in activity use value returned activity b. this kind of situation fits startactivityforresult , onactivityforresult . when press on button, instead of calling startactivity call startactivityforresult in order start activityb . in activityb when click on button, have fill intent values want return activitya and, in order, call setresult(result, intent) , finish() . onactivityresult of activitya receive intent data activity docs

c# - PDFBox 0.7.3 convert pdf to text -

i want convert pdf file text file of pdf files not work pdfbox dll version of acrobat in newer acrobat 5.x please tell me do? output.writeline("begin parsing....."); output.writeline(datetime.now.tostring()); pddocument doc = pddocument.load(path); pdftextstripper stripper = new pdftextstripper(); output.write(stripper.gettext(doc)); your first attempt should try current version of pdfbox. version 0.7.3 dates 2006! pdfbox meanwhile has become apache project , located here: http://pdfbox.apache.org/ , current version (as of may 2013) 1.8.1. , i'm sure pdfbox nowerdays support pdf object streams , cross reference streams new in pdf reference version 1.5, version adobe acrobat 6 has been built for if not work, might want try other pdf libraries, e.g. itext (or itextsharp in case) version 5.4.x if agpl (or alternatively buying license) no problem you. information on text parsing using itext(sharp) can found in chapter15 marked content , parsing pdf

php - javascript triggers "onmouseover" and "onmouseout" when i hover the div in another div -

i working on grid layout new website. php code: echo"<div class='model_container_invisible' onmouseover='fade(this, 0)' onmouseout='fade(this, 1)'>"; echo"<span class='model_title_wrapper'>"; echo"<span class='model_title'>ancient dragon</span>"; echo"<span class='model_designer'>designed kamiya satoshi</span>"; echo"</span>"; echo"<img class='model_img' src='img/models/001.jpg' />"; echo"</div>"; this on grid element. opacity of image 0.5, want change when hover element js function fade(). here code: function fade(elem, direction) { /* if(elem.classname == "model_container_invisible") elem.classname = "model_container_visible"; else elem.classname = "model_container_invisible"; */ var

javascript - Placing Geolocated Coordinates in a jQuery File -

i having difficulty inserting geolocated coordinates (latitude , longitude) of current user's location php/mysql generated xml file. requires user's geolocation correctly generate 20 closest businesses within 30-mile radius. using jquery-powered store locator script generate map. script works fine static url xmllocation, when try use variables in url outputs undefined alert message. aim javascript place latitude , longitude values of user's location php variables xml generator can generate correct output. looks this: locationglobal = 'data/gen_default_map.php?lat=' + lat + '&lng=' + lon + '&radius=30'; and should ouput this: data/gen_default_map.php?lat=34.383747&lng=-82.364574&radius=30 i have made modifications script , placed comments accordingly. need concern first 42 lines of code, in case here script in it's entirety: /* user's current location , place in url */ /*---------------------------------------

python - Tkinter: adding existing content to a frame -

i'm working on simple text based game in python/tkinter, , made basic setup far. displays intro. text, , can type(this still work in progress). however, realized there going lot of text, , thought of frame's scrollbar capability. however, added current content frame , functions don't work now. following someone's example, don't know if it's right. here code: from tkinter import * w=tk() w.configure(background="navy") w.iconbitmap(default="blankicon.ico") w.title("decimated world") w.resizable(0,0) introtext="when wake, see sky dark; can't tell time of day." scen1="you head toward town hall." class app(frame): def __init__(self,w): frame.__init__(self,w) def key(event): print event.char t=text(w) t.insert(insert,introtext) t.configure(state=disabled,background="navy",foreground="white") t.pack() def do_command(command): t.configure(state=normal) t.insert(insert

jquery - Page not modified after call Ajax in MVC4 -

hello new ajax , mvc. trying receive data webapi app in mvc page using jquery ajax having problem page not updating data when check in output of visual studio see received , give http status 200 "ok" in page no data displayed here goes code of page @{ viewbag.title = "index"; <script src="~/scripts/jquery-ui-1.8.24.min.js"> </script> } <script type="text/javascript"> $(document).ready(function () { $.ajax( { type:'get', url: 'http://localhost:45624/api/vehicles/', datatype:'json', sucess: function(data){ $.each(data, function (index,element) { $("#grid").append("<tr><td>" + element.maker + "</td><td>" + element.model + "</td><td>"

Mail-list implementation (database design) -

i refactoring web-app. right there 'contact' table has one-to-one correspondence main 'client' table, bool indicating if clients want receive mail. mail-list accessed once per month, , clients' profile page accessed many times day. thinking if 'cleaner' make new table client ids of in mail-list, querying if key in table should take same time accessing information. should that, or should leave is? thanks, joyce an association table (clientid, emailid) normalized form. think better keep this. if want show contact emailid in ui screen, can avoid inner join overhead due new association table. however in future if came across requirement have multiple emailids associated clientid, think creating association table then.

java - JPA OneToMany eager fetch does not work -

i have weird problem 2 entities one-to-many relation in jpa. using glassfish 3.1.2.2 eclipselink 2.3.2. first entity: @namedqueries({ @namedquery(name="samplequerygroup.findall", query="select g samplequerygroup g") }) @entity public class samplequerygroup implements serializable { // simple properties, including id (primary key) @onetomany( mappedby = "group", fetch = fetchtype.eager, cascade = {cascadetype.remove, cascadetype.merge} ) private list<samplequery> samplequeries; // gettes/setters, hashcode/equals } and second one: @entity public class samplequery implements serializable { // simple properties, including id (primary key) @manytoone(cascade = {cascadetype.persist}) private samplequerygroup group; // gettes/setters, hashcode/equals } i have stateless session bean uses injected entitymanager run samplequerygroup.findall named query. have cdi managed bean

c# - How to abort a list of tasks from the outside -

i still new threading model in .net 4.5 (or threading in general matter). trying build set of abstract classes in order implement framework multithreading series similar tasks. rules first line of input tells how many problems in set, , following lines contain input each problem. how many lines of input make set can vary 1 task next, consistent given type of problem. each problem have single line of text output. the goal able inherit these classes , have worry implementing createworker , dowork methods. ui call processinput things started, , writeoutput list off results. the basic template have far is: public abstract class wrapper { protected int n; protected workerbase[] problemset; protected list<task> tasks; public virtual void processinput(textreader input) { string line = input.readline(); n = int.parse(line); problemset = new workerbase[n]; tasks= new list<task>(n); (int index = 0; index <

openscenegraph - When building with cmake, prevent a third party library from using its own implementation of a find module, if CMake already comes with one -

rephrased question how can control order in cmake uses findxxx.cmake modules? my exact issue for example, openscenegraph comes own findzlib not findzlib cmake comes with.the findzlib module comes osg not able find zlib installation. have zlib installed in cmake_install_prefix path. during build, cmake warns me this. osg sets module path own dir, , findpng (from cmake) improperly uses findzlib openscenegraph comes with. , so, fails find zlib. how can prevent happening? i'm building openscenegraph through call externalproject_add. i've read setting cmake policy (cmp0017 precise) might fix it? not know how through externalproject_add. more details this related warning when cmake (called generated visual studio solution) tries configure , build osg: 4> cmake warning (dev) @ c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/findpng.cmake:34 (find_package): 4> file c:/program files (x86)/cmake 2.8/share/cmake-2.8/modules/findpng.cmake 4> i

Ruby and RVM cannot install ruby-1.9.3-p392 -

i check versions of ruby have right command. vincents-macbook-pro:~ vincentwarmerdam$ rvm list known # mri rubies [ruby-]1.8.6[-p420] [ruby-]1.8.7[-p371] [ruby-]1.9.1[-p431] [ruby-]1.9.2[-p320] [ruby-]1.9.3-p125 [ruby-]1.9.3-p194 [ruby-]1.9.3-p286 [ruby-]1.9.3-p327 [ruby-]1.9.3-p362 [ruby-]1.9.3-p374 [ruby-]1.9.3-p385 [ruby-]1.9.3-[p392] [ruby-]1.9.3-head [ruby-]2.0.0-rc1 [ruby-]2.0.0-rc2 [ruby-]2.0.0[-p0] ruby-head the list goes on , on can see there many versions of ruby 1.9.3. try switch newer version of 1.9.3, error. vincents-macbook-pro:~ vincentwarmerdam$ rvm use 1.9.3 ruby-1.9.3-p392 not installed. install do: 'rvm install ruby-1.9.3-p392' this seems odd me because can see [ruby-]1.9.3-[p392] appear in list. when try install this: vincents-macbook-pro:~ vincentwarmerdam$ rvm install ruby-1.9.3 searching binary rubies, might take time. no binary rubies available for: osx/10.7/x86_64/ruby-1.9.3-p392. continuing compilation. please read 'rvm mount'

ide - SharpDevelop Drag-and-Drop a external file to a project as a link -

in #develop (sharpdevelop ide) i can add file project link via : right click in project -> add -> existing item -> add link but how can via drag-and-drop... i've tryed usual stuff, pressing shift or ctrl or alt + drag-an-drop file nothing seems work... :( help need.. this not supported in sharpdevelop. out of interest checked visual studio , looks visual studio 2010 not support visual studio 2012 if hold ctrl+shift when drop files. looking @ sharpdevelop source code copies files or directory dropped onto projects window.

osx - How can I pass the name of the file that was changed in launchd? -

i trying watch directory changes via launchd. plist file looks this: <key>programarguments</key> <array> <string>/users/myname/bin/boink</string> <string>path modified</string> </array> all works ok, pass name of file changed argument script /users/myname/bin/boink is possible? man page isn't helpful, nor did googling lot. thanks. the short answer is: no. launchd(8) uses kqueue ( http://en.wikipedia.org/wiki/kqueue ) receive kind of notification. unfortunately kqueue(2) not return which item has triggered event. you may want use launchd(8) key queuedirectories instead. works same way watchpaths works, assumes processing agent/daemon moving processed items directory being monitored one. whenever event triggered job can process every file in monitored directory. make sure move them after processing.

ruby on rails - Web Dynos in Heroku -

i wanted see best practice in following situation be. i have setup scheduler in heroku app run 2 rake tasks, (performs screen scrape), these ran once day, have read have 750 hours free per month of dyno processes accrue usage when dyno idle.. need run heroku ps:scale web=0 so dyno doesnt accrue usage when not running or leave is? what best thing here? thanks if haven't added more web workers should on free tier. if log heroku account , go app's dashboard you'll see estimated monthly cost resources used, can double check it's on $0 . i tested both heroku ps:scale web=0 , heroku ps:scale web=1 on 1 of apps. both leave cost @ $0 , , app still online 0 web workers, i'm not sure how works. you pay scheduler, time call rake task. might few dollars per month, or perhaps less dollar, depends how long for.

c++ - curl_easy_perform return CURLE_WRITE_ERROR, but I won't write nothing -

i wrote simple code check network connection or our ios apps: int cl_network::checkconnectionint1(){ curl *curl; curlcode res; curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, curlopt_verbose, 1); curl_easy_setopt(curl, curlopt_url, "http://www.google.com"); res = curl_easy_perform(curl); curl_easy_cleanup(curl); return res; } curl_easy_cleanup(curl); return -1; } our test ok, return 0 when wi-fi enabled, apple reviewer return 23 (curl_write_error) wi-fi enable or disable. the reviewer tells others strange behaviors (considering wi-fi enabled) ipod touch ios 5.1 returns 0, same wi-fi iphone5 ios 6.3 returns 23 iphone 5 ios 6.3 run step step debug returns 0 (i don't know if happened 1 time or always) have suggestions? last note, verbose output of curl_easy_perform about connect() www.google.com port 80 (#0) trying 173.194.35.20... connected connected www.google.com (173.194.35.20) port

git - Gitolite permissions: How use the "-" thing? -

i'm trying set gitolite permissions i'm not sure how use - thing. situation: have 2 groups; @gatekeepers , @devs . want both groups able work in remote branches except master branch. supposed able pull master branch though. so far have this, i'm positive doesn't work: repo foo - master = @devs @gatekeepers rw+ = @devs @gatekeepers if understand correctly, disallow groups doing @ (reading or writing) master branch. what way properly? for stated purpose (which iiuc disallow push master), original code in question fine; indeed prevent push master both groups mentioned. adding deny-rules option makes no 1 can clone. recap: deny-rules option makes deny rules honored pre-git access check also. means, (as doc says), refexes ignored -- in fact don't know ref pushed, if push operation.

automation - Selenium webdriver Java how to wait until a link is present -

i have link press , runs js , new link generated on page has text "view report" how can wait on page until link present , clickable, or timeout if not displayed in 5 minutes? i have seen question asked few times , tried of solutions can't work. i've tried rubbish way of waiting minute link takes longer appear fails. try webdriverwait wait = new webdriverwait(driver, 60);// 1 minute wait.until(expectedconditions.visibilityofelementlocated(by.linktext("view report")));

javascript - Write how manu characters left in textbox -

i have textbox max value of 10, , want #pid p tag write number of remaining characters. html: <textarea id="content" maxlength="10"></textarea> <p id="pid">max 10 chars</p> javascript: var content = document.getelementbyid('content'); var pid = document.getelementbyid('pid'); function charsleft() { (var = 10; >= 1; i--) { contentcount = 10; pid.innerhtml = parseint(contentcount - 1); } } content.onkeypress = charsleft; all managed when start typing, see 9, keep typing stays 9. fiddle i want pure js, no libraries. function charsleft() { pid.innerhtml = content.value.length > 0 ? content.getattribute("maxlength") - content.value.length + " chars left" : "max 10 chars"; } content.onkeyup = charsleft; see demo .

Apache Tomcat doesn't find Native library -

i maintained countless instances of tomcat run problem never ran before. i known log message tomcat complains can't find native lib @ d:\programme\apache software foundation\tomcat 7.0\bin: "the apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: d:\programme\apache software foundation\tomcat 7.0\bin; [...]" as usual put native lib "tcnative-1.dll" bin-folder of tomcat (and yes, @ drive d:!!), tomcat furthermore complains missing native lib. i tried specify - djava.library.path @ startup, without success. there no further messages in log may indicate other problems @ startup. why doesn't tomcat find native lib? the web full of stupid trial-and-error-approaches , tomcat documentation doesn't explicitly describes under circumstances doesn't take native lib in bin-folder. additional info: apache tomcat 7.0.8 jvm 1.6.0_29-b11 check i

liferay - Customizing portal's navigation bar -

i want customize navigation bar in theme. searched css file styles navigation bar in css directory couldn't find it. in nagivation.vm file, navigation declared follows: <nav class="$nav_css_class" id="navigation"> and using firebug found out class is sort-pages modify-pages . i appreciate help. thanks the css file called css/navigation.css . however, best practice modifications in _diffs/css/custom.css - file loaded last , settings in there override in navigation.css , other files. side effect, you'll have of settings neatly separated liferay's , in better position during updates. custom.css supposed empty in themes meant extension. if start classic theme, you'll see custom.css in there not empty - means, classic theme not meant extended. technically can still of course, liferay might change theme without notice in future versions , you'll end upgrading then.

While writing data in MySQL through PHP, add current date and time -

i'm gathering info website put in mysqldatabase. @ moment cannot find out how date , time in database. i tried several things, can help? $write="replace `".$database."`.`db` (`1`,`2`,`3`,`4`,`5`,`6`,`7`,`datetime`) values ('".$1."','".$2."','".$3."','".$4."','".$5."','".$6."','".$7."','**so need place here**')"; echo $write; $query = mysql_query($write) or die (mysql_error()); in database no matter put in php, 0000-00-00 00:00:00. just passed value now() , example insert tb(col1) values(now()) as sidenote, query vulnerable sql injection if value( s ) of variables came outside. please take @ article below learn how prevent it. using preparedstatements can rid of using single quotes around values. how prevent sql injection in php?

subquery - IF..ELSE-statement in SQL SELECT? -

i'm trying make user activity feed displays users' activities friends of logged-in user. the fields user1 , user2 friend request sender , friend request receiver. problem logged-in user in either field i'm wondering how can make if..else statement particular issue. basically want: if user2 $log_username select user1 friends... else select user2 friends. the boldfaced code(subquery) 1 i'm referring specifically. $sql = " select * status author in ( select user2 friends user1='$log_username' , accepted='1' or user2='$log_username' , accepted='1' ) , type='a' "; any appreciated. the if within sql statement case . (not sure if gives want demonstrate concept). $sql = " select * status author in ( select case when user2 = '$log_username' user1 else user2 end friends user1='$log_usernam

php - update query not work -

this full code of page using update data.i tried many time still not updating values in database..also tried echo still not updating <?php session_start(); include '../func-tion/func.php'; if(isset($_session['m_uname']) && isset($_session['m_pass'])) { ?> <?php if(isset($_post['subup'])) { $sql="update appid set android_appid='".$_post['and_a']."' , iphone_appid='".$_post['iph_a']."' , ipad_appid='".$_post['ipa_a']."' u_name='".$_get['name']."'"; echo $sql; } ?> <?php $main_qry=mysql_query("select * users u_name='".$_get['name']."'"); $main_fetch=mysql_fetch_assoc($main_qry); ?> <center><h2 class="art-postheader">edit details of <b></b></h2></center><br/><br/> <table align="

c - Error while compiling SVGA source -

i trying compile svga source build shared-library object. while compiling getting error make[1]: entering directory `/home/manmatha/downloads/svgalib-1.9.25/utils' gcc -i../include -i. -mm ../utils/restorefont.c ../utils/convfont.c ../utils/restoretextmode.c ../utils/restorepalette.c ../utils/dumpreg.c >.depend cc -wall -wstrict-prototypes -fomit-frame-pointer -o2 -fno-strength-reduce -pipe -i../include -l../sharedlib -c -o restorefont.o restorefont.c cc -wall -wstrict-prototypes -fomit-frame-pointer -o2 -fno-strength-reduce -pipe -i../include -l../sharedlib -s -o restorefont restorefont.o -lvga -lm chmod 4755 restorefont cc -wall -wstrict-prototypes -fomit-frame-pointer -o2 -fno-strength-reduce -pipe -i../include -l../sharedlib -c -o convfont.o convfont.c cc -wall -wstrict-prototypes -fomit-frame-pointer -o2 -fno-strength-reduce -pipe -i../include -l../sharedlib -s -o convfont convfont.o -lvga -lm cc -wall -wstrict-prototypes -fomit-frame-pointer -o2 -fno-strength-reduce

association failing in Rails 3.2 ActiveRecord::InverseOfAssociationNotFoundError -

i've got buildings, apartments, residences , users reason aren't playing together. not sure i'm missing. class building < activerecord::base attr_accessible ... has_many :apartments, inverse_of: :building ... end class apartments < activerecord::base ... belongs_to :building, inverse_of: :apartment has_many :residences, inverse_of: :apartment ... end class residence < activerecord::base ... belongs_to :apartment, inverse_of: :residence belongs_to :user, inverse_of: :residence ... end class user < activerecord::base ... has_many :residences, inverse_of: :user ... end in rails console have problems inverse associations: a.class => apartment(id: integer, building_id: integer, ..., created_at: datetime, updated_at: datetime) a.building activerecord::inverseofassociationnotfounderror: not find inverse association building (:apartment in building) /users/[me]/.rvm/gems/ruby-1.9.3-p194@r3t2/gems/activerecord-3.

asp.net web api - Hot Towel/Durandal/Breeze.js: how to vertically secure data calls? -

i'm new whole client-side spa world. i'm using above technologies, seem quite promising. however, 1 huge snag can't on lack of built-in security. had manually roll out user authorization, imho should part of framework. now have sorted, i'm getting major headaches vertical security: 1 user logged in can access other users' info changing few parameters in browser console. pass userid every call , compare 1 on server, hoping there overarching solution doesn't pollute breeze data calls user ids. for example, let's there's call data service this: function getitems(){ var query = breeze.entityquery.from('items').expand("person"); return manager.executequery(query); } this items, not good. let's limit userid: function getitems(userid){ var query = breeze.entityquery.from('items').where("userid", "==", authentication.userid).expand("person")

dependencies - How can grails "dependency error" be resolved? -

grails running fine till decided re-install it: started showing below error during "run-app" or create-app command process- error failed resolve dependencies (set log level 'warn' in buildconfig.groovy more information): - org.grails.plugins:tomcat:2.2.1 details unresolved dependencies org.grails.plugins#tomcat;2.2.1: several problems occurred while resolving dependency: org.grails.plugins#tomcat;2.2.1 {build=[default]}:invalid end of token @ position 46 in pattern /users/sanks/documents/startup/app-resources/1] grails development/sandbox & archive/emote reboot/lib/[artifact]-[revision].[ext] * buildconfig.groovy ** * *** grails.servlet.version = "2.5" // change depending on target container compliance (2.5 or 3.0) grails.project.class.dir = "target/classes" grails.project.test.class.dir = "target/test-classes" grails.project.test.reports.dir = "target/test-reports" grails.project.target.level = 1.6 gra