Posts

Showing posts from May, 2010

.net - Should the result of PackagePart.GetStream() be disposed? -

should caller of packagepart.getstream dispose returned stream object? or method return object reused? documentation doesn't say. looking @ .net source code , every place calling getstream() disposes result, either directly or indirectly. best guess @ answer result of getstream() can disposed, doesn't have if parent packagepart disposed.

javascript - jquery draggable hide object instead of cloaning -

my issue have box sets of draggable objects , when 1 objects dragged rest objects auto fits box occupy whole area instead want either 1: no auto adjust when object moved or 2: set css hidden solve issue see below url http://dev-shree.com/market/ click "candy" now drag extreme right icon on elephat fax see whole coins resize fix square , how can stopp this $("#draggable1,#draggable2,#draggable3,#draggable4,#draggable5,#draggable6,#draggable7,#draggable8,#draggable9,#draggable10,#draggable11,#draggable12,#draggable13,#draggable14,#draggable15,#draggable16,#draggable17,#draggable18,#draggable19,#draggable20,#draggable21,#draggable22,#draggable23,#draggable24,#draggable25,#draggable26,#draggable27,#draggable28,#draggable29,#draggable30,#draggable31,#draggable32,#draggable33,#draggable34,#draggable35,#draggable36,#draggable37,#draggable38,#draggable39,#draggable40,#draggable41,#draggable42,#draggable43").draggable({ revert: function(dropped) {

jquery - SlickGrid custom CSS issue -

Image
i using latest version of slickgrid , encountering issue when implementing latest jquery , jquery ui along custom ui css. have tried using jquery ui css worse results. first image custom css , second jquery ui css 1.10.4. has else experienced issue? apparently issue directly related bootstrap , slickgrid. issue#742 fixed adding .slickgrid, .slickgrid *, .slick-header-column { box-sizing: content-box; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; -ms-box-sizing: content-box; } to slickgrid.css file.

mysql - Referencing table with generated primary keys -

