Posts

Showing posts from August, 2013

Making specific method non transactional in Spring -

i have spring application based on spring batch. default spring batch introduces transaction steps (i.e. @ reader,writer , processor) . there stages don't need transaction enabled. because transaction enabled unnecessary these methods giving me runtime errors making call 2 different databases in 1 method. is there annotation spring provides disable transaction specific set of methods ? or there available in spring batch can allow me rid of transaction either or declarative i open solution can disable transaction globally. link , paper appreciated. in advance samir spring batch inherently transactional. if datasources not transactional, semantics of jobrepository require it. closest can spring batch , not being transactional using resourcelesstransactionmanager. transaction manager no-op transaction manager keeps track of if operation within scope of transaction or not.

JQuery - making a list 3 or more img toggles go to their default image when one of them is toggled via click event -

here's jsfiddle . i can 2 divs toggle , have other div reset it's original img, can't 3 or more divs. i'm doing wrong eq methods, not sure what. html: <div class="home"> <img src="http://www.misfitpsycles.com/blog/wp-content/uploads/2011/09/red-circle.jpg"> <img style="display:none;" src="http://tribute.dbclay.com/img/badjorx/black-circle.jpg"> </div> <div class="myplayer"> <img src="http://upload.wikimedia.org/wikipedia/commons/d/d5/blue_circle_o.jpg"> <img style="display:none;" src="http://i00.i.aliimg.com/img/pb/301/829/308/308829301_525.jpg"> </div> <div class="mycareer"> <img src="http://farm3.staticflickr.com/2226/1667080567_172c7871d3.jpg"> <img style="display:none;" src="http://www.venatu.com/images/ge/purple-circle.png"> </div> jquery:

ruby on rails - Still getting "Current password can't be blank" in Registration Edit after following wiki -

i worry solution here woefully obvious, i'm having trouble implementing instructions on devise wiki ( https://github.com/plataformatec/devise/wiki/how-to%3a-allow-users-to-edit-their-account-without-providing-a-password ) i'm using rails 4. after following wiki, i'm still receiving "current password can't blank". here's setup. assistance appreciated! registrations_contoller.rb class registrationscontroller < devise::registrationscontroller def update @user = user.find(current_user.id) successfully_updated = if needs_password?(@user, params) @user.update_with_password(devise_parameter_sanitizer.for(:account_update)) # rails 3: @user.update_with_password(params[:user]) else # remove virtual current_password attribute update_without_password # doesn't know how ignore params[:user].delete(:current_password) @user.update_with_password(devise_parameter_sanitizer.for(:account_update)) # ra

javascript - What's the angular way to handle redraws? -

i'm making charting application allows create graphs using drag , drop interface. i have highcharts , i'm using highcharts-ng directive. this directive watches title, options, , series. , when person makes change, process them , make changes options object. highcharts-ng redraws chart. the problem i'm finding change few properties in row such options.xaxis , options.yaxis, , whenever application lagging bit because it's launching redraw every change. so angular way approach this, while still being efficient? a potential solution thought of add flag highcharts-ng directive, , have trigger whenever it's changed. , change after i'm done processing data. potential solution listen event inside highchart-ng directive, , trigger redraw whenever event received. these solutions seem/feel bit hacky me. angular own dirty checking , (ideally always, not really) rewrites angular-controlled sections of dom whenever corresponding view models change. th

php - symfony2. Cannot load pdo drivers -

