Posts

Showing posts from 2012

hateoas - Non-contextual operations using REST and HATEOS -

i trying implement hateos based rest service hotel booking have confusion: 1) how apart wadl, client comes know possible operations , corresponding uri. should put possible operations , uri response when client hits root of rest service? 2) when client gets list of accommodation options in area, returning list of hotels in area asked about. response contains: <accommodation> <hotel info="http://welco.me/hotel/xxxxxx" price="5000"/> <hotel info="http://welco.me/hotel/yyyyyyy" price="3000"/> </accommodation> but query have here how client going know other related possible operations getting list in sorted order of price? in answer first question, there couple of specs documents allow clients discover restful apis. swagger json home google use own discovery service , unlike swagger , json home, unfortunately don't think there open sourced libraries use expose own apis. for second questions a...

windows - How to Create Visual SVN Repository and get that URL -

i want create visual svn repository , repository url in command prompt. need url not other information. can me... i need command equal visual svn new->repository , copy url clipboard thanks! update 2016: upgrade latest visualsvn server version includes powershell module adds number of powershell cmdlets subverion server , repository administrators. read visualsvn server | scripting , automation page. the cmdlets should helpful in regular administration tasks , automation. here complete list of visualsvn server powershell cmdlets: kb88: visualsvn server powershell cmdlet reference . as @ivanzhakov suggested, can create new repository using new-svnrepository cmdlet. here example of creating new repository myrepository , grabbing url parameter: $repo = new-svnrepository -name myrepository $repo.url outdated answer: i assume mean visualsvn server , not visualsvn extension visual studio. you can create repository svnadmin create command or using vi...

CSS-Rotated text in Webkit browsers is blurred -

i've come across severe problem can't solve.. i created accordion element jquery plugin easyaccordion.js. while developing , looked on in firefox worked - until openend in chrome. there can see rotated text unclear , blurred, though has same formatting un-rotated text @ top. same safari. i created jsfiddle sortof recreates issue (look @ in chrome or safari ) . .. http://jsfiddle.net/sfkkv/427/ .. . this i'm using rotate text: -webkit-transform: rotate(-90deg); /* chrome, safari 3.1+ */ -moz-transform: rotate(-90deg); /* firefox 3.5-15 */ -ms-transform: rotate(-90deg); /* ie 9 */ -o-transform: rotate(-90deg); /* opera 10.50-12.00 */ transform: rotate(-90deg); the jsfiddle not working in firefox, that's not important here, have working on website created in, sortof broken fiddle in firefox shows can display rotated text lot better. i've found hints towards font-smoothing , 3d parameters, none seemed work me....

javascript - jQuery Toggle - should close only on clicking the header -

the fiddle: http://jsfiddle.net/bscn3/ scenario: want use nested toggles inside tabbed containers, in fiddle. my issue: when click on main toggle ("toggle 1") or ("toggle 2"), inner contents display. closes if click on inside. eg. if click on toggle 2, , if click on tab 1 -> nested toggle 1, toggle 2 closes. i want remain open. my guess: jquery working closes toggle if related toggle (even text content) clicked. my need: want toggle close if rectangular headers clicked. also, if can clean code in such way, don't need write separate js make inner nested toggles work independently of parent or children toggles, great. currently have 2 toggle js functions written 2 toggles in example. //toggle $('.toggle-view li').click(function () { var text = $(this).children('.t'); if (text.is(':hidden')) { text.slidedown('fast'); $(this).children('.toggle').addclass('tactive'); ...

ajax jquery does not submit to the database -

please friends need help. when want submit form using ajax, not submit database following log messages: started post "/comments" 127.0.0.1 @ 2013-08-07 12:39:23 +0300 processing commentscontroller#create js parameters: {"utf8"=>"✓", "authenticity_token"=>"9rzgl7szawnux+fszarquyiptjtppr8gsq3afpgtfie=", "comment"=>{"person"=>"psquare", "comment"=>"play great music"}, "commit"=>"create comment"} completed 500 internal server error in 4ms actionview::missingtemplate (missing template comments/create, application/create {:locale=>[:en], :formats=>[:js, "application/ecmascript", "application/x-ecmascript", :html, :text, :js, :css, :ics, :csv, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :handlers=>[:erb, :builder, :c...

