Posts

Showing posts from April, 2013

ruby on rails - has_one association isn't working -

i have following activerecord models: class user < activerecord::base has_one :faculty end class faculty < activerecord::base belongs_to :head, class_name: 'user', foreign_key: :user_id end when try pull user using association faculty.head record without errors, when type user.faculty error: faculty load (1.8ms) select "faculties".* "faculties" "faculties"."user_id" = 1 limit 1 activerecord::statementinvalid: pg::undefinedfunction: error: operator not exist: character varying = integer line 1: ...".* "faculties" "faculties"."user_id" = 1 limit ... my faculties db schema looks this: create_table "faculties", :force => true |t| t.string "name" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false t.string "user_id" end is pg bug?? the error occurs because hav...

Elegant way to search (PHP + MySQL) -

we have website written in codeigniter framework. want have nice , fast soundex based search function site. it's micro blog search in titles of posts. so best us? i have 2 ideas: create column in post table soundex copy of title , have full-text index on it. explode words titles , save soundex equivalent of words in new table id of post. automatic tag system. which method better , why? can suggest better way? thanks answers! soundex great - doesn't meet user expectations search (established google etc.). the common solution text searching, including fuzzy searches , stemming, use solr ; it's relatively easy integrate php using web service calls. the zend framework has lucene integration (never used it, might save time) - lucene open source free text search platform .

Two level loop over a matrix's row in R -

i need convert iteration below matrix operation. a = certain_matrix(3,5) mat = matrix(0, 3,3) ( in 1:3 ) ( j in 1:3 ) mat[i,j] = certain_distance(a[i,], a[j,]) roughly need use apply(). however, cannot hold of row index in apply(a, 1, function(x) xxx) so how perform operation fast?

ruby on rails - error when updating whilst using acts-as-taggable -

good morning everyone, i've been stumped error days or 2 now. my app small "sample request log" textiles based company, needs track samples , able edit/submit/delete them. whenever try update or create new request "undefined method `each' "x":string" x option chosen in drop down list (the drop down list populated controller.) request_controller.rb: class requestscontroller < applicationcontroller before_action :set_request, only: [:show, :edit, :update, :destroy] # /requests # /requests.json def index if params[:tag] @requests = request.tagged_with(params[:tag]) else @requests = request.all @requests = request.order("request_date asc") end end # /requests/1 # /requests/1.json def show end # /requests/new def new @request = request.new @customers = customer.all @suppliers = supplier.all @designers = designer.all @statuses = status.all end # /requests/1/edit def edit ...

SoapUI- Is it possible to create a Mock service from a sample oData call? -

is possible create mock service sample odata call in soapui? (without wsdl) you can try below sample: http://www.soapui.org/getting-started/rest-sample-project.html cheers...

Set raw resource as ringtone in Android -

