Posts

Showing posts from April, 2014

javascript - How do you transition a height without the element going outside the parents border? -

i trying make transition starts @ top , after page loads, content expands down page. i've gotten of working, except when content expands down page, keeps expanding way outside it's parents borders. have elements set expand 100%, thought expanding elements expand 100% of parents size, keeps going down page. perhaps misunderstanding how parent/child height percentages work. can point out doing wrong? thanks. here link code on jsfiddle here html code: <body> <div id="outer"> <div class="middle"> <div class="inner"> <h3>a-b</h3> <ul> <li>a</li> <li>b</li> </ul> </div> <div class="inner"> <h3>c-g</h3> <ul> <li>c</li>

php - Custom Price Display Precision without Roundings in Magento -

on question member shivam helps me figure out problem custom price format... how custom price format (with 3 precision) in magento here use precision of 3 public function customformatprice($price, $includecontainer = true) { if ($this->getcurrentcurrency()) { //sets floating point precision 4 points return $this->getcurrentcurrency()->format($price, array('precision'=>3), $includecontainer); } return $price; } but used round precision of 4 public function roundprice($price,$roundto=4) { return round($price, $roundto); } all works fine when use backend input price 9.2400 € output in frontend fine then. when input in backend 9.2450 € output on fronend roundet. seams miss somewhere round price right way. this code use list view... (wrong display in roundings): <?php echo ''.mage::helper('checkout')->customformatprice($_minimalpricedisplayvalue /1.19 /$_bbase_qty,

html - Javascript blank screen error -

i setting website minecraft server , ran problem, followed instructions, seen in link below, , doesn’t work, nothing shows up, blank. image url: http://i.stack.imgur.com/jaqki.png this code doing: <script src="http://www.playgrid.com/api/2.0/js/f87087296b71a8c31eccf14d8b809982f5158662/" type="text/javascript" async=true ></script> <div class="playgrid-recent-players"> <!-- widget inserted here --> </div> looks jquery required widget run, try including above widget code: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> here working fiddle: http://jsfiddle.net/p7pjs/

java - How to send an Asynchronous POST request with a parameter in android? -

so have send asynchronous post request php sever. parameter “password” , value of “egot”. if successful return response , should display how long took. know have use asynctask how never done before in android , direction on how start or nice. please me out. code following. got far public class pingserveractivity extends activity { private button btn6; //private edittext value; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_ping_server); btn6 = (button) findviewbyid(r.id.btn_6); //value = (edittext) findviewbyid(r.id.textv5); pingbutton(); } public void pingbutton() { btn6.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // button send request server new pingposttask().execute(); } }); } private class pingposttask extends asynctask<string, integer, string>{

How to set cookies on the entire domain name from Java Servlet? -

i have 1 servlet, located @ site.com/foo/barservlet . servlet 1 responsible setting cookies. problem is, when set cookies, path set @ /foo . mean servlets located @ site.com/someotherservlet not going able access cookies? if so, there way set cookies on entire domain instead? if try cookie.setpath("/") , reason, when try remove cookie via cookie.setmaxage(0) , has no effect , remains in place. this problem solved doing cookie.setpath("/") both when setting, , when removing cookie. previously, doing when setting, not when removing. hence, cookie not getting removed. now, working across whole domain.

mysql pdo connection strings -

i'm learning pdo , need know if connection (it works) secure. put connections in inaccessible folder outside of root. is formed or can improve it? do need $conn->setattribute ...exception? $user = 'joeuser'; $pass = 'joespassword'; try { $conn = new pdo("mysql:host=mywebhost.com;dbname=mydatabase", $user, $pass); $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); } catch(pdoexception $e) { echo 'error: ' . $e->getmessage(); } if connection (it works) secure. of course not you revealing database internals in case of error. 1 call "secure". do need $conn->setattribute...exception? yes. can improve it? for strange reason setting username , password variables. database? other configurable stuff? , of course have rid of try .. echo stuff $user = 'joeuser'; $pass = 'joespassword'; $host = 'mywebhost.com'; $db = 'mydatabase&#

java - WebDriver wait, different wait conditions -

i using webdriver java binding. using generic methods element waiting. 1 of them called waitbypagetitle. here definition method: public void waitbypagetitle(webdriver driver, string pagetitle) { webdriverwait wait = new webdriverwait(driver, default_implicit_wait); try { wait.until(expectedconditions.titlecontains(pagetitle)); } catch (timeoutexception e) { ... } } in page objects, when method needs wait page title, pass arguments method. there scenarios page title can different based on different events. how change generic waitbypagetitle method accepts multiple arguments, , can wait 1 of them ever sees first? thanks. you can use fluentwait , java varargs // method accept number of titles public void waituntiltextchanges(webdriver driver, string... titles) { new fluentwait<webdriver>(driver) .withtimeout(60, timeunit.seconds) .pollingevery(10, timeunit.milliseconds)

amazon ec2 - Can we bring two ec2 instances under one active directory -

i trying communicate between 2 ec2 instances having windows server 2008 installed. on 1 of server have installed active directory , want bring ec2 instance under 1 active directory. i'm new amazon active directory. the problem trying address installing dynamics crm on these 2 ec2 instances. assumption or understanding, crm requires crm web server , sql server under 1 active directory. any comments links or suggestions appreciated. active directory relies on dns, depends how setup dns instances. but in summary if instance a domain controller my.domain.com , instance b wants join domain have make sure instance b can instance a resolving my.domain.com right ip address of a . when create active directory domain controller, controller automatically becomes dns server easiest way make default dns server instance b actual ip address of instance a (you should able use internal amazon ip address long it's pingable) hope helps.

r - Data.table: join a "long format" multi-time point table with a single time point table -

suppose have following 2 data.tables : mult.year <- data.table(id=c(1,1,1,2,2,2,3,3,3), time=rep(1:3, 3), a=rnorm(9), b=rnorm(9)) setkey(mult.year, id) single <- data.table(id=c(1,2,3), c.3=rnorm(3)) setkey(single, id) i want join 2 tables, variable c.3 appears mult.year[time == 3] i can psuedo assigning new column: mult.year[time == 3, c := single[,c.3]] but lose join functionality: requires id s in both datasets. there way while maintaining join functionality? using above tables, i'm trying this: id time b c.3 1: 1 1 -1.0460085 0.0896452 na 2: 1 2 0.2054772 1.5631978 na 3: 1 3 -1.7574449 0.5661457 0.6495645 4: 2 1 0.4171095 -0.2182779 na 5: 2 2 -0.9238671 0.8263605 na 6: 2 3 -0.5452715 -0.5842541 -1.5233764 7: 3 1 0.1793009 1.4399366 na 8: 3 2 0.3438980

java - Android 401 Error connecting to REST service using HttpURLConnection -

i developing android application , want connect rest service using urlconnection . resource protected using digest authentication . can access rest service via browser. do not want use httpclient because urlconnection more current way connect future. but when try access resource via the code below, 401 error java.io.filenotfoundexception . have researched thoroughly no success, solutions appreciated. note: rest service has been developed using grails, running code in android emulator code developed in eclipse on windows 64 bit os. code url myurl = new url("http://10.0.2.2:8080/myrest/customers"); httpurlconnection myurlconnection = (httpurlconnection) myurl.openconnection(); string basicauth = "basic " + (base64.encode(userpass.getbytes(),android.util.base64.default)).tostring(); myurlconnection.setrequestproperty ("authorization", basicauth); try { int responsecode1 = ((httpurlconnection) myurlconnection).getresponsecode(); l

sql - Oracle 10g database integration in a java web application -

i'm building program in java runs through jboss 5.0.1 application server. program has consult , update tables in oracle 10g database i'm having lot of trouble it. basically, have class called dao connects whith database , makes simple query through method "prueba()". here's implementation of class: package dao; import java.io.file; import java.io.fileinputstream; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import java.sql.resultset; import java.sql.sqlexception; import java.util.linkedlist; import java.util.properties; import valueobject.itemfisico; public class dao { //---------------------------------------------------- //constantes //---------------------------------------------------- /** * ruta donde se encuentra el archivo de conexion. */ public final static string archivo_propiedades = "./data/conexion.properties"; //---------------------------------------------------- //atributos

r - How to remove header part of output from sapply -

i have data.frame , want mean of every column. applied sapply , got following hour minute totalday totalhour 0.00 17.33 105.93 2542.41 i want remove header part of output sapply looks like: 0.00 17.33 105.93 2542.41 any on how can highly appreciated. thanks (code pasting comment wasn't working i'd've liked). again, isn't colmeans() designed do? easier reproduce if more code/data in original q. dat <- data.frame(x = sample(1000,10), y = sample(1000,10), z = sample(1000,10)) print(dat) ## x y z ## 1 565 374 88 ## 2 347 688 896 ## 3 478 542 508 ## 4 103 350 122 ## 5 115 61 175 ## 6 573 164 543 ## 7 371 304 486 ## 8 437 659 140 ## 9 532 510 61 ## 10 47 227 738 print(as.numeric(colmeans(dat))) ## [1] 356.8 387.9 375.7 as ananda mahto pointed out in comments (but assumed obvious after unfamiliar colmeans() did ?colmeans in r console (we don't cut/paste code stack

css - HTML 5, linking with a div -

Image
at moment have setup similar this: <a href="#"> <div style="width: 50px; height: 20px;"> <span>blah</span> </div> </a> which works in chrome. fails w3c validation, - ie apparently has issues it. i've considered using javascript it, know lot of older web-users disable javascript security concerns (personally, i'd stop using old versions of ie. pains) but wondering, what's html5 approved way this? before downvotes, i'd reiterate i'm asking specific html 5. it's valid html5 if fix missing quotation mark in style attribute. try putting in html5 validator: <!doctype html> <head><meta charset="utf-8"><title>something</title></head> <body><a href="#"> <div style="width: 50px; height: 20px;"> <span>blah</span> </div> </a> </body>

MySQL return result by quantity per row -

i need query requires me return below. data table -------------------------------- product name | quantity apple | 3 egg | 2 query expected result -------------------------------- product name apple apple apple egg egg thanks feedback update #1 ok bad question unclear. want display result looping product quantity. expected result on quantity makes confusion. therefore, possible loop record quantity in mysql? if need in sql can leverage tally(numbers) table, can create , populate values 1-100 so create table tally(n int not null auto_increment primary key); insert tally (n) select a.n + b.n * 10 + 1 n (select 0 n union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) ,(select 0 n union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) b order n; then query select product_name data_ta

java - Failing to @AutoWire a member in a @WebServlet -

i can't seem servlet's fields @autowire; end null. have pure annotation-configured webapp (no xml files). servlet looks this: @webservlet("/service") public class satdbhessianservlet extends httpservlet { @autowired protected newsitemdao mnewsitemdao; } other @autowired things seem work fine, both @service objects , @repository objects. not one, , can't figure out why. tried adding package componentscan(basepackages) list other classes. additional info: i added following servlet’s init() method, , seemed wire properly, i'm confused why spring can't wire without that. springbeanautowiringsupport.processinjectionbasedonservletcontext(this, inconfig.getservletcontext()); servlet web components not being created spring container, based on lifecycle not managed container , lot of stuff spring provides such autowired or aspect can not run them. you need indicate spring container component created outside of ioc con

Java servlets: How to detect (on Server Side) if JavaScript (on Client Side) has beeen tampered with? -

this general question, please bear me ... have put alot of effort in form validation javascript, before submitting forms server, idea hit me ... have countless times viewed source of websites find how things work. know although not change javascript, when comes form validation, can set break-point before validation script runs, change div/input tag id/class validated, put original name after stepping through validation steps , before submitting form. then hit me might have re validate on server side again ... each time. here question, how make sure, or @ least detect javascript/html has been debugged/ source-viewed/ tampered with? thanks alot!! initial thoughts on subject: maybe check sum of entire loaded document (js files, html) submitted along form, or through ajax post prior submitting, wont hinder seasoned programmed much. you can't, it's not possible. if send checksum form, user can change checksum before submitting. way revalidate server side, , neve

Querying in Rails with multiple hash conditions -

i'm referring hash conditions described here . use multiple types of hash conditions? equality , subset? tried it, , it's giving me syntax error: @colleges = college.where(category: "#{@university_type}" , "us_news_ranking < #{@rank_low}").first is possible this, or code wrong? is possible this, or code wrong? your code wrong. and isn't involved in this; if want several conditions, supply several several keys/values where . in case, need 2 where calls - 1 equality condition, , 1 less-than condition. you should never interpolate values directly string. use placeholders activerecord can escape them , prevent sql injection. @colleges = college.where(category: @university_type).where("us_news_ranking < ?", @rank_low).first

Is it possible to set the font style in an entire c# windows application -

is possible set font style in entire c# windows application css in web application? in config, windowsformsapplication1.properties.settings.default.userfont = new font("arial", 24, fontstyle.bold); you can add before initializecomponent() in form constructor(s): this.font = systemfonts.messageboxfont;

Rails 4 - Add scope to included Model -

i have association class product has_many :categorizations has_many :categories, through: :categorization scope :first_five, lambda { limit(5) } end class category has_many :categorizations has_many :products, through: :categorization end for each category, want first 5 products using first_five scope defined above. to minimize db request, use includes() @categories = category.includes(:products).all but how add scope products ? don't want use default_scope since affects everything. i can't find on google (or can't right search term it) thanks the new syntax lambda scope in rails 4 is: scope :first_five, -> { limit(5) } to limit 5 products in ar query, do: @categories = category.includes(:products).merge(product.first_five).all the merge(product.first_five) going add left outer join on limited 5 products. update: the above code commented going limit categories. possible solution original problem add has_many...th

objective c - Apps must follow the iOS Data Storage Guidelines or they will be rejected in app that contains .pdf -

i have created ebook , epaper app , app contains lot of images , pdf files , putting downloaded images , pdf files documents directory image directory: nsstring *strpageurl = [dictpage valueforkey:@"imagelink"]; strpageurl = [strpageurl stringbyreplacingoccurrencesofstring:@"\n" withstring:@""]; strpageurl = [strpageurl stringbyreplacingoccurrencesofstring:@"\t" withstring:@""]; strpageurl = [strpageurl stringbyreplacingoccurrencesofstring:@" " withstring:@""]; nsstring* strfilename = [strpageurl lastpathcomponent]; nsstring *strdestfile = [nshomedirectory() stringbyappendingpathcomponent:[nsstring stringwithformat:@"documents/%@",strfilename]]; pdf directory nsstring *strthumburl = [dictpage valueforkey:@"thumbimage"]; // nslog(@"%@",strthumburl); nsstring* strthumbname

c++ - Resetting sleeping time of a thread -

suppose have thread void mythread() { int res; while(1) { { boost::lock_guard<boost::mutex> lock(mylock); res = do_my_stuff(); } boost::this_thread::sleep(boost::posix_time::seconds(5)); } } and thread sleeping. if happens outside of thread, i'd able increase sleep time. what best way it? using condition_variable signal changes deadline this has benefit of supporting scenarios timeout shortened : see live on coliru #include <thread> #include <chrono> #include <iostream> #include <condition_variable> namespace demo { namespace chrono = std::chrono; using our_clock = chrono::system_clock; struct worker { mutable std::mutex _mx; // shared, protected _mx: our_clock::time_point _deadline; mutable std::condition_variable _cv; worker(our_clock::time_point deadline) : _deadline(deadline) {} void operator()() const { st

javascript - Display all logged in users -

i have used tutorial 'sign in google' on website. http://tutorialzine.com/2012/08/build-a-one-click-registration-form-powered-by-google/ i not programmer download code in there , followed steps in there. works fine. want logged in users profile pic displayed list. should visible on website. if user logs out, should removed list. can point me article or me please? my website login page you need learn little bit of programming so.. first need create database table store value logged in users .. checked code , when user loggs in website user_id been saved session_variable .. can insert his/her user_id database table , can use login flag lets true or false if user_id there in session_variable flag should true , when user loggs out can update flag false .. using can achive desired thing. . but developing knowledge must so..

html - Wordpress Posts Overlapping -

Image
i posted on wordpress development stack exchange , said more suitable here this simple css issue here goes anyway: i'm developing wordpress theme has left sidebar , posts on right, posts overlap , can't flow down page. because html part of loop, divs copied multiple times. i have html reset further in code if helps anyone. the code posts looks this: html: <div class="propbox"> <p class="propertytext"><?php the_title(); ?></p> <div class="propertybox"></div> <div> css: .propertybox { position: absolute; top: 103px; left: 43%; width: 50%; height: 356px; background-color: rgb(222, 222, 222); margin-top: 15px; } .propertytext { position: absolute; top: 112px; left: 56.75%; z-index: 1; width: 20.4%; min-height: 47px; line-height: 1.38; text-align: center; color: white; font-family: 'raleway'; font-weight: 200; font-size: 31px; } i can'

Multiple puppet requires -

hi i'd make puppet resource/task dependent on multiple other tasks. for example: file{'~/foo':} file{'~/bar':} file{'~/foobar': require => file['~foo'], require => file['~bar'] } what's correct syntax define this? thanks from language: data types resource attributes can optionally accept multiple values (including relationship metaparameters) expect values in array. file{'~/foo':} file{'~/bar':} file{'~/foobar': require => [ file['~foo'], file['~bar'] ] }

python - Passing numpy string-format arrays to fortran using f2py -

my aim print 2nd string python numpy array in fortran, ever first character printed, , it's not right string either. can tell me correct way pass full string arrays fortran? the code follows: testpy.py import numpy np import testa4 strvar = np.asarray(['aa','bb','cc'], dtype = np.dtype('a2')) testa4.testa4(strvar) testa4.f90 subroutine testa4(strvar) implicit none character(len=2), intent(in) :: strvar(3) !character*2 not work here - why? print *, strvar(2) end subroutine testa4 compiled with f2py -c -m testa4 testa4.f90 output of above code c desired output bb per documentation , f2py likes string arrays passed dtype='c' (i.e., '|s1'). gets part of way there, although there oddities array shape going on behind scenes (e.g., in lot of tests found fortran keep 2 character length, interpret 6 characters being indicative of 2x6 array, i'd random memory in output). (as far tell), requires treat

How to encrypt server URL in android? -

hi working android.i had created library project in data fetched server.now need provide library project third party developer, how can encrypt server url others?? try way : string stringthatneedstobeencrpyted = "putyoururl"; messagedigest mdenc = null; try { mdenc = messagedigest.getinstance("md5"); } catch (nosuchalgorithmexception e) { // todo auto-generated catch block e.printstacktrace(); } // encryption algorithm mdenc.update(stringthatneedstobeencrpyted.getbytes(), 0, stringthatneedstobeencrpyted.length()); string md5 = new biginteger(1, mdenc.digest()).tostring(16); system.out.println(md5);

iphone - How to display splash image in ios 7 & ios6 -

Image
i working on ios 7 & ios 6 3.5 inches , 4 inches screen ios. working on splash screen both versions. in ios 7 4-inches screen display proper way. in ios 6 4-inch screen not display properly. have issues alignment. ios 7 3.5 inches getting alignment issues. ios 6 3.5 inches displays find. dont know how fix alignment issues. sample code: #define system_version_greater_than_or_equal_to(v) ([[[uidevice currentdevice] systemversion] compare:v options:nsnumericsearch] != nsorderedascending) if (system_version_greater_than_or_equal_to(@"7.0")) { splashview=[[uiimageview alloc]initwithframe:cgrectmake(0, 20, 320, 548)]; splashview.image=[uiimage imagenamed:@"screens copy.png"]; [self.view addsubview:splashview]; splashview.autoresizingmask = uiviewautoresizingflexibleleftmargin | uiviewautoresizingflexiblerightmargin |uiviewautoresizingflexiblebottommargin | uiviewautoresizingflexibletopmargin; } else { splashview=[[uiimageview alloc]initwi

objective c - How to treat NSArray of mixed content as of unified content? -

class b derived class a. class b overrides '- (nsstring *) description', overridden in class too. made new 'nsarray' of pointers instances, both class , class b. is possible treat of them in cycle class instances, more precisely - possible use class '- (nsstring *) description' of them? currently, use check if it's class b instance, , call initializer makes class instance in case. seems unnecessary, don't solution. the following example may little easier on eyes solution in other thread mentioned in merlevede's answer. for ( id item in array ) { if ( [item ismemberofclass:[classa class]] ) { nslog( @"%@", item ); } else { struct objc_super parent = { item, [item superclass] }; nslog( @"%@", objc_msgsendsuper( &parent, @selector(description) ) ); } } the objc_msgsendsuper function can used call method returns id edit - forgot mention need #import <objc

How to upgrade my android application from lite to pro version -

i developed android application, lite version. now added new features , want release pro version. from lite version app need read data base also. can tell me changes need in current app can access older /data/data/package/databases/aba.db folder. the easiest way handle use in-app purchase buy "license key" allow "lite" version gain features , therefore become "pro" version. you can check @ relevant points in app if license key has been purchased , change ui offer feature set relevant current mode.

java - how to compile source file using ant -

i new in ant programming, have made build.xml execute compiled file. want learn " should automatically build .java file , move target folder. currently compiling java file eclipse & moving target folder & running ant . i have folder structure like myproject source helloworld.java target lib build.xml in build.xml have below code, <?xml version="1.0" encoding="utf-8"?> <project name="hello world project" default="info"> <path id="master-classpath"> <fileset dir="lib"> <include name="*.jar"/> </fileset> </path> <target name="info"> <junit printsummary="yes" haltonfailure="yes"> <classpath> <pathelement location="target"/> </classpath> <classpath refid="master-classpath"/> <test name="

python keep-alive connection and download image -

i need download image site python, image changed every 1 second. possible: - set python connection [keep-alive] - download image; sleep 1.5; download image; sleep 1.5; download image; sleep 1.5; - close connection i mean doesn't create connection site every 1.5 sec use 1 keep-alive connection. , close connection @ end of script (after 15 sec example). sure connection closed. if have ideas how it, please show me example. thanks! by using requests library optional flags: import requests r = requests.get(url='http://upload.wikimedia.org/wikipedia/en/a/a9/example.jpg',stream=true) print r.headers['last-modified'] has file creation time output: thu, 03 oct 2013 23:15:52 gmt we use 'stream=true' flag, this description , because: at point response headers have been downloaded , connection remains open, hence allowing make content retrieval conditional you can check see if new file timestamp updated old one, , download if file updat

hash - Hashed format in windows 7 or above -

i need find materials how security accounts manager(sam) works in windows 7+. confused storage format of hashed value. many materials (such as, 1 ) tells me uses ntlm(or ntlm v2). however, far understand, security level of ntlm low. os(such unix) provide random salt enhance basic security level. ntml, can break brute force in several days(even several hours great device). also, if use rainbow table , can achieve perfect result. some other materials (such as, 2 ) tells me windows vista or above has replaced ntlm kerberos. affect sam? if so, in default, hash algorithm use in windows 7 or above? to make question clearly, want list them below. does ntlm or ntlmv2 use salt? which algorithm windows 7 or windows 8 use sam? whether kerberos affects hashed format of sam? 1) algorithms lm, ntlm , ntlmv2 session security can find at: http://davenport.sourceforge.net/ntlm.html . 2) protocol chosen depends on configuration ( http://technet.microsoft.com/en-us/library/cc

html - Passing variables between PHP scripts -

i have problem , can not understand why not working. language not transferred , see empty area. in php: <?php $_session['language'] = $_get['spanish']; header("location:../index.php"); exit; ?> in index.php: <?php $language = $_session['language']; include 'header.php'; echo '<div id="content"> <img src="images/splashscreen.jpg" id="bgimage" alt="city" width="1280" height="720" /> <div class="splashouterringsoverlay" id="contain"> <img src="images/loading-outer-circle.png" id="image1" alt="inner ring" width="282" height="282"> </div> <div class="splashinnerringsoverlay" id="contain"> <img src="images/loading-in

join - SQL syntax at joining 2 tables via aliases for resulting tables? -

i'm trying sense sql. correct following logic below ? can use brackets as here ? -- 1 (table1) inner join (table2) on ( ??? ) -- 2 (table1 a) inner join (table2 b) on (a.col1 = b.col1) -- 3 ((select ... ... ...) a) inner join ((select ... ... ...) b) on (a.col1 = b.col1) this doesn't work me. failing query: ((select createdate, belegnrrech, mnr, utnr, ktxt infor.relfbr (saint = '90') , (createdate >= '01.01.14 00:00:00')) a) inner join ((select anr, mnr infor.relxdb (saint = '10')) b) on (a.mnr = b.mnr) -- error message: ora-00907: missing right parenthesis i'm using c# send sql queries: string q1 = "select createdate, belegnrrech, mnr, utnr, ktxt infor.relfbr " + "where (saint = '90') , (createdate >= '" + date.tostring("dd.mm.yy hh:mm:ss") + "')"; string q2 = "select anr, mnr infor.relxdb (saint = '10')"; string query = "("

php - using .htaccess redirect specific URL -

how redirect website : www.old.com/test.php -> www.new.com/test.php but enter other links www.new.com/ www.new.com/test1.php -> www.old.com/test1.php www.new.com/test2.php -> www.old.com/test2.php www.new.com/test3.php -> www.old.com/test3.php how if file names not in sequence, this: www.new.com/home.php -> www.old.com/aiej.php www.new.com/contactus.php -> www.old.com/contact.php www.new.com/aboutus.php -> www.old.com/aboutus.php www.new.com/msdv.php -> www.old.com/msdv.php only test.php redirect www.new.com/ , others redirect www.old.com i prefer use .htaccess file. suggestion? try rules in .htaccess rewriteengine on rewritebase / # redirect test.php new rewritecond %{http_host} ^www\.old\.com$ [nc] rewriterule ^(test)\.php$ http://www.new.com/$1.php [r=301,l] # redirect test* old rewritecond %{http_host} ^www\.new\.com$ [nc] rewriterule ^test(.+)\.php$ http://www.old.com/test$1.php [r=301,l]

javascript - Getting coordinates of a table and storing it in the database -

i have created page , has tables. have made these tables draggable , need store coordinates of table moved on provided area using php. please me out in doing this, couldn't figure out. code of html page is: <table class="smssecond"><!--bgcolor="#4ab54d"><class="smssecond"-- td bgcolor: bgcolor="#4ab54d"--> <tr style="background-color: #3c3c3c;" > <td colspan="2" width="auto" align="center">ticket info<img id="delete" src="icons/delete.png" height="10" width="10" style="float: right;"/></td> </tr> <!--odd row--> <tr class="oddrow" align="center"><!-- style="color: #000000; font-size: 12px;"--> <td> ticket number </td> <td>

vb.net - Dynamic TableLayout Panel -

i want create tablelayout panel dynamically. i have achieved 1 column size fixed ie 2 row size dynamically adding - how add every row same height? suppose have 2 columns , rows (dynamically) 1st column contain radio buttons , second column contain emails how add dynamically 1 one? radiobutton1 label1 radiobutton1 label1 like that? this dynamic table code dim dynamictablelayout new tablelayoutpanel private sub dynamictable(byval rowcount integer) me.dynamictablelayout.columncount = 2 me.dynamictablelayout.columnstyles.add(new system.windows.forms.columnstyle(system.windows.forms.sizetype.percent, 8.333333!)) me.dynamictablelayout.columnstyles.add(new system.windows.forms.columnstyle(system.windows.forms.sizetype.percent, 91.66666!)) me.dynamictablelayout.location = new system.drawing.point(0, 3) 'me.dynamictablelayout.name = "tablelayoutpanel1" me.dynamictablelayout.rowcount = rowcount integer = 0 dynamictablela

scala read/write format for json with Type -

i having problems understanding how serialize type. lets used serialize way: class: case class localizeditem(itemid:string, var value:string) { def this(itemid:option[string]) = this(itemid.getorelse(null), "") def this(itemid:string) = this(itemid, "") } and in formatter do: trait productformats extends errorformats { implicit val localizeditemformat = new format[localizeditem]{ def writes(item: localizeditem):jsvalue = { json.obj( "itemid" -> item.itemid, "value" -> item.value ) } def reads(json: jsvalue): jsresult[localizeditem] = jssuccess(new localizeditem( (json \ "itemid").as[string], (json \ "value").as[string] )) } my question how use same pattern object receive generic item/type (generic have write/read implemented same way localizeditem has) e.g: case class dtoresponse[t](d: t) { def iserror = false def get() = d } when trying implem

How to dynamically populate multi column of a div in html? -

based on content available in 'div',i want divide , show in no.of columns .please tell me how acheive this? any samples please tell me know. edit: $(document).ready(function () { tab_div = $('#id_of_table'); (i = 0; < 3; i++) { debugger; $('<tr>').appendto(tab_div); (j = 0; j < 3; j++) { $('<td>'+ j + '</td>').appendto(tab_div); } $('</tr>').appendto(tab_div); } fiddle : http://jsfiddle.net/ef2bf/3/ the answer depends on how data structured in div, , if want first 60 items first column, 60 next second, etc. simplest way alternate between columns, in fashion: column 1 | column 2 | column 3 item 0 | item 1 | item 2 item 3 | item 4 | item 5 i have provided jsfiddle example: http://jsfiddle.net/ef2bf/3/ main part of code bit: //loop through each row (60 times) (i = numitems * j;

javascript - How to make jquery sortable items sort only the sortable items and not the non sortable -

i have sortable items: <div class="sortitems"> <div class="sortphotos nonsortable">item 1</div> <div class="sortphotos nonsortable">item 2</div> <div class="sortphotos nonsortable">item 3</div> <div class="sortphotos ">item 4</div> <div class="sortphotos ">item 5</div> </div> $(".sortitems").sortable({ items : ' > .sortphotos', items : ':not(.nonsortable)' }); my problem this, want sort item 4 , item 5 , don't want them cross on ".nonsortable" divs. meaning, don't want item 4 or item 5 in front or in middle of of the ".nonsortable" divs. update: i don't want happen: <div class="sortitems"> <div class="sortphotos ">item 4</div> <div class="sortphotos nonsortable">item 1</div> <div class="sortphotos nonsortable&q

getting error of "NullReferenceException was unhandled by user code" while i try to display first name after successful login in ASP.NET MVC -

i getting error of "nullreferenceexception unhandled user code" while try display first name after successful login in asp.net mvc. model: using system; using system.collections.generic; using system.componentmodel.dataannotations; using system.data; using system.data.sqlclient; using system.linq; using system.web; using system.data.linq.mapping; namespace club.models { public class user { int j; public string type1 { get; set; } [required] [display(name = "user name")] public string username { get; set; } [required] [datatype(datatype.password)] [display(name = "password")] public string password { get; set; } [display(name = "remember on computer")] public bool rememberme { get; set; } /// <summary> /// checks if user given password exists in database /// </summary> /// <param name="_username">user name</param> /// <param name

html5 - silex php framework mix with grunt -

i have configurations in grunt /** * generated on 2013-07-31 using generator-angular 0.3.0 * generate separate angular template install grunt grunt cli * @author: frank marcelo */ 'use strict'; module.exports = function (grunt) { require('matchdep').filterdev('grunt-*').foreach(grunt.loadnpmtasks); // configurable paths var yeomanconfig = { app: '../app/views/development', appimages: '../app/img', dist: '../app/views/production', less: 'css/less', binless: '../bin/less', css: 'css', js: 'js', images: 'img', timestamp: (new date()).gettime().tostring(), randomport: math.floor((math.random() * 10000) + 1) }; try { yeomanconfig.app = require('./bower.json').apppath || yeomanconfig.app; } catch (e) {} grunt.initconfig({ yeoman: yeomanconfig, jshint: { options: { jshintrc: '.jshintrc', reporter: require

java - Text Adventure Game, adding time and game ending -

i making simple text adventure game, got 2 little problems.. problem 1: want make end game goal.. once player reached room, game ends.. cannot seem if statement correct.. problem 2: want make time limit(steps) lets user 30 steps complete game.. every room enters, counter +1.. , once reaches 30 steps loose. i have createrooms method creates rooms , locations private void createrooms() { room gate, graveyard, church, crypt, entrance, hall, kitchen, buttery, greathall, staircase, dungeon, topstaircase, throne, solar, wardrobe, privy; // create rooms gate = new room("outside old gate of castle"); graveyard = new room("on wind-swept gaveyard"); church = new room("in small ancient church medieval windows"); crypt = new room("in crypt of church"); entrance = new room("at big wooden entrance of castle"); hall = new room("in dark entrance hall of castle"); kitchen = new room(&quo

postgresql - Initialize a string in a stored function -

i call procedure without problem : select sp_getglobalvariable('current_user_id')::int ; if call inside stored procedure : -- current user id -- select sp_getglobalvariable('current_user_id')::int __currentuserid ; i have error : error : syntax error near "current_user_id" line 25: select sp_getglobalvariable('current_user_id')::int _... it stupid syntax error... if can poor mysql user starting using pg ! edit 1 : select version(); postgresql 9.3.3 on i686-pc-linux-gnu, compiled gcc-4.4.real (debian 4.4.5-8) 4.4.5, 32-bit this result of version() call. create or replace function sp_getglobalvariable (__variablename varchar(64)) returns varchar ' declare begin return (select value tmp_variables name = __variablename) ; end ; ' language 'plpgsql'; the procedure global variable in temporary table.* edit 2 : create or replace function sp_insertsite (__sitename varchar(70), __sitedescripti