json - Rails active_model_serializer applied on grouped active record -

i using active_model_serializer https://github.com/rails-api/active_model_serializers , want apply serialisation of model grouped active records. i have model represents blogpost title, content , published date. use serializer format date more user friendly format during serialisation. works if applied on active records, firstly want group blogpost records :published , :unpublished so posts.group_by |post| if post.published_at.nil? :unpublished else :published end end if render json output of grouped data, serializer not applied on blogpost objects , data gets returned is. does know way how apply serializer on grouped (grouped_by) active records?

Repaint Rectangle on Rectangle without flashing, Windows 7, Delphi -

i wish draw graph, , paint rectangle in centre of it. using delphi 7, has been done this: with graphform.canvas begin brush.color:=clwhite; brush.style:=bssolid; pen.color:=clwhite; rectangle(1,y0,639,y0-341); end; //short wait while other things happen graphform.waitlab.invalidate; that causes terrible flashing: white rectangle washes waitlab away, after short wait, waitlab repainted. waitlab smaller rectangle in center of larger field. if turn off window painting, window doesn't painted @ all. if turn off window painting, turn on again , repaint window, i've got original problem: i'm painting rectangle white, colored. the canvas code runs (and must run) in paint event handler, since white field not delphi control, needs explicitly repainted on every paint message form. waitlab delphi control delphi repaints after invalidate. invalidate code line not in paint event handler: cause tight loop. but code run asynchronously on comm event changes...

android - Show Google Maps V2 markers based on selected tab -

i'm using fragments , viewpager show 2 tabs inside app. there's map inside main activity: <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="fill_parent" android:layout_height="wrap_content" > </android.support.v4.view.viewpager> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.supportmapfragment" tools:layout="@layout/activity_map" /> i show different set of markers on map in each tab. first tab loading them local db , second 1 remote server. i've tried placing logic inside oncreateview in fragment both called when activity starts, not when 1 of them selected, markers aren't replaced on tab select. ho...

mysql - Set timestamp on insert when loading CSV -