in android application, want set audio file raw folder ringtone. wrote below code, not working. please me solve issue. thank you. code : string name =best_song_ever.mp3; file newsoundfile = new file("/sdcard/media/ringtone", "myringtone.mp3"); uri muri = uri.parse("android.resource://" + context.getpackagename() + "/raw/" + name); contentresolver mcr = context.getcontentresolver(); assetfiledescriptor soundfile; try { soundfile = mcr.openassetfiledescriptor(muri, "r"); } catch (filenotfoundexception e) { soundfile = null; } try { byte[] readdata = new byte[1024]; fileinputstream fis = soundfile.createinputstream(); fileoutputstream fos = new fileoutputstream(newsoundfile); ...

design - General rules for detemining which models/controllers one needs when building a Rails app -

i rails newbie. had @ different tutorials , books. 1 common thing teach different aspects of rails following step-by-step guide on building simple app. shows how things. however, more interested in following question - if know app should in terms of features , does, how determine models/controllers need? mean, in tutorials tell you, example, build users model, posts model , comments model (if it's blog app), how know upfront need these models? there general rules when unit of application should become model vs. keeping part of existing model? a brief example: want build enterprise voting app, each user can assigned 1 or more shareholders , take part in general meetings each meeting containing several agenda items, can vote on. o.k., need user model/controller, maybe shareholders model, meetings model , questions model, how figure out if need other models? the quick answer there no general rules this. it idea sit down pen , paper , sketch out application objects , ...

mysql - how to select on same table twice In one query or round-trip? -

ok here code-snipet of have tried: private static void checkforchanges(mysqlconnection connection) { datetime hair = datetime.parse(smartstyledataset.tables["hair"].compute("max(lastupdated)", null).tostring()); datetime cloths = datetime.parse(smartstyledataset.tables["cloths"].compute("max(lastupdated)", null).tostring()); datetime accessories = datetime.parse(smartstyledataset.tables["accessories"].compute("max(lastupdated)", null).tostring()); datetime cosmetics = datetime.parse(smartstyledataset.tables["cosmetics"].compute("max(lastupdated)", null).tostring()); list<string>[] newrows = { new list<string>(), new list<string>(), new list<string>(), new list<string>() }; using (var command = connection.createcommand()) { connection.open(); command.commandtext = ...

java - how to Encode and decode text in Jsp -

<%@page import="java.net.urldecoder"%> <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@page import="java.net.urldecoder"%> <%@page import="java.net.urlencoder"%> <html> <form action="index.jsp"> <body> first input: <input name="firstinput" type="text" name="fname"> <br> <input type="submit" value="submit"> <% string first = request.getparameter("firstinput"); string searchtext=urldecoder.decode(first,"utf-8"); out.println(searchtext); out.println(urlencoder.encode(searchtext,"utf-8")); %> </body> </form> </html> this code want encode , decode text in jsp actully want when input text ...

css - HTML Overflow Not Clean -

i have fiddle i use css: #body { overflow-y:scroll; } to make content area scrollable, don't have scroll page. my aim have full height side bar @ times, figured have content element #body have scroll , fine. however, makes border weird when scrolling data, bottom border isn't scrolling it's redrawn, how past that? if me tidy css , elements based on information great part 2: want there 2 panels, left fixed width , right taking remainding width of screen? how do can have #body take 90% of second panels' width without having set fixed width loads of left margin? thanks, i think problem #body element (might want rename clarity since theres html body element) partially hidden under sidebar. if give left:300px scroll bar no longer hidden left issue of right pane needing width determined size of browser window. have @ this: css layout 2-column fixed-fluid links article : http://www.dynamicdrive.com/style/layouts/item/css-liquid-layout-21-fixed...

javascript - Modify headers on onHeadersReceived -

in chrome extension need add line header of every site browsed. in background.js file add such code: var responselistener = function(details){ var rule = { "name": "access-control-allow-origin", "value": "*" }; details.responseheaders.push(rule); return {responseheaders: details.responseheaders}; }; chrome.webrequest.onheadersreceived.addlistener(responselistener, {urls: [ "*://*/*" ] }, ["blocking", "responseheaders"]); while debugging handler called , newly added header passes filters have found upper in stack. not seen on network tab's response headers section , not effects code. use these permissions: "tabs","<all_urls>", "http://*/*" ,"webrequest","webrequestblocking", "webnavigation" is there new policy or api changed disallow such things or there bug in 10 lines of code? the...

.htaccess - Rewrite only one specific url -

i want rewrite 1 specific url. http://example1.com should http://example2.de . but http://example1.com/subdir or http://sub.example1.com should remain same. i found following, rewrites example1.com, every url starts example1.com options +followsymlinks rewriteengine on rewritecond %{http_host} ^example.com [nc] rewriterule ^(.*)$ http://www.example.com/$1 [l,r=301] background: want redirect main page of wp-multisite want make sure can work backend of wordpress , run other multisites subdomains. you're pretty close don't need capture uri in $1 : options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritecond %{http_host} ^(www\.)?example1\.com$ [nc] rewriterule ^$ http://example2.de/ [l,r=301]

year n+1 < year n in excel vba -

i have problem excel not recognizing years properly. here code ' sort value max = sheets("booking").cells(rows.count, "a").end(xlup).row range("a1:h" & max).select activeworkbook.worksheets("booking").sort.sortfields.clear activeworkbook.worksheets("booking").sort.sortfields.add key:=range("d2:d" & max) _ , sorton:=xlsortonvalues, order:=xldescending, dataoption:=xlsortnormal activeworkbook.worksheets("booking").sort.sortfields.add key:=range("a2:a" & max) _ , sorton:=xlsortonvalues, order:=xlascending, dataoption:=xlsortnormal activeworkbook.worksheets("booking").sort .setrange range("a1:h" & max) .header = xlyes .matchcase = false .orientation = xltoptobottom .sortmethod = xlpinyin .apply end ' mark past booking in italic , in red if not validated l = 2 max if format(cdate(booking.cells(l, 5).value), "dd-mm-yy") ...

Api google adwords - client_secret for oAuth2.0 -

i have problem api adwords. don't have client_secret code.google.com/apis/console. created project , add api access application don't see client_secret in box service account. i have client id, email address, public key fingerprints, private key, , client_secret.json. in api adwords php config file auth.ini: [oauth2] ; if not have client id or secret, please create 1 of type ; "installed application" in google api console: ; https://code.google.com/apis/console#access client_id = "insert_oauth2_client_id_here" client_secret = "insert_oauth2_client_secret_here" ... but don't have client_secret. did wrong? or give me suggestions? the php application trying use not work service accounts. in order client secret have create client id of type "web application".

AngularJS - Karma (e2e) : Executed 0 of 0 ERROR -

i experiencing problem not solve time, , getting frustrating since don't have idea doing wrong in it. :) appreciated. using requirejs in applications well. trying build; https://github.com/cengizism/base when try start e2e test on console; info [karma]: karma v0.10.0 server started @ http://localhost:8080/_karma_/ info [launcher]: starting browser chrome info [chrome 28.0.1500 (mac os x 10.8.4)]: connected on socket id n-0avrlicogs2nwbfgdz chrome 28.0.1500 (mac os x 10.8.4): executed 0 of 0 error (0.208 secs / 0 secs) my configuration file looks this; module.exports = function(karma) { 'use strict'; karma.set({ frameworks: ['jasmine', 'ng-scenario'], files: [ 'app/vendors/angular-scenario/angular-scenario.js', 'test/e2e/*.js' ], basepath: '', exclude: [], reporters: ['progress'], port: 8080, runnerport: 9100, ...

javascript - `new Date("2013-08-08T09:40")` not working in jweek calendar plugin -

Image
i have problem jquery weekcalendar demo plugin work in mozilla not in chrome . i found problem datetime : in demo.js file : alert(new date("2013-08-08t09:40")); so work mozilla firefox output fine but in chrome (version 28.0.1500.95m) not working : wrong output : so please me out . need same output chrome proper format is new date("2013-08-08t09:40z"); http://www.w3.org/tr/note-datetime if want play local timezone game must manually calculate offset want , use in format: new date("2013-08-08t09:40+05:30"); it easier use utc though. if don't want specify timezone, need use different constructor: new date(2013, 7, 8, 9, 40); this result in instant dependent on whatever timezone settings user has on computer.

android - Application package 'androidmanifest.xml' must have a minimum of two segments -

i attempting upload existing app samsung store via 100% indie website. automated submission process demands apk file nameofapp.apk no "." characters allowed before ".apk". changed package name in manifest so: was: package="com.mycompany.mygame" now: package="mygame" but got error - application package 'androidmanifest.xml' must have minimum of 2 segments. , there appears no way round this. create multi-segment signed apk , manually rename it... i'm nervous whether kosher. have other options? you should keep package names was: com.mycompany.mygame the package name doesn't affect name of apk. in fact, eclipse lets choose file name when export application. renaming package won't change file name. hope helps :)

c++ - Widget won't hide -

i guess silly question why doesn't widget hide after shown? void dialog::on_tabwidget_selected(const qstring &arg1){ qwidget *w = new qwidget(); if(ui->tabwidget->currentindex() == 3){ w -> move(1093,278); w -> setwindowflags(qt::windowstaysontophint | qt::framelesswindowhint); w -> setfixedsize(206,206); w -> show(); }else{ w ->hide(); } } the second time, creats new qwidget, hide not affect old widget if that's want do. maybe should explain little bit more result expected ? edit: if want display popup when tab open, use widget's showevent , hideevent. or can remove "widget *w = new widget();", add "qwidget *w;" *.h, , add "w = new qwidget();" constructor, , should work.

java - state machine in android -

Image
i have code excercise. i want press 2 circles (states), , link them line. when both pressed, appears alert allows choose input , output. i want input , output written on path, (in case canvas.drawtextonpath). i have problems with: the alert not returns "text" well the text on path appears without line! if can helps me excercise (chat, mail...), because i'm blocked this. appreciate lot. thank you this 1 of errors,the text written line not. import android.app.activity; import android.app.alertdialog; import android.content.context; import android.content.dialoginterface; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.graphics.path; import android.graphics.rectf; import android.os.bundle; import android.view.menu; import android.view.motionevent; import android.view.view; public class mainactivity extends activity{ //coordenadas x y en el momento en el que tocas la pantalla float x...

css - Font and icons not appearing on Windows phones only -

i'm using phonegap 3.0 create application on android, ios, , windows phone. use custom font-face text , icons. when viewed in windows phone 8, font , icons won't appear on application. i have tried loading fonts after device ready event; using .woff font; loading external source - nothing works. how solve this? i heard problem before, apparently there issue present in windows phone 8 prevents custom font-faces working when html/css hosted locally. try , host html/css files externally? see if makes difference. think bug in current webbrowser control that's used on wp8 edit: see stackoverflow questions , answers similar problem

How to convert a comma separated String to ArrayList in Java -

this question has answer here: how convert comma-separated string arraylist? 21 answers i have comma separated string need convert arraylist . tried way import java.util.arraylist; import java.util.arrays; public class test { public static void main(string[] args) { string commaseparated = "item1 , item2 , item3"; arraylist<string> items = (arraylist)arrays.aslist(commaseparated.split("\\s*,\\s*")); for(string str : items) { system.out.println(str); } } } its giving me runtime error shown exception in thread "main" java.lang.classcastexception: java.util.arrays$arraylist cannot cast java.util.arraylist @ com.tradeking.at.process.streamer.test.main(test.java:14) as trying convert list arraylist force . the ...

python - Accessing TeamCity test results from script in a subsequent build step -

i have build step reports number of run tests teamcity. i access number (and other data) in subsequent build step, ideally python or powershell script. looking @ teamcity messages , seem allow transmitting data script teamcity, not other way around. how can access number of succeeded/failed tests script in subsequent build step? one simple way can think of put data in file - "testresults.txt". in next build step, read txt file normal file operations. you can across build configurations making file artifact in 1 configuration , fetching in another.

css - Images not appearing in Joomla template -

i'm new joomla, i've followed few tutorials. i've created template website, no images showing up. looking source, image references like: <img src="/templates/fiziaimages/zdjeciedol.png" /> when should looking like: <img src="/templates/fizia/images/zdjeciedol.png" /> ^ fizia/images correct directory, don't know causes backslash not appear. in first time can use browser inspector verify if images found. if it's ok can try put images in "image" directory in root of website

c# - Azure active directory -

i have client-server application deployed on azure. when try connect azure server use app need know user in ad or not. before establish connection server user types password , login sent server in connection request. thank help. since you're targeting ad, windows azure active directory might you're looking for.

vb.net - What is the equivalent to "ByRef" in Java? -

this question has answer here: is java “pass-by-reference” or “pass-by-value”? 73 answers i'm working on translating code visualbasic java , i've encountered snag when using byref keyword in vb. doesn't exist in java! how should simulate byref call in java? edit: clarify don't know vb, byref identifies variable in parenthesis after calling function , makes when variable changes inside of function, change higher called opposed byval value of variable remembered. changing byval variable in method not affect variable called. you can't. in java passed value, including object references. create "holder" object, , modify value inside method. public class holder<t> { t value; public holder(t value) { this.value = value; } // getter/setter } public void method(holder<foo> foo) { foo.setvalu...

Grails show my URL in controller -

i pulling components of url. used request.getrequesturl() , url looks wrong: it's missing id, example. i'm getting this:: ..//apka/grails/aaa/edit.dispatch" but need this: ..//apka/grails/aaa/edit/34" do have solutions? you can information require request.forwarduri , grails specific addition usual httpservletrequest. result you're getting request.requesturl result of url mapping mechanism, , kind of "canonical form" /grails/controller/action.dispatch . forwarduri went in url mapping mechanism, i.e. uri user requested.

mysql - Laravel 4 Method Improvement -

i have index method: public function index() { // in view, there several multiselect boxes (account managers, company names , account types). code retrives values post method of form/session. $company_names_value = input::get('company_names_value'); $account_managers_value = input::get('account_managers_value'); $account_types_value = input::get('account_types_value'); // if there has been no form submission, check if values empty , if assign default. // essentially, of records in table column required. if (is_null($company_names_value)) { $company_names_value = db::table('accounts') ->orderby('company_name') ->lists('company_name'); } if (is_null($account_managers_value)) { $account_managers_value = db::table('users') ->orderby(db::raw('concat(first_name," ",last_name)')) ->select(d...

php - Chat using nodejs+socket.io and mysql -

so want develop chat system based on nodejs , socket.io, have made prototype , works, thing stuck in mind how store chat messages in database. i guess not idea store message when user hits enter button, because live chat have 1000 user in 30-60 min. the question when store data in database, because don't think storing right away when user hits enter work on long term? the chat works on same idea facebook. if not saving messages @ moment, how plan save them when want to? the messages sent have been delivered client , server no longer has them, , can't use client store them in database. you need store messages user sends them.

image processing - How to read a BMP file in Visual C++ and extract width, Height and data with a example -

iam new c++ pro in image processing using matlab iam looking header file (ex: cimg.h )which can read bmp , retrieve length width , 2d array similar 'imread' function in matlab... not allowed use opencv opengl an example tia

debugging - (solved) c++ fix syntax debug with *lec=fopen(); -

i working on c++ code friend know better do, , code has bug, i'd fix this, since couldn't figure out how... edit compiler stops @ line 59 where: file *ecr("result.txt","wt"); written. there many other things fix, fixed until 49 (59 ;) ) blocked again... thanks! edit (again, sorry) message: c:\users\ad\desktop\python\josh\josh\color\3d\solution_to_array.cpp||in function 'int main()':| c:\users\ad\desktop\python\josh\josh\color\3d\solution_to_array.cpp|59|error: expression list treated compound expression in initializer [-fpermissive]| c:\users\ad\desktop\python\josh\josh\color\3d\solution_to_array.cpp|59|error: cannot convert 'const char*' 'file* {aka _iobuf*}' in initialization| c:\users\ad\desktop\python\josh\josh\color\3d\solution_to_array.cpp|82|error: expected initializer before '<' token| c:\users\ad\desktop\python\josh\josh\color\3d\solution_to_array.cpp|82|error: expected ';' before '<...

Oracle dba_tab_cols query -

hi possible retrieve primary key , unique key using dba_tab_cols query? is there query allows me retrieve of following fields? column name data type primary key null/not null unique key default value extra both primary , unique keys can span more 1 column, wouldn't belong in dba_tab_columns . you'd need @ dba_constraints , dba_cons_columns information. this starting point, maybe: select owner, table_name, column_name, data_type, primary_key, nullable, unique_key, data_default ( select dtc.owner, dtc.table_name, dtc.column_id, dtc.column_name, dtc.data_type, dtc.nullable, dtc.data_default, case when dc.constraint_type = 'p' , dcc.column_name = dtc.column_name dc.constraint_name end primary_key, case when dc.constraint_type = 'u' , dcc.column_name = dtc.column_name dc.constraint_name end unique_key, row_number() on (partition dtc.owner, dtc.table_name, dtc.column_id order null) rn dba_tab_colum...

remove special character [ ] in array java -

in program have following string of array, when process program output have square bracket [], need without square bracket []. suggestion in how remove them? private final static string[] l0 = {"az","fh md br", "inr gt cn", "bl gs st st", "mae nw get", "pam ml rm", "comr lab pl mt hs", "za"}; public static string sfuffle() { list<string> shuffled = new arraylist<string>(arrays.aslist(phrasestring)); collections.shuffle( shuffled ); system.out.println(shuffled);// added have output return shuffled + "\n"; } output: [az, mae nw get, bl gs st st, fh md br, za, comr lab pl mt hs, inr gt cn, pam ml rm] my desired output be: az, mae nw get, bl gs st st, fh md br, za, comr lab pl mt hs, inr gt cn, pam ml rm just use substring() : string str = shuffled.tostring(); return str.substring(1, str.length() - 1) + "\n"; by popular demand, i...

c# - View cached data in ASP.NET MVC -

is there third party tool or in visual studio lets see cached objects? for example, action caching data (varied parameters) , want see cached objects , attributes (like parameter values sent action when data cached). you can find more answers might desire on stackoverflow question: how display content of asp.net cache? basically can create page view cached items application. after that, can customize , ui pump needs , objectives. if need debug, can use ringer's solution displayed on comments.

java - Facebook restfb using jsonObject stopped getting likes count -

i using restfb number of likes in specific post, , working well. somehow, morning stopped working, , didn't change in code. problem on following line: posts.get(i).getjsonobject("likes").getstring("count")) after retrieving posts page, when trying number of likes post has, this: com.restfb.json.jsonexception: jsonobject["count"] not found. i used graph api explorer see if search working , check if "count" appeared on results, , does: "likes": { "data": [ { "name": "kobi parfait", "id": "100000605529126" }, { "name": "john foley", "id": "100002480987029" }, { "name": "camilla slima", "id": "1267755442" }, { "name": "augustine paz", "id": ...

How can I renew a Users Facebook Access Token? -

if user loggs app facebook account access token valid 2 months. happens if 2 months exceed , user loggs app again? new 2 month access token automatically? your user have go through normal authentication process did when first installed application. during process, facebook detect application has been installed , refresh access token. so, directly answer question: yes , receive new access token.

rows - Change all records at once. Update one field with same input mysql -

i trying change input 1 field of records though can't figure out. appreciated. i trying change them using: select * `users` set 'password'='newpassword'; update proper command changing values in mysql - example: update `users` set password='new_password_string' password not null

iphone - Convert GMT NSDate to device's current Time Zone -

Image
i'm using parse.com store values: these gmt values. how convert these device's current time zone , nsdate result? nsdate represented in gmt. it's how represent may change. if want print date label.text , convert string using nsdateformatter , [nstimezone localtimezone] , follows: nsstring *gmtdatestring = @"08/12/2013 21:01"; nsdateformatter *df = [nsdateformatter new]; [df setdateformat:@"dd/mm/yyyy hh:mm"]; //create date assuming given string in gmt df.timezone = [nstimezone timezoneforsecondsfromgmt:0]; nsdate *date = [df datefromstring:gmtdatestring]; //create date string in local timezone df.timezone = [nstimezone timezoneforsecondsfromgmt:[nstimezone localtimezone].secondsfromgmt]; nsstring *localdatestring = [df stringfromdate:date]; nslog(@"date = %@", localdatestring); // local timezone is: europe/london (gmt+01:00) offset 3600 (daylight) // prints out: date = 08/12/2013 22:01

php - calling database to check for errors in a web app -

i'm building web app check errors in our mobile app has web interface. i'm having trouble calling database through php. in mobile app called in objective c by: -(bool)login:(nsstring *)username password:(nsstring *)password{ // create new sbjson parser object nsstring * passwordtoserver = [self sha1:[nsstring stringwithformat:@"removed security", password]]; nsstring * authtoken = [self sha1:[nsstring stringwithformat:@"%@%@%@", securestring, username, passwordtoserver]]; nsdata* data = [nsdata datawithcontentsofurl: [nsurl urlwithstring:[nsstring stringwithformat:@"%@/%@%@", serverurl, @"api/login/", authtoken]]]; // json nsstring nsdata response nsstring *json_string = [[nsstring alloc] initwithdata:data encoding:nsutf8stringencoding]; if([json_string isequal:@"error"]){ loggedin = false; return false; } else{ //get campagns how call server using php if have serverurl, securestring , passw...

ios - How to add a UIView to the entire UICollectionView -

i have uicollectionview custom layout. shows items in grid (2 columns) , has multiple sections. works perfect. now, want add uiview @ top of uicollectionview. note: not view per section. view entire uicollectionview. what best approach achieve this? keep in mind uicollectionview shows custom uiview each section. actually, want can uitableview tableheaderview.

html - How to resize the box but still put text inside it at center? -

in following html: <div class='title'><h2>title</h2></div> i want resize box, wrote following: .title { display: block; border-radius: 12px; border: 1px solid; } however, resultant box looks bit big, hence tried resize it. .title { height: 90%; } however, if tried write above code, resultant box isn't affected settings. .title { height: 100px; } this worked. however, text inside no more on center, tried make @ center. .title h2 { vertical-align: middle; } however, doesn't work. so how can resize box still have text inside intact? also, why first height setting doesn't work second does? thanks. try applying: ( working jsfiddle ) .title h2 { margin:0px; line-height:100px; /* change fit needs */ } vertical-align not best approach in case.. update: use this jsfiddle instead, uses vertical-align wanted , don't need apply line-height of h2 .. secret making parent display:table; , child...

OpenLayers: transform GPS coordinates to EPSG:25832 -

i want gps coordinates button click , change them epsg:25832 format center map. here have coded far: jquery('#btngps').click(function() { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(success); } else { alert("not supported!"); } }); function success(position) { alert(position.coords.longitude + ',' + position.coords.latitude); var srs_map = new openlayers.projection("epsg:25832"); var srs_lonlat = new openlayers.projection("epsg:4326"); var center = new openlayers.lonlat(position.coords.longitude,position.coords.latitude); var test = center.transform(srs_lonlat,srs_map); alert(test); } finally map object: map = new openlayers.map('map',{ controls: [ new openlayers.control.navigation(), new openlayers.control.panzoombar(), new openlayers.control.scaleline(), new openlayers.control.key...

google plus - Adding a review box to site that posts to G+ Local page -

i wondering if possible add review box site automatically post google+ local page, , in turn show google review. i want simple functionality of leaving comment , star rating site avoid having travel page. is functionality available? i have found slight shortcut adding query parameter ?review=1 end of url automatically brings review box once google places page loads, , have customized message try , entice click feel easier make on leave review more successful be. i'm sorry don't have functionality.

javascript - How to place labels on opposite Y axis in Highchart without a second series -

Image
i have following chart set in highcharts : // initialize chart when document loads. $(document).ready(function() { $('#results').highcharts({ chart: { type: 'bar' }, title: { text: '' }, xaxis: [{ categories: [ 'injustice: gods among ★', 'tekken tag tournament 2 ★', 'super smash bros. melee ★', 'persona 4 arena', 'king of fighters xiii', 'dead or alive 5 ultimate', 'street fighter x tekken ver. 2013', 'soulcalibur v' ], }], yaxis: { allowdecimals: false, title: { text: 'votes' } }, series: [{ data: [ {y:1426,color:'#29a329'},{y:823,color:'#29a329...