when i'm try create db with doctrine:database:create there errors(mysql or postgresql): could not create database connection named `symfony` not find driver my parametrs.yml: parameters: database_driver: pdo_mysql database_host: 127.0.0.1 database_port: 3306 database_name: symfony database_user: root database_password: null mailer_transport: smtp mailer_host: 127.0.0.1 mailer_user: null mailer_password: null locale: en secret: 1dffcb10ddfc2bbc4f211d773f2524557 database_path: null when i'm trying map classes db php app/console doctrine:generate:entities demos/blogbundle/entity/post php app/console doctrine:schema:update --force there error: [pdoexception] not find drive lines uncomment in file php.ini extension=php_pdo_mysql.dll extension=php_pdo_pgsql.dll print_r(get_loaded_extensions()) result : array (... mbstring [35] => exif [36] => gd [37] => gettext [38] => mysql [39] => phar [40] => pdo_mysql [41] => pdo_pgsql

ios - OpenGL 2.0 Bug - Setup and shaders work, won't draw -

i've got uiview loads opengl. setup works fine (you can test 'erase' call different colors) , shaders compiled without error. the shaders basic: vertex shader takes position, fragment shader renders black. however, won't draw. i've picked apart problem hours , can't find bug. please help. #pragma mark imports #import "ochrdrawingview.h" #pragma mark - definitions #define loquacious yes typedef struct { glfloat x; glfloat y; } vertex; typedef vertex vector; typedef struct { glfloat r; glfloat g; glfloat b; glfloat a; } color; #pragma mark - inline functions static inline glfloat distancebetweenvertices (vertex one, vertex two) { return sqrtf((two.x - one.x) * (two.x - one.x) + (two.y - one.y) * (two.y - one.y)); } static inline glfloat magnitudeofvector (vector vec) { return sqrtf(vec.x * vec.x + vec.y * vec.y); } static inline glfloat dotproductofvectors(vector one, vector two) { return (one.x *t

database - Android:getting illegalstateexception in my new emulator -

in old emulator program runs without problem.so thought program fine.but when try new emulator/or other emulators runs.the problem starts when click search button.when click,program unexpectedly closed.logcat says illegalstateexception , caused by: no such column as_id.but in database _id column exists.i can search in old emulator without exception.same code same database.why happening?why runs in 1 emulator? 1 please kindly tell how solve exception. this java class program breaks ` public class employeelist extends listactivity { protected edittext searchtext; protected sqlitedatabase db; protected cursor cursor; protected listadapter adapter; public integer pid=null; public databasehelper databasehelper; public book book; private static final int delete_id = menu.first+3; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); db = (new databas

Fortran77 automatically determine how many lines of text are at the top of a data file -

an (old) instrument of mine generating ascii data files text descriptions @ top of file, before data. number of lines of descriptive text varies run run. how can fortran77 determine automatically? here example data file, below line. line of explanatory text. notice possible blank lines. more text. number of lines not same every time. 1.0, 2.0 2.0, 4.0 3.0, 6.0 4.0, 8.0 [i found answer myself. posting here others. quite annoying having wait 8 hours answer own question, understand why rule exists. stupid posers!] a crude effective solution, if text never starts number (which case): assume input file named data.dat. integer numtextlines real x open(8,"data.dat") numtextlines=-1 50 numtextlines=numtextlines+1 read(8,*,err=50) x close(8) open(8,"data.dat") every time program tries read word text line real variable x, read statement errors , program control goes line 50. if read statement successful, don't want i

android - AChartEngine TimeSeries XAxis Time grid Settings -

i'm trying use achartengine library using time series. x axis time, , y axis integer values. the problem not setup renderer.setxaxismin , max x axis time. either data points crumbed together, or time apart large cannot see datapoints. this classes i've used: //for chart 1 private static random random = new random(); private static timeseries timeseries; private static xymultipleseriesdataset dataset; private static xymultipleseriesrenderer renderer; private static xyseriesrenderer rendererseries; private static graphicalview view; initialization: if(timeseries == null) { //chart 1 dataset = new xymultipleseriesdataset(); renderer = new xymultipleseriesrenderer(); timeseries = new timeseries("channel 1"); rendererseries = new xyseriesrenderer(); } renderer: //for chart 1 renderer.setaxescolor(color.blue); renderer.setaxistitletextsize(16); renderer.setcharttitle("real time se

python - Iterate over all pairwise combinations of numpy array columns -

i have numpy array of size arr.size = (200, 600, 20). i want compute scipy.stats.kendalltau on every pairwise combination of last 2 dimensions. example: kendalltau(arr[:, 0, 0], arr[:, 1, 0]) kendalltau(arr[:, 0, 0], arr[:, 1, 1]) kendalltau(arr[:, 0, 0], arr[:, 1, 2]) ... kendalltau(arr[:, 0, 0], arr[:, 2, 0]) kendalltau(arr[:, 0, 0], arr[:, 2, 1]) kendalltau(arr[:, 0, 0], arr[:, 2, 2]) ... ... kendalltau(arr[:, 598, 20], arr[:, 599, 20]) such cover combinations of arr[:, i, xi] arr[:, j, xj] i < j , xi in [0,20) , xj in [0, 20) . (600 choose 2) * 400 individual calculations, since each takes 0.002 s on machine, shouldn't take longer day multiprocessing module. what's best way go iterating on these columns (with i<j )? figure should avoid like for in range(600): j in range(i+1, 600): xi in range(20): xj in range(20): what numpythonic way of doing this? edit: changed title since kendall tau isn't important question.

shell - read array name from STDIN and iterating through the array values -

i have number of arrays want iterate through 1 entered through stdin code looks like arr1=(a b c) arr2=(d e f) arr3=(g h i) read array_name in ${array_name[@]} echo "i $i" done now if enter arr1 input, arr1 values not printing. can please help you can write: arr1=(a b c) arr2=(d e f) arr3=(g h i) read array_name array_name="${array_name}[@]" # append '[@]' array_name in "${!array_name}" ; # use indirection expand e.g. "${arr1[@]}" echo "i $i" done

ios - Why setNeedsDisplay required when initWithNibName used -

i have custom uiviewcontroller class called mspageviewcontroller , associated nib file. have iboutlet uiimageview called pageimage. now, want use view controller in uiviewcontroller display series of custom mspageviewcontroller in uipageviewcontroller. so, use following code: // alloc , init custom view controller mspageviewcontroller *page1 = [[mspageviewcontroller alloc] initwithnibname:@"mspageviewcontroller" bundle:nil]; // must call or, image set below null // why? guess it's because view hasn't been drawn yet because hasn't been displayed, need force redraw - question. right approach? [page1.view setneedsdisplay]; // set image page1.pageimage.image = [uiimage imagenamed:@"tutorialpage1.png"]; // make array of view controllers, expects array because double-sided nsarray *viewcontroller = [nsarray page1]; // pass array contains custom view controller [self.pagecontroller setviewcontrollers:viewcontroller direction:uipagev

class - Java: when would I ever want to use static methods when I can use a singleton instead? -

this question has answer here: difference between static class , singleton pattern? 33 answers having read difference between static class , singleton pattern? , none of answers list advantages using static method on singleton, leads me wonder why ever want use static methods. as questions of nature, use right tool job. use singleton when class represents object there can 1 of. use static methods when methods appropriate class members of not rely on specific instance of class. in general, use best judgment. go clean, precise, maintainable code, keeping overall big picture in mind.

virtualbox - Vagrant 'up' fails to load with the following error -

using vagrant version 1.2.7 , virtualbox-4.2.16-86992 os x 10.8.4 did following : # mkdir my-env # cd my-env # vagrant init precise32 http://files.vagrantup.com/precise32.box # vagrant and following : failed connect vm via ssh. please verify vm booted looking @ virtualbox gui. any ideas or solutions appreciated! thank you

python - unexpected result in numpy array slicing (view vs copy) -

i'm trying reduce amount of copying in code , came across surprising behavior when dealing numpy array slicing , views, explained in: scipy wiki page on copying numpy arrays i've stumbled across following behavior, unexpected me: case 1.: import numpy np = np.ones((3,3)) b = a[:,1:2] b += 5 print print b.base as expected, outputs: array([[ 1., 6., 1.], [ 1., 6., 1.], [ 1., 6., 1.]]) true case 2: when performing slicing , addition in 1 line, things different: import numpy np = np.ones((3,3)) b = a[:,1:2] + 5 print print b.base the part that's surprising me a[:,1:2] not seem create view, used left hand side argument, so, outputs: array([[ 1., 1., 1.], [ 1., 1., 1.], [ 1., 1., 1.]]) false maybe can shed light on why these 2 cases different, think i'm missing something. solution : missed obvious fact "+" operator, other in-place operator "+=" create copy, it's in fact not related sl

Kendo UI Menu Doesn't work in IE (Touch) -

kendo ui menu doesn't work in ie on tablets running windows 8 (ie 10 & ie 11). menu drop down doesn't work. menu works in google chrome on same windows tablet. it easier if posted code example. by far common problem have things not working on ie trailing commas in arrays. example: menuitems=[12,33,44,2,7,]; runs fine in chrome ie breaks.

php - Permutations - all possible sets of numbers -

i have numbers, 0 8. in result, possible sets of numbers, each set should use numbers, each number can occur once in set. i see solution made in php print out result. or, @ least, refreshment in theory of combinatorics, have long forgotten it. formula calculate how many permutations there be? example sets: 0-1-2-3-4-5-6-7-8 0-1-2-3-4-5-6-8-7 0-1-2-3-4-5-8-6-7 0-1-2-3-4-8-5-6-7 0-1-2-3-8-4-5-6-7 0-1-2-8-3-4-5-6-7 and on... you're looking permutations formula: npk = n!/(n-k)! in case, have 9 entries , want choose of them, that's 9p9 = 9! = 362880 you can find php algorithm permutate in recipe 4.26 of o'reilly's "php cookbook". pc_permute(array(0, 1, 2, 3, 4, 5, 7, 8)); copied in o'reilly: function pc_permute($items, $perms = array( )) { if (empty($items)) { print join(' ', $perms) . "\n"; } else { ($i = count($items) - 1; $i >= 0; --$i) { $newitems = $items;

nhibernate - Add child object to parent without querying parent -

how can add child object parent collection while keeping integrity of domain model without issuing select statement fetch parent? i have following model: public class post { private readonly ilist<comment> _comments = new list<comment>(); public virtual ilist<comment> comments { { return _comments; } } public virtual void addcomment(string text) { var comment = new comment { post = this, text = text }; _comments.add(comment); } } public class comment { public virtual int id { get; set; } public virtual post post { get; set; } public virtual string text { get; set; } } here i'm doing: var post = session.load<post>(1); post.addcomment("test comment."); transaction.commit(); the issue approach when call addcomment() on post proxy nhibernate loads entire post, issuing select statement against database. protect the _comments list

python - Importing a large SQL file into a local Firebird database -

i'm trying import large sql file (15k+ statements) new local firebird database python, through fdb module. import fdb db = fdb.create_database("create database 'test.fdb'") sql_str = open('test.sql').read() in_trans = false stmt in sql_str.split(';'): if stmt.startswith('insert') , not in_trans: in_trans = true db.begin() else: in_trans = false db.commit() db.execute_immediate(stmt) i haven't found better way this... (like using sort of executescript() in sqlite3 module executes multiple statements per call). it worked first few statements, stopped , raised exception: fdb.fbcore.databaseerror: ('error while executing sql statement:\n- sqlcode: -104\n- dynamic sql error\n- sql error code = -104\n- client sql dialect 0 not support reference bigint datatype', -104, 335544569) from read in firebird documentation, i've use sql dialect 3 able use bigint datatype in ta

Rails locale fallbacks are not working in production env -

i have rails 3.2 application. has 2 locales ko & en. ko default want fallback en if it's not available. fallback works in development env not in production env. [config/application.rb] config.i18n.default_locale = :ko config.i18n.fallbacks = [:en] [config/environments/production.rb] config.i18n.fallbacks = true [config/locales/en.yml] ttt: ttt [config/locales/ko.yml] (ttt not defined) **in development console:** i18n.localt #=> :ko i18n.t("ttt") #=> "ttt" (works fine) **in production console:** i18n.locale #=> :ko i18n.t("ttt") #=> "translation missing: ko.ttt" (not working) what missing? thanks. sam if comment out config.i18n.fallbacks = true in production / staging environments works expected.

generics - "Unexpected token" using lower-bounded wildcard (Java) -

i have along lines of: interface foo<t> { //... lines [0,45]... /*line 46*/ <r, x super t&r> list<x> weave(r value); //... } but intellij reporting: error:(46, 18) java: > expected error:(46, 19) java: illegal start of type error:(46, 26) java: '(' expected error:(46, 28) java: < identifier > expected error:(46, 29) java: 'l' expected error:(46, 43) java: < identifier > expected what's problem? not allowed bind name lower bound? or allowed use r&x expression in upper bound? changing to interface foo<t> { //... lines [0,45]... /*line 46*/ <r> list<? super t&r> weave(r value); //... } yields error(46, 31) java: > expected error(46, 32) java: '(' expected error(46, 33) java: illegal start of type by reading of specification, super can used wildcard , can't captured type variable; see jls 4.5.1 . similarly, & valid in type variab

django - How to search one model only in Haystack -

i've got app 2 models, restaurant , dish. dish has foreign key restaurant. i'm trying build separate search forms using haystack, 1 people search restaurant.name , search dish.name. i'm having trouble separating out , understanding how haystack this. since created both of indexes below, when have searchform, if type in "shrimp" in search box return "grilled shrimp", , if enter in "shakeshack" results return "shakeshack". goal have restaurant search form if type in "shrimp" shouldn't getting results because there no restaurants "shrimp" in name. right form seems allowing searching both models. my indices: class restaurantindex(indexes.searchindex, indexes.indexable): text = indexes.charfield(document=true, use_template=true) def get_model(self): return restaurant class dishindex(indexes.searchindex, indexes.indexable): text = indexes.charfield(document=true, use_template=tru

android - Is Volley API suitable for getting an apps initial configuration data? -

i have implemented volley network request processing. however, when app starts goes out , gets configuration file needs. wondering if volley right choice getting initial configuration data? take time instantiate volley threads queue, cache etc, , perhaps 1 initial request wrong choice? wanted feedback on this. on 1 hand choice because of retrypolicy settings attempt several times full-fill request, on other-hand take time volley request queue setup, , volley threads running? better off issuing initial request using asynctask? use volley if find features useful or want maintain consistency way perform network requests in rest of app. the amount of time required volley setup run not important. round trip time needed fetch configuration file in 100s of ms. whereas setting volley require 10s of ms @ most.

Javascript Regex: how to simulate "match without capture" behavior of positive lookbehind? -

i have relatively simple regex problem - need match specific words in string, if entire words or prefix. word boundaries, this: \b(word1|word2|prefix1|prefix2) however, can't use word boundary condition because words may start odd characters, e.g. .999 my solution whitespace or starting token these odd cases. (\b|^|\s)(word1|word2|prefix1|prefix2) now words .999 still matched correctly, captures whitespace preceding matched words/prefixes. purposes, can't have capture whitespace. positive lookbehinds seem solve this, javascript doesn't support them. there other way can same behavior solve problem? you can use non-capturing group using (?:) : /(?:\b|^|\s)(word1|word2|prefix1|prefix2)/ update: based on want replace (and @alanmoore's point \b ), want go this: var regex = /(^|\s)(word1|word2|prefix1|prefix2)/g; mystring.replace(regex,"$1<span>$2</span>"); note changed first group capturing 1 since it'll part of ma

CakePHP 2.3 and Active Directory/LDAP -

i've been looking authentication tutorial/solution using cakephp 2.3 , active directory , coming dry. not want of trying, found info cake 1.3 (took awhile figure out) , found analgorithms cakephp 2.3 idbroker plugin seems way more need seems not work. stuff found: http://abakalidis.blogspot.com/search/label/active%20directory http://www.analogrithems.com/rant/2012/01/03/cakephp-2-0-ldapauth/ not seems work. i'm relatively new cake, may messing install of idbroker above, that's hit google comes with. i'd point can debug connecting ldap source , verifying authentication. if knows of tutorial, awesome, point me it. otherwise i'm stuck trying figure out idbroker plugin doesn't seem work.

android - communication between activity and broadcast receiver -

i have broad cast receiver needs access data stored in shared preferences of mainactivity.java activity of same package. is code valid if written in onreceive() method of broadcast receiver? string s ; mainactivity g =new mainactivity(); s = g.getsharedpreferences(context.mode_private).getstring("key","no key"); no, trying instantiate activity via constructor. never - activities have special initialization steps allow them become proper activities (and result contexts). the context class (which broadcastreceiver receives instance of via onreceive() method) the class contains methods such getsharedpreferences() . use instead. public class myreceiver extends broadcastreceiver { @override public void onreceive (context context, intent intent){ string s = context.getsharedpreferences("shared_prefs_name",context.mode_private).getstring("key","def_value"); } }

Python str id hash -

i'm trying convert user access log pure binary format, require me convert string int using hash method, , mapping relationship of "id -> string value" stored somewhere further backward retrieve. since i'm using python, in order save process time, instead of introducing hashlib calculate hash, can use string_hash = id(intern(some_string)) as hash method? basic difference aware of comparing md5 / sha1? probability of conflict higher md5 / sha1? doesn't work. id not guaranteed consistent across interpreter executions; in cpython, it's memory location of object. if consistent, doesn't have enough bytes collision resistance. why not keep using strings? ascii or unicode, strings can serialized easily.

html - javascript $(window).width() property not working in in Internet Explorer -

i've following div absolute position: <div id="target" style="height: 300px; position: absolute; top: 275px;"></div> what doing calculating screen horizontal resolution using javascript , using obtained width, calculating width , left position of "target" div follows: var windowwidth = $(window).width(); var targetwidth = windowwidth * 0.7; var targetleftpos = windowwidth * (15 / 100); $('#target').css({ 'width': targetwidth }); $('#target').css({ 'left': targetleftpos }); this code working in browsers in ie code not working @ causing target div not having width , left position style , causing designing destructed. is there way detect clients browser , alternate code if detected browser ie. please tell me how should detect clients browser , alternate code should execute ie. thanks in advance. instead of $(window).width , use var windowwidth = window.innerwidth;

python - making HTTP request upon class initialization -

new programming, may stupid question. if so, apologies. i'm writing class in python on initialization makes request api rather large amount of data: class foo: def __init__(self, params): self.params = json.dumps(params) self.r = requests.get(api, data=self.params).json() after initialization, there bunch of methods — bar , baz — meant, in ideal world, perform different operations on the json fetched upon initialization. when instantiate class , call methods in succession, this: test = foo() test.bar() test.baz() my naive understanding test.bar() , test.baz() performing operations on same json fetched upon instantiation of test , not making own api calls. obviously, whole thing slower if test.bar() , test.baz() each making own requests. understanding correct? or test.bar() , test.baz() fetching own copies of json data? it entirely depends on content of bar , baz functions. could call requests.get if that's how write

.net how to make a non static class without a constructor? -

in .net there exist classes registrykey aren't static example: registrykey rk=registry.localmachine; the above class not static (as far understand) yet has no constructor example registrykey rk=new registrykey(); isn't valid (the registry key class has no constructors defined) i searched web , yet couldn't find information when write following class myclass2 { protected myclass2(int x) { } } i myclass2.myclass2 inaccessible due it's protection level what want know if there no way other making constructor private how can there different messages classes registerykey , myclass2 ? registrykey has 2 private constructors parameters. error message because there isn't default constructor registrykey() , because if define constructor parameters, implicit parameterless constructor isn't generated. being them private, don't see them. technically abstract classes can't built new . create private derived class (or intern

android - how to display popup on same screen with image on click of edittext -

Image
i have edittext,my requirement when click on edittext popup come image on same screen @ same time user can input value in edittext. new android,is possible quickaction other scenario achive this. in advanced.

laravel - composer create-project from private repo -

i have private project hosted on bit bucket. have ssh key setup. there way can use php composer create-project vendor/name path command in same way if on packagist? well there different ways accomplish 1 being use of composer repository used instead of packagist.org, better more centralized way manage private composer packages. other method use composer.json incorporates private repos within environments, per environment. first composer allows use private repositories create projects. like so... composer create-project vendor/name path --repository-url=http://repo.yourcomposerrepo.com since won't submit private package packagist. url needs packages.json file @ minimum, use satis or own packagist if want more dynamic solution packages.json. the method using composer.json applies created projects use custom repositories private packages, not creating new projects private repositories. use next method if want go down similar route. second configure pr

android - How to deal with "No Such Table Exception" -

in android activity, trying retrieve data existing database. copied db in assets , tried access showing error no such table exists while compiling table columns. tried tutorials none of them worked. should do? below code causing problem. database adapter class: public static final string database_name="wetrip"; public static final string database_table="tour"; public static final int database_version=1; public final string tag = "dbadapter"; public static final string key_id = "_id"; public static final string key_tour = "tour_name"; public static final string key_days = "days"; public static final string key_nights = "nights"; final context ctx; databasehelper dbhelper; sqlitedatabase sqlitedb; public toursopenhelper(context context) { this.ctx = context; dbhelper = new databasehelper(context); } private static class databasehelper extends sqliteopenhelper{ databasehelper(co

Perforce recovery from version files -

is there way recover perforce depot have version files? server perforce running on has crashed , not running. can recovery this? thanks in advance this extremely hard , impossible, because critical information stored in perforce server's database tables, separate version files. but why not restart perforce server? why did crash, , why not running? it sounds need in touch perforce technical support.

php - Finding nearest marker with google maps api -

this question has answer here: google maps api v3 - find nearest markers 6 answers i'm trying create application in php displays several markers on google map , allow user nearest marker when click anywhere on map. tried following code. not working. can please help? <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>google maps javascript api v3 example: loading clustered data xml</title> <script type="text/javascript" src="

image processing - Gray level co-occurrence matrix method on C# -

where can find implementation level cooccurrence matrix (glcm) method extraction of feature values color textures on c#? (with source code of course). , need calculation parameters: average or mean value, standard deviation, contrast, dissimilarity, homogeneity , energy. accord framework ( http://accord-framework.net/docs/html/n_accord_imaging.htm ) provides methods calculating glcm matrix , haralick descriptors. lacks dissimilarity parameter.

c# - Hooking events by RealProxy -

i'm trying hook event (action in case) cant return proxy without exception. here's idea: have interface of events, not subscribed on client side. when try raise event on client side, catch event in proxy , send remote server name of event , parameters , wanna return proxy. here sample public interface imyevents { action onping { get; set; } } public class proxy : realproxy { type type; public proxy(type type) : base(type) { this.type = type; } public override imessage invoke(imessage msg) { var call = (imethodcallmessage)msg; string methodname = (string)msg.properties["__methodname"]; object[] parameters = (object[])msg.properties["__args"]; // send command server // senddata(methodname, parameters); // tell invoker everything's fine return new returnmessage(null, null, 0, call.logicalcallcontext, call); } } public class test { public t

MySQL: DROP a column with a question mark sign? -

i trying drop column has question mark sign: alter table player drop is_playing?; result: error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax use near '?' @ line 2 do know other ways drop it? thanks use backticks escape column or tables names special names or names of reserved keywords in mysql. and use column keyword: alter table player drop column `is_playing?`;

IIS Express SSL Request Redirection Issue -

i have port conflict issue. need iisexpress able cater these web request: http:// localhost:44567/ and https:// localhost:44567/ i know these conflicting ports since ssl connection should have own port. aware can solve client side changing requesting link different port. but looking is, if there way server side(iisexpress) resolve problem. example: if iisexpress receives http:// localhost:44567/ serve is. , if receives request for(ssl) https:// localhost:44567/ redirect different port, let https:// localhost:44569/. or maybe changing https:// http://? is there way in iisexpress? or there approach problem? note: need solution server side , not client side. thank you. note: intentionally put space in domain name because not allowed put links in question.

css - How to get Active Menu Item Highlighted in Joomla -

i have created css highlighting color of active menu in joomla, though color change working fine on hover, color not change in of active menu any getaways !! note - have 1 more site in joomla 1.5 older version - there code works fine active menu color changes. however issue coming in joomla 2.5 css .bluetabs li a:visited{ color: #ffffff; } .bluetabs li a:hover{ text-decoration: underline; color: #ffffff; background:#b60205; text-decoration:none; } .bluetabs li.selected{ background:#b60205; padding:0; } .bluetabs li.selected a{ /*selected main tab style */ background:#b60205; border-bottom-color: white; } .bluetabs li.selected a:hover{ /*selected main tab style */ text-decoration: none; } this function wherein correctly defining selected menu too foreach($rows $row){ if(($lt+1) < $cnt ){ $maincls = ""; }else{ $maincls = "last ";

mysql - SQL fetch the first of assigned list -

is possible fetch database row based on index of list given? i have table lets call 'storage'. storage can have sorts of string value in it. list below present possible list of value in storage. don't know if present in table. want select first value found depending on order of list given list: foo bar foobar barfoo oof 1.foo , 2.bar don't exist 3.foobar is. 3.foobar 1 want fetch. hopefully clear enough in question. thanks in advance. select col your_table col in('foo','bar','foobar') order field(col, 'foo','bar','foobar') limit 1 the field() function returns index of value in list.

MS Access VBA: how do I clear Image control? -

i have image control reads file disk user navigates. if there no file (an empty field), need erase previous image. microsoft page says follows: sub form_click () picture1.picture = loadpicture() end sub but when it, access complains "the argument not optional"! tried loadpicture("") stated here , here , no avail. says "microsoft access can't open file '0'." how can clear picture in runtime? i'm using access 2002. in advance! use following: picture1.picture = ""

xcode - exclude iPad mini device Titanium iOS -

i have created ios app in titanium. tried running app on simulators(6.1 , 5.1) , works fine. however, when run on ipad mini device gets messed up. since, have submit ap in next 2-3 days; ahve thought of excluding ipad mini app itself. my app should not run on ipad mini. there way using xcode or titanium. try run app on ipad mini , make code ipad mini id ti.api.info( ti.platform.model ) it should return's model of ipad... can make if know if current device ipad mini or not... if display screen saying app isn't supported ipad mini yet.

android - Define horizontally strechable drawable -

Image
i define background drawable roughtly illustrated here: the green regions should scaled if imageview, meaning aspect ratio remains constant. blue region should streched if element wider background image. i tried accomplish 9patch images, have defined @ least 1 horizontal strechable region. there doesn't seem way keep aspect ratio of green regions.

cocos2d-x c++ string unicode convert -

i request web page using cchttprequest when print received response ccstring can see turkish characters without problems when assign received response using std::string , print in cclog strange characters come up. how can fix this? std::vector<char> *buffer = response->getresponsedata(); char jenny [buffer->size()]; (unsigned int = 0; < buffer->size(); i++) { jenny[i] = (*buffer)[i]; } ccstring* ustr = ccstring::createwithcontentsoffile(jenny); string wstr(jenny); cclog("%ls", &wstr); ccstring response : data file(< ?xml version="1.0" encoding="utf-8"?> < string xmlns="http://tempuri.org/" > gönderildi < / string > string cclog response : ����k�4p� do want print values in cclog or want display them in cclabel? if want display them in cclabel can in following way: store values in std::string when assigning label use c_str() method retrieve value. example: std::st