i trying increase constraint of mysql database schema adding foreign key constraint each table. table 1: users +---------+----------+------------- | id | username | other fields +---------+----------+------------- | 1 | john | | 2 | mark | +---------+----------+------------- id int(11) unsigned not null auto_increment username` varchar(50) not null primary key ( id ) table 2: disks (this has one many relationship users ) +---------+----------+-----------+------------- | id | id_user | disk_name | other fields +---------+----------+-----------+------------- | 1 | 1 | disk | | 2 | 2 | disk b | +---------+----------+-----------+------------- id int(11) unsigned not null auto_increment id_user int(11) not null, primary key ( id , id_user ) index fk_disks_idx ( id asc) constraint fk_disks foreign key ( id )

ios - Objective-C: Why do I get an EXC_BAD_ACCESS exception when calling objc_msgSend with a parameter? -

i have got problem while working on own button class in sprite kit / ios 7.0. try call method "objc_msgsend" following error: thread 1: exc_bad_access (code=1, address=0x8) here's button class, "identifier" given caller: // header file *.h @property (nonatomic, readwrite, strong) nsstring* identifier; @property (nonatomic, readonly, weak) id targettouchupinside; @property (nonatomic, readonly) sel actiontouchupinside; // implementation file *.m // ... code in initializer method nsmutablestring *identifier = [[nsmutablestring alloc]init]; [identifier appendformat:@"%d:%d", menuid, itemid]; [self setidentifier:[identifier copy]]; // ... code called inform observer event objc_msgsend(_targettouchupinside, _actiontouchupinside, _identifier); this callback method called button touch has been detected. point exc_bad_access exception thrown. "identifier" "nil", on ipad air, funnily enough works fine on iphone 4s. // ... cal

openerp 7 - Remove SQL constraint in OpenERP7 -

in openerp7, core module account has declaration account.invoice has, @ point, following declaration: addons/account/account_invoice.py:343 _sql_constraints = [ ('number_uniq', 'unique(number, company_id, journal_id, type)', 'invoice number must unique per company!'), ] in module redefined account.invoice wanted remove constraint 2 different approaches: removing in init (account_invoice::init(self, pool, cr)) def __init__(self, pool, cr): super(account_invoice, self).__init__(pool, cr) try: cr.execute('alter table account_invoice drop constraint if exists account_invoice_number_uniq') finally: pass replacing constraint _sql_constraints = [ ('number_uniq', 'check(1=1)', 'dummy check, true, used replace previous constraint'), ] however, when reinstall module in 2 declarations made, error (in pg logs) telling me constraint account_invoice_number_uniq not craeted unique key

How can I specify multiple Node.js runtime versions in my application to deploy to Bluemix? -

in package.json of application, can specify node version: what default node.js runtime version if not specify anything? can specify multiple node versions (say 0.10.x , 0.12.x) when deploy bluemix? or need deploy twice, 1 each version? thanks in advance. "engines": { "node": "^0.10.*", "node": "^0.12.*" } thanks in advance currently, bluemix provides 4 versions of ibm sdk node.js runtime. v0.10.21, v0.10.25, v0.10.26 , v0.10.28. these versions contain ibm enhancements , bug fixes. you should specify node version(single) in package.json file. if don't, latest version used. more details here: https://www.ng.bluemix.net/docs/#starters/nodejs/index.html#deploynodejsapp

sitemap - Robotstxt Google Searchresults -

my search results index sites on google. want index main page , not /nl/, /en/ , /fr/ how can prevent in robots.txt? i used disallow: /nl/ disallow: /fr/ disallow: /en/ but sitemap url www.eikhoeve.be/nl/sitemap.xml how can allow 1 google webmaster tools? my website you can use allow keyword give access url in disallowed directory. allow: /nl/sitemap.xml disallow: /nl/

What does Selenium use? Java or Javascript? -

i newbie. join automation testing project uses selenium. want know use developing test scripts? java scripts? or basic java? please answer . thanks selenium ide? html table based selenese language. underlying javascript. webdriver? multiple supported languages. more information here: http://www.seleniumhq.org

python - Unable to install cffi with pip on mac os x 10.10 -

i trying install cffi, need scrapy , cryptography, on mac os x 10.10 pip , python installed through brew. have updated command line tools installed , updated xcode. libffi-3.0.13 installed. $ pkg-config --version 0.28 $ gcc --version configured with: --prefix=/applications/xcode.app/contents/developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 apple llvm version 6.1.0 (clang-602.0.49) (based on llvm 3.6.0svn) target: x86_64-apple-darwin14.3.0 thread model: posix $ python --version python 2.7.9 $ pip /usr/local/bin/pip $ python /usr/local/bin/python $ pip install cffi --verbose collecting cffi getting page https://pypi.python.org/simple/cffi/ starting new https connection (1): pypi.python.org "get /simple/cffi/ http/1.1" 200 3174 1 location(s) search versions of cffi: * https://pypi.python.org/simple/cffi/ getting page https://pypi.python.org/simple/cffi/ analyzing links page https://pypi.python.org/simple/cffi

php - trying to write a script that redirects to another page using data that was put in to a form -

i trying write script redirect page using data put in form. here script have now. <form id="form1" name="form1" method="post" action="redirect.php?=sendtext"> <p> <label for="phone">phone number:&nbsp;</label> <input type="text" name="phone" id="phone" /> </p> <p> <input name="submit" type="button" value="text coupon" /> </p> </form> <?php $phone == $_get['phone']; if($_get['form1'] == 'sendtext'){ header("location: www.head1stapparel.com/" . $phone . ""); die(); } ?> it doesn't seem work. can give me 1 please help? thanks! here entire page. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml&quo

mongodb - Separate Cloudant Service from Bluemix -

i hosting node app on heroku connected mongolab db. few tips here, i've deployed app code bluemix. moved because i'm changing databases mongodb couchdb, , hoping bluemix might have faster connection due relationship have both being ibm services. ok, questions :p first, since cloudant added app "service" generically provisioned , hence username/pass/etc generated. assume can create own separate cloudant account , put of settings bluemix app manually. so, if that, separately link separate cloudantdb bluemix app, slower or have other negatives? i'm asking because maybe when it's auto-provisioned (and done together), maybe configured in way few network hops/firewalls skipped between connections. remember initial motivation trying out bluemix due relationship cloudant. second, if decided stick auto-provisioned cloudant db, how can change username? i've been playing interface , don't see option anywhere. if can or can't, assume should ab

excel - Custom User Function (UDF) and Dynamic Ranges -

i have custom user function (udf) returns array. use in array formula on large range of cells. length of returned array dependent on function parameters. works great except 1 thing: when length of returned array smaller range defined array-formula, "out-of-range" entries set #n/a . is there way either obtain array-formula range inside custom user function (so, if needed, prepare larger array return), or alternatively return kind of iterator (instead of array) not limited in size , return "" in case of out-of-range? here pretty dumb example......a udf return first 7 primes in column form: public function primes() ' ' array udf return first 7 primes ' dim rn long, ary(1 7) long dim tdim long, long dim wf worksheetfunction set wf = application.worksheetfunction rn = application.caller.rows.count tdim = wf.max(rn, 7) redim bry(1 tdim, 1 1) ary(1) = 1 ary(2) = 3 ary(3) = 5 ary(4) = 7 ary

parsing - VBA parse string Place values to new columns -

i have sheets rows of data like. nom(lsl,usl)=207.3980(206.1990,208.5970) nom(lsl,usl)=207.3980(206.1990,208.5970) nom(lsl,usl)=18.8200(18.4400,19.2100) i grab values , place them in own cells like 207.3980 207.3980 18.8200 206.1990 206.1990 18.4400 208.5970 208.5970 19.2100 i continue recieve "byref argument mismatch" errors. believe relating how defining reference cell. sub parse_replace() dim double dim ws worksheet set ws = thisworkbook.activesheet dim col range dim rlastcell range set rlastcell = ws.cells.find(what:="*", after:=ws.cells(1, 1), lookin:=xlformulas, lookat:= _ xlpart, searchorder:=xlbycolumns, searchdirection:=xlprevious, matchcase:=false) = rlastcell.column 1 step -1 col = collett(rlastcell.column) columns(i).cells(4) = splitstring(col3, ",", 4) columns(i).cells(5) = splitstring(col3, ",", 5)

javascript - Place Bootstrap Modal at beginning of specified DIV -

i use bootstrap modal, show bigger version of thumbnails in photo gallery. the default behavior of bootstrap place bootstrap @ top of viewport, quite alright. in case, people using gallery in iframe . because of this, want modal dialog appears in same height top of gallery div. i've tried positioning modal dialog css (top: 123px) since content above gallery changing, won't work. love position modal relative gallery images. edit: link code is: http://bit.ly/1jcpz9a just mentioned! position relative :-) #mymodal { top:0; position: relative; } just make sure modal markup follows gallery. content after gallery going jump down when dialog appears - i'm hoping don't have content (you mentioned iframe) otherwise you'll need have wrapper div wrapping content , position modal absolutely w.r.t wrapper div.

Threading in Python using multiple cores -

as far know, python's threading library uses posix threads threading , not run on multiple cores. possible implement multicore threading system python threads using open mp? cpython ("default" python implementation) not utilizing multiple cores because of global interpreter lock . every python statement has hold lock. but modules written in c may release interpreter lock before time-consuming operation. i.e. numpy that: http://wiki.scipy.org/parallelprogramming they have handy example that: import numpy np import math def f(x): print x # statements hold gil , cannot run # in 2 parallel threads y = [1]*10000000 [math.exp(i) in y] def g(x): print x # statements fall numpy c code # release gil , can multithreaded y = np.ones(10000000) np.exp(y) since openmp tool c, think seek for.

numerical methods - Using ode45 in Matlab -

i'm trying simulate time behavior physical process governed system of odes. when switch width of input pulse 20 19 , there no depletion of y(1) state, doesn't make sense physically. doing wrong? using ode45 incorrectly? function test width = 20; center = 100; tspan = 0:0.1:center+50*(width/2); [t,y] = ode45(@odesystem,tspan,[1 0 0 0]); plot(t,y(:,1),'k*',t,y(:,2),'k:',t,y(:,3),'k--',t,y(:,4),'k'); hold on; axis([center-3*(width/2) center+50*(width/2) -0.1 1.1]) xlabel('time') ylabel('relative values') legend({'y1','y2','y3','y4'}); function dy = odesystem(t,y) k1 = 0.1; k2 = 0.000333; k3 = 0.1; dy = zeros(size(y)); % rectangular pulse = rectpuls(t-center,width); % ode system dy(1) = -k1*i*y(1); dy(2) = k1*i*y(1) - k2*y(2); dy(3) = k2*y(2) - k3*i*y(3); dy(4) = k3*i*y(3); end end

laravel - How to fix require missing parameter error in PhpStorm -

Image
i started project in phpstorm. it's laravel project , installed laravel plugin , ide-helper, still getting weird errors: and others expecting statement errors. know how fix them? file | invalidate caches... , restart ide -- should such kind of errors (usually does). if above not -- disable 3rd party (not bundled default) plugins , see if made difference. if did -- enable 1 one until find problematic one.

javascript - Repeating fadein on news feed -

a page of website has news feed use ajax return each day 1 @ time , display it. want each days news appear fade in. the problem fade in repeats, each day return html <div id='newsdiv' class='newsdiv'></div> javascript ajax call document.getelementbyid('newsdiv').innerhtml += xmlhttp.responsetext; css @keyframes fadein { { opacity: 0; } { opacity: 1; } } /* firefox < 16 */ @-moz-keyframes fadein { { opacity: 0; } { opacity: 1; } } /* safari, chrome , opera > 12.1 */ @-webkit-keyframes fadein { { opacity: 0; } { opacity: 1; } } /* internet explorer */ @-ms-keyframes fadein { { opacity: 0; } { opacity: 1; } } /* opera < 12.1 */ @-o-keyframes fadein { { opacity: 0; } { opacity: 1; } } .divfadein, .centrescreen, .tbl_houseform { -webkit-animation: fadein 3s; /* safari, chrome , opera > 12.1 */ -moz-animation: fadein 3s; /* firefox < 16 */ -ms-animatio

css - bootstrap stacking middle column -

i started using bootstrap.. trying create page 3 column. the middle column needs split further ten rows. each row have corresponding php echos i have added code on doing on page http://www.bootply.com/bybaequssb# i need know if right way of making rows in column or there efficient way. need responsive.

html - CSS - How to color special shape on hover? -

i've created "tag" shape using css (the rectangular base + triangle). since have more 1 tag shape wanted add hover property class defines shape , way automatically attach hover tags. however, appears not working , way apply hover id . why that? there surely must easier way apply hover several elements @ once. second question, since tag shape built using 2 shapes, how should hover color transition should made? jsfiddle #q{ position:relative; margin:0 5px 0 10px; display:inline-block; height:66px; padding: 0 35px 0 20px; font-size: 25px; line-height:65px; cursor: pointer; font-weight: 100; margin: 20px 25px; background:#f3f3f3; transition: background 0.3s; } #q:after{ position:absolute; content:""; right:-19px; width: 1px; height:0px; border-left:18px solid #f3f3f3; border-top: 33px solid transparent; border-bottom: 33px solid transparent; transition: backgroun

android - capture image from camera and show in fragment, restarting FragmnetActivity onActivityResult -

i want capture image camera , show in imageview in fragment, have done job, working fine on motorola droid maxx xt-1080m kitkat 4.4.4 restarting faragmentactivity on galaxy s4 lollipop 5.0 code intent camera intent cameraintent = new intent(android.provider.mediastore.action_image_capture); startactivityforresult(cameraintent, camera_request); onresultactivity() if (resultcode == activity.result_ok) { bitmap photo = (bitmap) data.getextras().get("data"); iv_parse_user_profile_picture.setimagebitmap(photo); }

Android setWallpaper deprecated -

i want create application allows me set phone's wallpaper, have problem : getapplicationcontext().setwallpaper(bm) . says setwallpaper deprecated , should use method, have no idea method use. code far: package com.example.asus.incercare_proiect; /** * created asus on 29-apr-15. */ import java.io.ioexception; import java.io.inputstream; import android.app.activity; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.os.bundle; import android.view.view; import android.view.window; import android.view.windowmanager; import android.view.view.onclicklistener; import android.widget.button; import android.widget.imageview; import android.widget.toast; class bakapp extends activity implements onclicklistener { imageview display; int tophone; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); // activitatea noastra sa

Change value in pointer string array in C -

is possible change value in character array initialized string pointer way: char *word; word = (char*) malloc(10 * sizeof(char)); word = "test"; word[2] = 'w'; return 0; i segmentation fault while executing above code. you crash because this: word = "test"; word[2] = 'w'; the first assignment changes pointer, no longer points memory have allocated string literal. , string literals read-only character arrays. , read-only, attempt of modifying array in second assignment lead undefined behavior . the correct way copy string memory have allocated, strcpy function: strcpy(word, "test"); another thing reassigning of pointer loose pointer allocated memory, , have memory leak. can not call free on pointer either, since memory pointed word (after original reassignment) no longer allocated you, have caused case of undefined behavior.

llvm - How to change LLVMPass long opt command to a simple Command -

i working on llvm obfuscation project. have written llvm pass(lets flow flattening pass) running on source (test.c) following command: clang -emit-llvm test.c -c -o test.bc opt -load ../../.. llvmflattening.so -fla <test.bc>/dev/null but have seen in o-llvm project achieved same thing using: clang -emit-llvm test.c -c -o test.bc -mllvm -fla can tell me -mllvm here , how changed simple command? -mllvm means additional arguments forward llvm's option processing . therefore -mllvm -fla pass -fla llvm's option processing. clang , llvm run seperately. if want clang run llvm, , have options want llvm aware. -mllvm need. defautly, llvm not turn on transformation passes. -fla , llvm turn on pass registered command line argument fla call function registerpass<typename passname> . in command line, opt's -load option used load plugin. if want use simple command line expect. pass need linked opt binary. done in following 2 ways: (witho

java - Calculate the power with multithreads -

i'm working on calculator calculates number power of number. happens code: public biginteger generate(long power, long base){ biginteger result = biginteger.valueof(base), = biginteger.valueof(base); int j=0; while(j!=power-1){ result = result.multiply(a); j++; } return result; } i know if there mathematical way split type of calculation multiple threads, program calculate things 987654321 ^ 987654321 faster. cpu have 6 cores if there way use them @ once stuff great. the first thing comes mind factorization, i.e., write base number product base = a_1 * ... * a_n and compute a_i^b on separate threads, , multiply results. need computational effort finding factorization, first check if numbers ´big enough´ bother multiple cores, , if are, start standard checks if factorization possible. or divide first 100 prime numbers, should not take long. especially, if number factorizes several times same factor, have compute po

python - Django test client: login doesn't work -

i'm having trouble logging in test @login_required views in django test cases. i have customuser model looks this: class customuser(abstractbaseuser, permissionsmixin): email = models.emailfield('email address', max_length=254, unique=true) username = models.charfield('username', max_length=30, blank=true) is_active = models.booleanfield('active', default=false, help_text='designates whether user should treated approved.') objects = customusermanager() username_field = 'email' here's test case: class viewtests(testcase): def test_create_user(self): u = customuser.objects.create_superuser("u@u.ca","p") u.is_active = true u.save() def test_add_project(self): self.client.login(username="u@u.ca", password="p") response = self.client.get(reverse('add-project'), {}, follow=true) the user created correctly , self.cli

r - Unstacking a data frame -

i have data frame looks this: d <- c("a", "b", "c", "a", "b", "c", "a", "b", "c") par <- c("a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9") df1 <- as.data.frame(cbind(id, par)) i this: a <- c("a1", "a4", "a7") b <- c("a2", "a5", "a8") c <- c("a3", "a6", "a7") df2 <- data.frame(rbind(a, b, c)) you unstack as.data.frame(t(unstack(df1,par~id))) # v1 v2 v3 #a a1 a4 a7 #b a2 a5 a8 #c a3 a6 a9 or using dcast after creating sequence column 'id' group. library(data.table)#v1.9.5 dcast(setdt(df1)[, ind:= 1:.n, id], id~ind, value.var='par')

vsts - OpenCover on Visual Studio Online -

i'm trying use opencover on visual studio online hosted build , end following error: no results, number of reasons. common reasons are: 1) missing pdbs assemblies match filter please review output file , refer usage guide (usage.rtf) filters. 2) profiler may not registered correctly, please refer usage guide , -register switch. note when using -register option, following error: an exception occured: failed register(user:false,register:true,is64:false):5 profiler assembly; may want permissions or using -register:user option instead. c:\windows\system32\regsvr32.exe /s "d:\a\src\packages\opencover.4.5.3723\x86\opencover.profiler.dll" stack: @ opencover.framework.profilerregistration.executeregsvr32(boolean userregistration, boolean register, boolean is64) @ opencover.console.program.main(string[] args) i sure cannot use regsvr32 on vso due insufficient rights. question is: there altern

c# - Should a class that will run only once contain a static constructor? -

i beginning learn oop programming c#. concerning design, makes sense me use static constructor main class of program, considering class contains code run once (my whole program simple , consists of single .cs file). for example, here's sample code using normal constructor: class program { const string file = @"c:\program files (x86)\myapp\log.txt"; int status; static int main(string[] args) { var myobj = new program(); return myobj.status; } public program() { int retcode; try { // lots of procedures using file retcode = 0; // ok } catch (exception ex) { console.writeline(ex.message); retcode = 999; // specific error } status = retcode; } } here follows same structure, using static constructor, think it's ad

java - How can I replace GWT.create with an Annotation Processor? -

i want create annotation processor replaces call gwt.create . with annotation processor, you'd have generate both classes , dynamically (at runtime) select among them, depending on context (you generate factory doing that, you'd still have somehow feed factory current context, e.g. current locale). – source: https://stackoverflow.com/a/29915793/116472 i got annotation processor running generated classes well. part not know runtime selection part. how can runtime selection? i'll assume you've got code generation side covered, , focus on how might pick correct implementation in gwt: but you'd still have somehow feed factory current context, e.g. current locale). we @ runtime, suggest, of added support system.getproperty @ compile time. step one, of course, generate code each implementation might want have access to. taking locales example, might have foo_en.java , foo_es.java , foo_de.java , etc. next, need consistent way 1 imple

c# - Attemping two-way serial port communication in Unity, Serial.Write() causes freeze -

i'm building arduino controller used unity game communicates on serial port. reading data sent arduino works fine, when attempting write serial port unity instantly freezes , needs shut down task manager. need getting serialport.write() work. below, i've detailed how i'm sending data arduino , reading in unity, , how attempt write data arduino doesn't work. i've got controller sending button states unity control character on screen so c#, unity private serialport arduinostream = new serialport("com3", 38400); void start(){ //setup serial connection try{ arduinostream.readbuffersize = 8192; arduinostream.writebuffersize = 128; arduinostream.parity = parity.none; arduinostream.stopbits = stopbits.one; arduinostream.open(); //arduinostream.basestream.readtimeout = 20; } catch(exception e){ debug.log("could not open serial port: " +

algorithm - first and last terms of a nested loop, sums of arithmetic series starting with non zero index -

i have 2 arithmetic series... (i) i<- 1 n j<- 1 2n-i //a unit cost operation so first term 2n-1, last term 2n-n = n (ii) <- 1 n j <- 2 (n+i) // unit cost operation so similarly, first term n+1-1 = n, last term n+n-1 = 2n-1 ? where minus 1 above come ? because index starts 2 ? edit: previous question shows interested in number of terms in inner summation. loop for j<- first last has last-first+1 terms (this easiest see if write down examples small last-first ). (1), there (2n-i)-(1)+1=2n-i terms each i . (2), there (n+i)-(2)+1=n+i-1 terms each i . you add according limits series specify themselves: when i=1 , for j<- 1 2n-1 when i=2 , for j<- 1 2n-2 . . . when i=n , for j<- 1 2n-n when i=1 , for j<- 2 n+1 when i=2 , for j<- 2 n+2 . . . when i=n , for j<- 2 n+n

sql - How to get NULL as values for invalid column -

i'm using sql server 2012. consider table schema be, create table (col1 int, col2 int) i'm trying execute query, select col1, col2, col3, col4 a i execution error col3 , col4 not in table. but there way, these 2 columns can displayed in result null value every row, though it's not available in table? use alias each 1 of these 2 columns: select col1, col2, null col3, null col4

php - How can I save data from a html form in a file? -

this question has answer here: how put string text file in php? 2 answers i did simple form.in trying modifying $_post output. <?php $lhs = array(); $rhs = array(); foreach($_post $key => $value) { echo $key . "=" . $value; echo "<br>"; $lhs[] = $key; //first array left hand side $rhs[] = $value; //second array right hand side } ?> <form name="form1" method="post" action=""> name: <input type="text" name="name"><br> phone no: <input type="text" name="phone" /><br/> course:<input type="text" name="course" /> <br /> <input type="submit" name="submit" value="sign up"> </form> so output of be:

how to avoid duplicate class in c++ without namespace -

just guess situation main.cpp should include both 'a.h' , 'b.h', , class 'c' defined in both a.h , b.h member functions's names same differnt, version of class 'c' different. but, main.cpp require both version of class 'c'. then how avoid errors issue?? don't try define 2 different classes same (fully qualified) name; that's not allowed. rename 1 of them, or put in different namespace.

asp.net mvc 5 - OpenID & OAuth : Best Authorization Grant Type approach to get Access & Identity tokens with Customized Login screen -

currently using authorization code grant achieve both authentication , authorization token using thinktecture identity server. now login screen part of identity server. need have our own login screen in our client application instead of having identity server login page in server. but still need authentication , authorization token thinktecture identity server. appreciate help. try using authorization code flow grant provides access token , id token

Reproduce in plain Javascript the PHP function in_array(needle, haystack) -

if want skip number of items in for loop in php, might use php's native in_array(needle,haystack); function in following manner: php $fruit = array('apple','banana','cucumber','grapes','pear','tomato'); $salad = array('tomato','cucumber'); $herb = array('banana'); $countfruit = count($fruit); ($i = 0; $i < $countfruit; $i++) { if (in_array($fruit[$i],$salad)) continue; $fruitbowl[] = $fruit[$i]; } this give me $fruitbowl of: array('apple','banana','grapes','pear'); i realize use simpler $fruitbowl = array_diff($fruit,$salad); but bear me - i'm making example go along. how reproduce (or similar) in javascript? here's have come with: javascript var fruit = ['apple','banana','cucumber','grapes','pear','tomato']; var salad = ['tomato','cucumber']; var herb = ['banana'];

ios - 1 px line issue in native storyboard tabbar -

Image
hello all, please me in resolving issue. facing of 1 px gap in tabbar in swift.it has 4 tabbar items , gap coming after third tabbaritem(as can see in picture). here iphone 6 plus. working in other devices. have tested , not issue of image becuase have removed images tabbaritems. support highly appreciable. thanks in advance!

ios - How to dynamically re-sample M4A file in ObjectC -

i want take dynamically song itunes , re-sample lower quality rate. i'm able import song itunes, don't know how re-sample 320kbit (supposed itunes work @ quality) 96kbit , keep m4a format ( very important, don't want use mp3 ). i wrote audio library can convert audio easily. set sample rate, channel number, , other properties want. here's url: https://github.com/lixing123/extaudioconverter

model view controller - Spring CRUD - update with @ModelAttribute -

i have update method in controller: @requestmapping(value = constants.update, method = requestmethod.post) public modelandview updateproduct(@modelattribute("productmodel") productmodel productmodel) { productservice.updateproduct(productmodel); modelandview modelandview = new modelandview("redirect:/showproducts"); return modelandview; } the problem when i'm doing update in form, of fields has submitted, if leave field empty - error - request sent client syntactically incorrect. best way make possible update single column without getting error? productmodel rather simple have productname, description , price , query in dao is: string sql = "update product set description=?, productname=?, price=? id=?"; the simplest way read product fields database before updating, overwrite ones received form, , update fields.

.htaccess - Redirect 301 issue -

i´m trying 301 redirect in .htaccess following lines: options +followsymlinks rewriteengine on redirect 301 /oldpage http://www.myhomepage.de/newpage/ the problem is, redirected url looks this: http://www.myhomepage.de/newpage/?it=oldpage and naturally causes 404 on site. know, problem be? bunch! this should work you: rewriterule ^oldpage$ newpage? [r=301,l] the question mark @ end of destination tell use blank query string. the above assume pages on same domain. if you're moving domain, should trick: rewriterule ^oldpage$ http://newdomain.tld/newpage? [r=301,l]

performance - Best practices recommended while developing android applications using SUP - SAP -

i need know how increase or improve performance of android sup based applications in terms of time .i mean lot of time required registration , connecting mbo webservices etc . the time required less if applications not have sup - sap in between . how can improve app's performance in terms of sup .

Open Cordova app at last page visited -

i have cordova app has various html pages can accessed. app opens homepage. is there way reopen app last page visited? maybe pass current page var, , open or if empty open index? you can catch several events in cordova, example pause event. here example in vanillascript: var _storagekey = "lastpage"; // cordova ready, load last page document.addeventlistener("deviceready", deviceready, false); function deviceready () { var lastpage = localstorage.getitem(_storagekey); if (lastpage && window.location.pathname != lastpage) { window.location.pathname = lastpage; } // store location when app paused/closed document.addeventlistener("pause", savecurrentpage, false); } // store navigation function savecurrentpage () { localstorage.setitem(_storagekey, window.location.pathname); });

Using datasource defined in blueprint in java to access oracle db -

below datasource <bean id="datasource" class="oracle.jdbc.pool.oracledatasource" destroy-method="close"> <property name="url" value="jdbc:oracle:thin:@${host}:${port}:${dbname}"/> <property name="user" value="${user}"/> <property name="password" value="${pass}"/> </bean> <service ref="datasource" interface="javax.sql.datasource"> <service-properties> <entry key="osgi.jndi.service.name" value="jdbc/oracleds"/> <entry key="datasource.name" value="oracleds"/> </service-properties> </service> <bean id="logtooracledb" class="com.beans.logtooracledb"> <property name="datasource" ref="datasource" /> </bean> i want use in bean file called logtooracledb public class logtoorac

qt - QPushButton dimensions change when Stylesheet is apllied -

when apply style sheet on qpushbutton dimensions change. style sheet declaration. qpushbutton { background-color: rgb(175, 187, 199); color: black; border-width: 1px; border-top: 1px solid white; border-left: 1px solid white; border-right: 1px solid grey; border-bottom: 1px solid grey; border-style: solid; border-radius: 5; padding: 3px; padding-left: 5px; padding-right: 5px; font: 16px; font-weight: bold; } image - before applying style sheet image - after applying style sheet how keep original button size? based on comment below question: try add qualifier: mydialog qpushbutton { background-color: rgb(175, 187, 199); color: black; border-width: 1px; border-top: 1px solid white; border-left: 1px solid white; border-right: 1px solid grey; border-bottom: 1px solid grey; border-style: solid; border-radius: 5; padding: 3px; padding-left: 5px; padding-right: 5px; font: 16px; f