this question has answer here: how can add date auto update when import data csv file? 2 answers i have timestamp field defined automatically updated current_timestamp value. works fine when fire query, when import csv (which i'm forced since 1 of fields longtext) , update not work. i have tried to: give timestamp column now() function in csv manually enter timestamp 2013-08-08 in csv both approaches not work from gather, after updating question, you're updating rows using csv, , expect on update clause set value of timestamp field updated. sadly, when loading csv database you're not updating, inserting data, , overwriting existing records. @ least, when using local infile , if infile isn't local, query produce error, if it's local file, these errors (duplicates) produce warnings , operation continue. if isn't cas...

css - responsive menu toogle button align -

Image
this menu toogle section: jsfiddle jsfiddle link or external html menu this question: what change make toggle button (menu icon) align in <div class="navigation"></div> container ? css only for better imagination here align text ( left, right, center ) html: <div class="navigation"> <div id="slidebox"> <div id="toggle"> <a href="#">&#9776;</a> <a class="top" href="#slidebox">&#9776;</a> </div> <ul id="box" class="menu"> <li><a href="#">homepage</a></li> <li><a href="#">about us</a></li> <li><a href="#">contact us</a></li> <...

Dismiss Custom Alert Dialog on Back button pressed of hardware in android -

i having problem on button of hardware. in main activity, have 1 list view(say 1). when click on item of list view(1), 1 alert dialog appears, in alert dialog, there 1 list view(say 2). data of list view(2) being repeated when press button of hardware. have put cancel image on alert dialog dismiss, when press cancel image, data not being repeated. tried different methods onresume(), onpause(), ondestroy(), onrestart() clear array list view(2), nothing works. here code... case list_dialog : layoutinflater inflater2 = layoutinflater.from(this); view dialogview1 = inflater2.inflate(r.layout.listdialog, null); alertdialog.builder dialogbuilder2 = new alertdialog.builder(this); dialogbuilder2.setview(dialogview1); dialogdetails = dialogbuilder2.create(); case list_dialog: alertdialog alertdialog1 = (alertdialog) dialog; // cancel alert dialog imageview ivcancel = (imageview) alertdialog1.findviewbyid(r.id.imgcancel); ivcancel.setonclicklistener(new onclicklistener(...

How to implement jQuery to PHP or how to get javascript-proceeded output of html page? -

jquery has awsome methods, use while working external htmls there way somehow transform php framework ? edit : many people missunderstood question purpose - of course know php's dom real purpose able same syntax (and use same methods) in php while working external htmls. edit2: possible solution html string, add jquery string , somehow make php javascript-processed output ? the traversal methods based on css3 selector syntax has been replicated in phpquery. https://code.google.com/p/phpquery/ is server-side, chainable, css3 selector driven document object model (dom) api based on jquery javascript library. it's quite neat if need manipulate , query dom structures, though in experience quite slow.

css - Bought a @font-face, not working in Firefox and IE -

my client bought font used. code generated it: @import url("//hello.myfonts.net/count/27ec77"); @font-face {font-family: 'franklingothicurwcon-boo'; src: url('www.mybariatricsolutionsseminars.com/new/styles/webfonts/27ec77_0_0.eot'); src: url('www.mybariatricsolutionsseminars.com/new/styles/webfonts/27ec77_0_0.eot?#iefix') format('embedded-opentype'), url('www.mybariatricsolutionsseminars.com/new/styles/webfonts/27ec77_0_0.woff') format('woff'), url('www.mybariatricsolutionsseminars.com/new/styles/webfonts/27ec77_0_0.ttf') format('truetype');} @font-face {font-family: 'franklingothicurwcon-dem'; src: url('www.mybariatricsolutionsseminars.com/new/styles/webfonts/27ec77_1_0.eot'); src: url('www.mybariatricsolutionsseminars.com/new/styles/webfonts/27ec77_1_0.eot?#iefix') format('embedded-opentype'), url('www.mybariatricsolutionsseminars....

c# - Cover entire row with a single column - width issue -

i have repeater & table controls. table has 1 column. when run code each cell in row covers around 25% (based on content of cell) of row & background color changes area only. want cell cover entire row. following code. set column width 100%, did not solve issue. not want hard code width cell. <div style="overflow-y: auto; width: 100%; height: 395px; border: 0px solid #3c454f; background-color: #fffbe6; border: 0px solid #3c454f;"> <asp:repeater id="testlist" runat="server"> <headertemplate> <table> </headertemplate> <itemtemplate> <tr style="background-color: aqua; padding-top: 5px"> <td style="width: 100%;"> <%#container.dataitem%> </td> </tr> ...

asp.net - Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure -

i have downloaded trial version of product provides api on https. , inside asp.net mvc web application doing following execute api call trial version of product:- [httppost] [validateantiforgerytoken] public actionresult create(rackjoin rj, formcollection formvalues) { string controllername = routedata.values["controller"].tostring(); if (modelstate.isvalid) { var message = ""; var status = ""; long assetid = new long(); xmldocument doc = new xmldocument(); using (var client = new webclient()) { var query = httputility.parsequerystring(string.empty); foreach (string key in formvalues) { query[key] = this.request.form[key]; } query["username"] = system.web.configuration.webconfigurati...

Building a Word Cloud Jquery / HTML5 plugin -

i'm searching code build tag cloud in example . can see words can embedded inside spaces in letters. tag cloud should based on weight, words higher weight apear larger. i want create exact same effect in link i've provided. don't mind basing plugin on existent plugin same. in advance. the code page on github: the page javascript render cloud onto html 5 canvas skimming code looks draws text onto canvas reads pixels canvas find empty spaces fill more words.

c# - How does DoubleUtil.DoubleToInt(double val) work? -

the ms.internal.doubleutil -class contains function public static int doubletoint(double val) { return (0 < val) ? (int)(val + 0.5) : (int)(val - 0.5); } i wonder why 'converts' val integer? the cast double int takes floor, adding .5 (or subtracting .5 if negative) means 1.6 returns 2, while 1.4 return 1.

How to Generate a Report Card for Students from This Three Table with Mysql and Php -

i have 3 tables link together. want generate report card students in class. table students_info name sex age students_id --------- --- --- ----------- kinsley m 12 1 michael m 12 2 rhianna f 22 3 table scores_panel 1stca 2ndca exam students_id subjectid ----- ----- ---- ----------- --------- 23 15 42 1 1 10 12 7 1 2 43 15 62 1 3 10 12 27 2 1 10 12 57 2 2 23 15 12 2 3 11 12 27 3 1 04 12 57 3 2 13 25 12 3 3 table subject subjectname subjectid ----------- --------- english 1 maths 2 biology 3 i want result this: name kinsley sex m age 12 and report card follow subject 1stca 2ndca exam --------- ----- ----- ---- english 23 15 42 maths ...

java - Downloading set of XML files as a zip file in JSF -

i have string array in each string contains xml content.i have put each string file , have download xmls zip file. how can achieve using jsf. example code: string content="<?xml version="1.0" encoding="utf-8"?> <head> <car> <model>i10</command> <price></target> </car></head>"; httpservletresponse response = (httpservletresponse) facescontext.getcurrentinstance() .getexternalcontext().getresponse(); zipoutputstream zos = new zipoutputstream(response.getoutputstream()); zipentry ze= new zipentry("spy.log"); zos.putnextentry(ze); zos.write(content.getbytes()); zos.closeentry(); response.setcontenttype("application/zip"); response.setheader("content-disposition", "attachment;filename=fyi.zip"); response.setheader("content-transfer-encoding", ...

c++ - Send Hex Bytes To A Serial Port -

i attempting send hexadecimal bytes serial com port. issue segment sends command apparently wants system string instead of integer (error c2664 "cannot convert parameter 1 'int' 'system::string ^'). have looked way send integer instead have had no luck. (i have tried sending string representations of hexadecimal values, device did not recognize commands) main part of code private: system::void poll_click(system::object^ sender, system::eventargs^ e) { int i, end; double = 1.58730159; string^ portscan = "port"; string^ translate; std::string portresponse [65]; std::fill_n(portresponse, 65, "z"); (i=1;i<64;i++) { if(this->_serialport->isopen) { // command 0 generator int y = 2; y += i; int command0[10] = {0xff, 0xff, ...

Receiving NullPointerException while using Jasypt and Spring Security 3.1 -

i trying configure jasypt spring security. configuration file looks this: jdbc.driver=com.mysql.jdbc.driver jdbc.url=jdbc:mysql://localhost:8090/sample jdbc.username=enc(*****) *****=the salted username jdbc.password=enc(*****) *****=the salted password my servlet xml contains proper bean setup in format: <bean id="propertyplaceholderconfigurer" class="org.jasypt.spring31.properties.encryptablepropertyplaceholderconfigurer"> <constructor-arg ref="configurationencryptor" /> <property name="location" value="/web-inf/jdbc.properties" /> </bean> <bean id="configurationencryptor" class="org.jasypt.encryption.pbe.standardpbestringencryptor"> <property name="config" ref="environmentvariablesconfiguration" /> </bean> <bean id="environmentvariablesconfiguration" class="org.jasypt.encryption.pbe.confi...

ios - animation hide/show only occurring once -

im trying animation on uipicker when app runs hidden , when button pressed appear sliding buttom , when tap button again slide away. well, code once. does: first click -> show picker, ispickerhidden = no second click -> hides picker, ispickerhidden = yes third click -> not anything, returns ispickerhidden = no in viewdidload declaration are; and same fourth click doesnt return correct bool value. ispickerhidden = yes; [self.picker sethidden:ispickerhidden]; if(ispickerhidden == no){ [uiview beginanimations:nil context:nil]; [uiview setanimationduration:0.6]; cgrect frame = self.picker.frame; [self.picker setframe:cgrectoffset(frame, self.picker.frame.origin.x, self.picker.frame.origin.y)]; [uiview commitanimations]; ispickerhidden = yes; nslog(@"hidden yes"); }else if(ispickerhidden == yes) { [uiview beginanimations:nil context:nil]; [uiview setanimationduration:0.6]; ...

ios - heightForRowAtIndexPath - how to default to maximum element height of cell -

i have been developing couple of tableviews now. feel wasting time implementing heightforrowatindexpath time. there way default height maximum element y value of row, constructed cellforrowatindexpath adding default padding? i asking myself, why method not in default ios , developers may override method, if cellforrowatindexpath memory consuming. the following code show how implement our call - heightforrowatindexpath : - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath; { nsstring *text = [items objectatindex:[indexpath row]]; cgsize constraint = cgsizemake(cell_content_width - (cell_content_margin * 2), 20000.0f); cgsize size = [text sizewithfont:[uifont systemfontofsize:font_size] constrainedtosize:constraint linebreakmode:uilinebreakmodewordwrap]; cgfloat height = max(size.height, 44.0f); return height + (cell_content_margin * 2); }

From numpy matrix to C array. Segmentation fault (memory corruption) on 64bit architecture -

i'm trying build python c extension in order pass numpy matrix c array. following suggestions reported here: http://wiki.scipy.org/cookbook/c_extensions/numpy_arrays but when python tries run c line: v=(float **)malloc((size_t) (n*sizeof(float))); of follow portion of code: float **_ptrvector(long n) { float **v; v=(float **)malloc((size_t) (n*sizeof(float))); if (!v) { printf("in **ptrvector. allocation of memory array failed."); exit(0); } return v; } float **pymatrix_to_carray(pyarrayobject *arrayin) { float **c, *a; int i,n,m; n = pyarray_dim(arrayin, 0); m = pyarray_dim(arrayin, 1); c=_ptrvector(n); = (float*) pyarray_data(arrayin); ( i=0; i<n; i++) { c[i]=a+i*m; } return c; } i segmentation fault on linux 64 bit machine. problem code works on 32 bit machines (both windows , linux). sizeof(size_t) returns correctly 4 on 32bit machines , 8 on 64bit machines. i'm us...

javascript - Fine Uploader error with internet explorer 10 -

i using fine uploader 3.7.0 in project chrome , firefox , works fine, internet explorer 10 files uploaded correctly user "upload failed" error message, demo tests: <script> $(document).ready(function() { var errorhandler = function(event, id, filename, reason) { qq.log("id: " + id + ", filename: " + filename + ", reason: " + reason); }; var myuploader = new qq.fineuploader({ element: $('#basicuploadbutton')[0], multiple: false, callbacks: { onerror: errorhandler }, request: { endpoint: '/fineupload/receiver' } }); }); </script> <div class="fineuploader"> <span>please upload files automated process.</span> <div id="basicuploadbutton" class="upload-btn"></div> </div> <br /> <div><a href="#" onclick="window.cl...

kendo ui - KendoUI - Cascading Dropdownlist when using MVVM and Remote Data -

i have kendoui dropdownlist fetches data web service, depending on selected item 2nd dropdown populated. using mvvm binding. my code looks like: <div id="ddldiv"> <div data-container-for="measure" required class="k-input k-edit-field"> <select id="measure" name="measure" data-role="dropdownlist" data-text-field="field_name" data-value-field="field_id" data-bind="value: summarydef.measureid, source: fieldlist" ></select> </div> <div data-container-for="operation" required class="k-input k-edit-field"> <select id="operation" data-cascade-from: "measure" data-role="dropdownlist" data-text-field="type" ...

dojox.grid.datagrid - Dojo TabContainer doesn't get formatted correctly until after I do an Inspect Element -

Image
i have dojo datagrid few rows of data. when click on row, have tabcontainer created in <div> . here's ends looking like: the formatting tabcontainer incorrect. however, after "inspect element", formatting corrects itself: however, submit button disappears after formatting corrected. here's code use create datagrid , tabcontainer : <div id="r_body"> <div id="r_list"> </div> <div id="r_form"> <div data-dojo-type="dijit/form/form" id="parameters_form" data-dojo-id="parameters_form" enctype="multipart/form-data" action="" method=""> {% csrf_token %} <div> <div id="r_tab_container"></div> </div> <div> <p></p> <button id="submit_parameters" dojotype=...

ios - Resolving MVC chaos -

the following setup: controller (.h/.m) connectionmanager (.h/.m) - sends requests using afnetworking requesthandler (.h/.m) - build request params keymanager (.h/.m) - writes database i have send request server data keymanager. here request sent using afnetworking in connectionmanager . request parameters , url request constructed requesthandler but problem in order construct request have data requested controller , when initialize controller inside requesthandlers throws error controller type can't found controller -> connectionmanager -> requesthandler -> controller -> connectionmanager -> server please me dismantle mess or solution. how pass current instance of class new instance of class. the best option resolve these kind of circular definitions use #import directives in .m files , instead use @class in .h files. so if need reference class x in api class y, in y.h, add @class x , in y.m , add #import x @class d...

xaml - How can I add a resource to a silverlight custom control? -

i trying trim selected value of silverlight custom control combobox. have found using ivalueconverter class should way go. create in library public class stringtrimmer : ivalueconverter { public object convert(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { return value.tostring().trim(); } public object convertback(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { throw new notimplementedexception(); } } this xaml combobox <usercontrol x:class="silverlightcontrollibrary.silverlightcomboboxcontrol" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d" height="25...

Tell Chrome which include files I want opened by default in devtools' Sources tab -

is there way tell chrome open include files in devtools' sources tab default? find annoying have manually browse sources tree find file want debug when it's same file every time. envision being able add sort of attribute in link or script tags tell chrome have source tabs open , waiting me: <!-- editperson.html --> <link href="editperson.css" type="text/css" rel="stylesheet" chrome-source /> <script src="editperson.js" type="text/javascript" chrome-source ></script> does know of how can this, plugin/native ? my question sort of similar programmatically open js/css file in dev tools 'sources' panel , want pre-open tabs files have been included in html. right now, devtools remember tabs last had open, can't configure beyond that. thing cmd + o fast opening files, , it'll getting improvements in scoring relevant files ...

osgi - Weird OutOfMemoryError from JBoss AS 7.2 -

i'm experiencing odd outofmemoryerror when deploying osgi/blueprint bundles in jboss 7.2. of bundles cause error if present in deployment directory when start jboss - in combination each other. in current setup have 4 bundles - let's call them a , b , c , d . a , b depends on c , d not on each other, , use various external libraries have deployed. if c , d deployed 1 of a , b when jboss starts, seems deploy fine, if both a , b present following stack trace: 16:42:30 error [org.jboss.msc.service.fail] msc00001: failed start service jbosgi.persistentbundles.resolve: org.jboss.msc.service.startexception in service jbosgi.persistentbundles.resolve: failed start service @ org.jboss.msc.service.servicecontrollerimpl$starttask.run(servicecontrollerimpl.java:1767) [jboss-msc-1.0.4.ga.jar:1.0.4.ga] @ java.util.concurrent.threadpoolexecutor$worker.runtask(threadpoolexecutor.java:895) [rt.jar:1.6.0_45] @ java.util.concurrent.threadpoolexecutor$w...

selenium - how to disable cookies using webdriver for Chrome and FireFox JAVA -

i want launch browsers(ff, chrome) test disabled cookies, tried this: service = new chromedriverservice.builder() .usingdriverexecutable(new file("src/test/resources/chromedriver")) .usinganyfreeport().build(); try { service.start(); } catch (ioexception e1) { e1.printstacktrace(); } desiredcapabilities capabilities = desiredcapabilities.chrome(); capabilities.setcapability("disable-restore-session-state", true); driver = new chromedriver(service, capabilities); but it's not work... i've solution firefox: firefoxprofile profile = new profilesini().getprofile("default"); profile.setpreference("network.cookie.cookiebehavior", 2); driver = new firefoxdriver(profile); but don't know how manage chrome.

json - Composer does not generate autoloader information (autoload_namespaces.php) -

i have trouble getting project correctly installed through composer. have own custom package (library) hosted in non public git repo (but centralized) fetched composer (dummy project containing composer.json testing package). so structure that: /test/project/composer.json index.php content of composer.json: { "name": "vendor/test", "description": "test-description", "authors": [{ "name": "benjamin carl", "email": "email@testdomain.com", "homepage": "http://www.testdomain.com", "role": "developer" }], "keywords": [ "foo", "bar" ], "homepage" : "http://www.testdomain.com/", "license" : [ "the bsd license" ], "repositories": [{ "type": ...

php - XAMPP why is my else bug? -

evertime load page get parse error: syntax error, unexpected ')' in c:\xampp\htdocs\zerowebsite\uploadtest.php on line 19 <html> <head> <title></title> </head> <body> <form action="uploadtest.php" method="post" enctype="multipart/form-data"> <input type="file" name="image"> <input type="submit" value="upload"> </form> <?php mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("dataimage") or die (mysql_error()); $file = $_files['image']['tmp_name']); if (!isset($file)) echo "select image"; else // line 19 { $image = addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name = addslashes($_files['image']['name']); ...