Sunday, 15 August 2010

Can I Load Google Tag Manager Twice on a Page? -



Can I Load Google Tag Manager Twice on a Page? -

can load 2 separate google tag manager snippets on web page, 2 separate accounts, or generate error in 1 of accounts?

given have different gtm-xxxx ids, should work fine.

google-analytics google-tag-manager

ios7 - How to pop to root view controller -



ios7 - How to pop to root view controller -

i have question pop root view controller.

for example: force b, b nowadays c, c nowadays d. root view controller. want d a. how pop view controller? can help me? have found many questions relate still have not found reply this.

if you're using uinavigationcontroller, can utilize poptorootviewcontrolleranimated:. assuming uinavigationcontroller declared mynavigationcontroller:

[mynavigationcontroller poptorootviewcontrolleranimated:yes];

ios7 ios6

java - ListView in Xamarin Android application -



java - ListView in Xamarin Android application -

i'm trying create listview in xamarin android, , run foreach loop on collection populate listview. however, i'm having problems getting listview working properly.

i have:

listview uuidlistview = findviewbyid<listview> (resource.id.uuidlist); uuidlistview.adapter = new arrayadapter (this, resource.layout.uuidlist, "some text");

the response when run programme is:

the best overloaded method match 'android.widget.arrayadapter.arrayadapter(android.content.context, int, int)' has invalid arguments.

why looking 2 integer arguments?

please explain in basic terminology possible i'm new. thanks.

once sorted out, need run foreach loop on collection this:

foreach (string uuid in uuids) { if (uuid != "")

and populate listview uuid values not equal "". help on great too.

android documentation

the first integer layout file, sec file text view within layout.

change:

uuidlistview.adapter = new arrayadapter ( this, resource.layout.uuidlist, "some text");

to

uuidlistview.adapter = new arrayadapter ( this, resource.layout.uuidlist, resource.id.textview1);

where textview1 id of text field on layout.

java android listview xamarin monodroid

Rails: How can I access a model's "errors" from a separate controller? -



Rails: How can I access a model's "errors" from a separate controller? -

i have resource called "rating" (which has standard actions: create, update, destroy). have form resource rendered in controller (called moviescontroller).

how can access ratingscontroller's @rating within moviescontroller?

the ratingscontroller:

class ratingscontroller < applicationcontroller before_action :set_rating, only: [:update, :destroy] before_action :authenticate_user! def create @rating = rating.new(rating_params) @rating.rater = current_user respond_to |format| if @rating.save format.html redirect_to movie_path(id: @rating.rottentomatoes_id), notice: 'rating created.' end else format.html { redirect_to movie_path(id: @rating.rottentomatoes_id) } end end end def update respond_to |format| if @rating.update(rating_params) format.html redirect_to movie_path(id: @rating.rottentomatoes_id), notice: 'rating updated.' end else format.html { redirect_to movie_path(id: @rating.rottentomatoes_id) } end end end def destroy @rating.destroy respond_to |format| format.html redirect_to movie_path, notice: 'rating destroyed.' end end end private def set_rating @rating = rating.find(params[:id]) end def rating_params params.require(:rating).permit(:rottentomatoes_id, :rating) end end

and moviescontroller:

require 'httparty' class moviescontroller < applicationcontroller before_action :authenticate_user! def show movie_url = 'http://api.rottentomatoes.com/api/public/v1.0/movies/' api_key = '' url = movie_url + params[:id].to_s + ".json?apikey=#{api_key}" movie_response = httparty.get(url) @movie = json.parse(movie_response.body, symbolize_names: true) @rating ||= ( rating.find_by(rottentomatoes_id: params[:id], rater: current_user) || rating.new(rottentomatoes_id: params[:id], rater: current_user) ) end def search search_url = 'http://api.rottentomatoes.com/api/public/v1.0/movies.json' api_key = '' if request.get[:title] title = uri.encode(request.get[:title]) url = search_url + "?apikey=#{api_key}&q=#{title}&page_limit=10&page=1" rottentomatoes_response = httparty.get(url) response_dict = json.parse(rottentomatoes_response.body, symbolize_names: true) @movies = response_dict[:movies] else @movies = [] end end end

and moviecontroller's show form:

<%= simple_form_for @rating |f| %> <% if @rating.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@rating.errors.count, "error") %> prohibited rating beingness saved:</h2> <ul> <% @rating.errors.full_messages.each |message| %> <li><%= message %></li> <% end %> </ul> </div> <% end %> <%= f.input :rottentomatoes_id, as: :hidden %> <%= f.input :rater_id, as: :hidden %> <%= f.collection_radio_buttons :rating, [ [0, '0'], [1, '1'], [2, '2'], [3, '3'], [4, '4'], [5, '5'], [6, '6'], [7, '7'], [8, '8'], [9, '9'], [10, '10'] ], :first, :last %> <%= f.button :submit %> <% end %>

pass errors moviecontroller:

format.html { redirect_to movie_path(id: @rating.rottentomatoes_id, errors: @rating.errors) }

and in moviecontroller show method:

if(params[:errors]) @errors = params[:errors] end

then replace @rating.errors @errors in film show view.

ruby-on-rails ruby-on-rails-4

html - responsive datatable doesn't fit on table expand -



html - responsive datatable doesn't fit on table expand -

i trying create datatable responsive. using html5 , have added in css:

#datatable { border-collapse: collapse; border-spacing: 0; border: 1px solid #bbb } #datatable td,th { border-top: 1px solid #ddd; } @media screen , (max-width: 900px) { table { overflow-x: auto; display: block; } }

the problem when columns expanded rows going out of corners of table , not responsive. instead when minimizing browser , table smaller responsive. when expand table. wrong?

add next class in css

#datatable_wrapper { overflow:auto; }

html css datatables response

llvm - Is Clang lli API available? -



llvm - Is Clang lli API available? -

is there api clang's lli tool available? i'd utilize can't invoke executable in environment.

clang llvm

android - Where to best use setRequestedOrientation inside a Fragment? -



android - Where to best use setRequestedOrientation inside a Fragment? -

i want utilize setrequestedorientation( activityinfo.screen_orientation_portrait); within class extends fragmnet, should best used? within oncreateview(), onactivitycreated or oncreate()? , how? because when tried utilize it, eclipse underline reddish squiggle.

i think should precede

setrequestedorientation( activityinfo.screen_orientation_portrait); getactivity() can instance of current activity fragment associated with.

and, think utilize within oncreateview()

android fragment

python - Split byte array -



python - Split byte array -

i working on little personal project allows user drag list item qlistwidget in pyqt4 onto label opens message dialogue. see selected comes produces both title , link in both instances. how can access individual elements? aiming accomplish first element (title) in dialog header 2nd parameter of about() method , show sec part of bytearray (link) in main dialog box.

def dropevent(self, event): info = event.mimedata() bstream = data.retrievedata("application/x-feed", qtcore.qvariant.bytearray) selected = pickle.loads(bstream.tobytearray()) event.accept() qtgui.qmessagebox.about(self, str(selected), """ %s """ % str(selected) )

edit

class base(object): def __init__(self, name, link): self.name = name self.link = link def __repr__(self): homecoming "%s\n%s" % (self.name, self.link)

error: typeerror 'base' not back upwards indexing

background reading far: http://srinikom.github.io/pyside-docs/pyside/qtcore/qmimedata.html https://docs.python.org/3.1/library/functions.html

any help appreciated!

if pickle.loads returns tuple, may utilize syntax:

(title,link) = pickle.loads(bstream.tobytearray())

or

selected = pickle.loads(bstream.tobytearray()) title = selected[0] link = selected[1]

edit

i thought pickle.loads returned tuple returns base object 2 attributes need access attributes (remember there not private attributes in python):

selected = pickle.loads(bstream.tobytearray()) title = selected.name link = selected.link

python python-2.7 qt4 pyqt4

c++ - DllNotFoundException From C# but not VB.NET -



c++ - DllNotFoundException From C# but not VB.NET -

i have 3rd party dll integrate application. 32 bit c++ dll not expose via com, , have not been supplied source code or header file.

it supplied working vb.net illustration code in winforms example. works, long executable run same directory api dll , application api interfacing.

i using illustration function declaration:

declare ansi function getversion lib "thirdpartyapi.dll" () integer

however, we’ll using api calls c# library used in web site or web service, converted illustration vb code to

[dllimport("thirdpartyapi.dll", setlasterror = true, charset = charset.ansi)] public static extern int getversion();

if phone call within c# library error

unhandled exception: system.dllnotfoundexception: unable load dll 'thirdpartyapi.dll': dynamic link library (dll) initialization routine failed. (exception hresult: 0x8007045a)

i took alternative route , set original working vb code illustration own vb.net dll , called via c#. got same error. strangely, phone call vb.net dll vb.net console app works.

in summary:

a simple vb.net console app work a simple vb.net winforms app work a simple vb.net console app can phone call getversion via vb.net dll a simple c# console app cannot phone call getversion via vb.net dll a simple c# console app cannot phone call getversion directly. incorrectly defining function calls. @ stage, i’m not worried this. 32 bit compilation not prepare issue i have tried on server 2008 r2 , windows 7 enterprise

i created wcf host via nt service expose functions, hoping work around file locations , dependencies. written in vb.net , placed in same folder thirdpartyapi.dll.

none of code in nt service access getversion none of code in wcf service access getversion

please note, in of above cases, executables in same directory thirdpartyapi.dll. of dependencies exist in directory.

can explain behaviour, or suggest how can made work within c# web site?

thanks

the error code 0x8007045a. com error code maps win32 error code error_dll_init_failed. described as:

a dynamic link library (dll) initialization routine failed.

what means dll found, in spite of perhaps misleading exception class dllnotfoundexception. however, dll failed load. can gain no more info system. there no mechanism dll study reasons why failed load. suggest contact vendor of dll , inquire support.

c# c++ vb.net pinvoke dllnotfoundexception

python - How could I search specific strings from a text file? -



python - How could I search specific strings from a text file? -

my file looks this:

review/summary: beautiful basic pump... review/text: ... not plenty sizes or colors. fits true size on size 8-1/2 feet.bottom soles slick... needs kind of texturing or tread help prevent slipping. review/text: it's amazing.firstly, 1 not original gil zero, gil 0 td, means not have technique.however, it's comfortable sneaker i've ever know. without expensive technique, it's mid-sole more soft , much more durable. , upper changed real leather, it's became more fit able foot. changes makes improve sneaker expensive original one, great design of real great sneaker, not useless, mutual people not superstar, technique. , on court, found plenty cushion , give more speed, first-class 1 guard or little forward.

i want extract strings such quick service , excellent service , amazon great, excellent client service

my code looks this:

def ethos(file): f = open(file) raw = f.read() tokens = nltk.sent_tokenize(raw) text = nltk.text(tokens) sents = [] matching_strings = ['thanks amazon' , 'great service' , 'reasonable shipping time' , 'quick service'] tokens in text: if tokens in matching_strings: sents.append(tokens) homecoming sents

my output blank, kindly allow me know how approach correctly, i'm new language processing

i've never used nltk, i'll create guess @ solution. since tokens sentences, need matching strings in token , not other way around have now. loop should this:

for tokens in text: match in matching_strings: if match in tokens: sents.append(tokens) break homecoming sents

python nltk

python - no module named msilib.schema error in ubuntu -



python - no module named msilib.schema error in ubuntu -

i running python file in ubuntu, shows error no module named msilib.schema question msi used microsoft, right? can utilize in ubuntu ? , how ?

this whole project , want run in ubuntu....https://www.dropbox.com/s/xwgg4i3gnv1u2cw/clovis.rar

msilib python module built windows platform, documentation shows. therefore, should not seek , import in python script run on ubuntu platform.

python ubuntu portability

strpos - Can't read correctly from a .txt file in php -



strpos - Can't read correctly from a .txt file in php -

i'm trying read text file downloaded www.groupsort.com

the format looks this:

name rank team mike 1 team 2 charlie 5 team 1 joe 3 team 1 david 21 team 3

also don't know if related, when went pico file, wouldn't show me clear text, bunch of garbage, it's .txt file. weird?

so want usernames , store them in variable. shouldn't work?

$file = "peopletomove.txt"; $fh = fopen($file,'r'); $movetsusers = array(); while (!feof($fh)) { $line = fgets($fh); echo $line."\n"; $name = strpos($line, " "); $name2 = substr($line, 0, $name); echo $name2."\n";

you have tab-separated values. separate on tab:

while(!feof($fh)) { $line = trim(fgets($fh)); if( !$line) continue; // blank line list($name,$rank,$team) = explode("\t",$line); }

php strpos

haskell - Dynamic versions of 64 bit base libraries for GHC on Windows -



haskell - Dynamic versions of 64 bit base libraries for GHC on Windows -

current binary ghc distribution (7.8.2) doesn't have dynamic base of operations libraries (base proper, ghc-prim etc). it's not possible utilize dynamic linking. (it's possible produce statically linked dll of course). an older solution outdated.

what easiest way 64-bit dynamic linking on windows 7.8.x?

unfortunately issue serious, , neither 7.8 nor 7.10 have dynamic linking on windows.

the problem more features added ghc of ghc dlls started export more 64k symbols. impossible on windows 64k inherent limit of windows dynamic linking.

so authors of ghc should rewrite exports less symbols. few solutions outlined in ghc bug tracker (one of them splitting big dll few smaller ones). far know nobody working on issue @ moment.

windows haskell dll 64bit

android - Json parsing to get lat long -



android - Json parsing to get lat long -

i have response google web service follwing

{ "html_attributions" : [], "next_page_token" : "cpqcbgeaalxtlobsfdvixsb8whg4nghrcetbydo0ycgow-ihvfs4cqi1zam331dta8y3cxpezzlf0iyjwqmp2a8w5a5ukttrr4sqq1um6fjguncpzzrct6rwapjkzojbafrpt5gqnqm6w1vxxdk9nku5lybbvlr0yjnzbweaqylyt2mfvak-_qdir8b3yk3efy34ssohnnbnaanvc5hmztz7awgphktdntefusznqq72jpg5_ey5f2g29in_qjxjlr9a3yyngfmeflta2e0t34ogohtvcinrde7dceuuak55lv8tnp33hlgkc7pruxkv4af8xvxnlsk9alvfdzecmj4br6rtq3iwjbz0z5fpnzqjfa6nnfiqehditzbjibr9ceoaefilqjqsghsybib6srfa8b-p86rfbinehjeo3w", "results" : [ { "geometry" : { "location" : { "lat" : 47.610399, "lng" : -122.335791 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "8f7e7d038dbd13f283d1875ecf68d04fc2255561", "name" : "gnc", "opening_hours" : { "open_now" : false }, "place_id" : "chij3zj_hlrqkfqr0axdtprgaji", "price_level" : 2, "reference" : "cnrlaaaaowrgwtpl4nlyi7qpz2ukmxeddwascl5xasmeogpbqsoevbfdxvb2cmywsqz1lr3quydo8djspfkqc0bflka37iw_itw2xrzy4568h5krend1xqvdjzyvmhpawnkkjrtl0bjh_1p1vpg-ntquq-zvkriqdvbtyrun8wsra1eftayo8rouswjcbqkvapwmyljtxfjfk9qmf2i", "scope" : "google", "types" : [ "health", "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "421 pike st, seattle" }, { "geometry" : { "location" : { "lat" : 47.61, "lng" : -122.33 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "82e45a03dca8dcb2192cc250777a11f2e06452de", "name" : "deluxe foods llc", "place_id" : "chij9dkbxbvqkfqrodljese0czo", "reference" : "coqbcwaaad1di5pifx1zh03cyqypsjl10gzc7ufmhekgzvzmibz77zudoxame2ie3wzbgccuuwg3zv735pey9mrlwxdbkbmbgl_mvs_dd6ammnyehwft54gvpabn0zvnlrflneyun-dukoehvx5gewnj1uvygb1zbcy1csuwbiqh4ouay9gpehbhwgut7ycyw9ic3hgguuxgghrhu_ajt-jsrrhxoc6o7ykvpclycg", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "po box 30102, seattle" }, { "geometry" : { "location" : { "lat" : 47.607573, "lng" : -122.333167 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "695bf0d73be3b5f55ca43fe14abce48f9853ef15", "name" : "community grocery", "opening_hours" : { "open_now" : false }, "place_id" : "chijneh4urfqkfqrv3oxahshzxg", "reference" : "coqbcwaaalpg-2ysweiceu-5h5km-syuqelzr70nmsmg9uhs38upusdf4s_5hnf6eq8orgjf7jgv9w9il4cl9to8r0bca7hxk2ghxkrwlbbcp2aspwjtcdzrqb-uus9tkxhc-kldayis9zmlqthodw_j8ssxlzhnhnypol9vjkziuiilpytnehd9a-vcirldcmvzhhnow03fghrsw5ldmdzocvehdrbz2nauhtdz3q", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "415 seneca st, seattle" }, { "geometry" : { "location" : { "lat" : 47.608163, "lng" : -122.335371 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/wine-71.png", "id" : "fde562e2d1e74e8ea18d3f758a05fe78c45d9346", "name" : "essential market", "opening_hours" : { "open_now" : false }, "place_id" : "chijvyqm8lnqkfqrjjm6wicye1a", "rating" : 3.8, "reference" : "coqbcgaaald33oay_-vxbcbf_gmywcqphjyzixfi-yc1glcffxbtptdywxt-vpfknexst7k305ohv0akha_br2eh8aeetn-d7pxuw3mk5vsypubifotrwom_cx2yh84cxoj9efwgxwtiuxeovojhz8syj59n4g78iuudi-mfmgzd_c_jq90rehdj3y45nfvr6ibfvapmnk0zghqdcjyu7zu8ymtuqlgmoesjrtvvgq", "scope" : "google", "types" : [ "liquor_store", "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1301 4th ave, seattle" }, { "geometry" : { "location" : { "lat" : 47.612122, "lng" : -122.332044 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "6b4f8dc7039510bbbfca8fd12b359d444eef2be9", "name" : "clay's market", "place_id" : "chijdxjoe7vqkfqr4odxoxnqeq8", "reference" : "cnrvaaaacc-kzx3pjo0x3ojptam_wqws5kbrk53v4xa6gyioj3pp8fo8l_dqstjkrmqrf8brgvfntktalujzlvxkigj7pnjytaaurpkv0tl7dhpru66cyajrnjorshme0xyhjjnj7vqdell5ho8dab0fzfrevxiq6tzzbeqqrp6qepf_ue7xhbou4y3vkfbscx_4b1pu1aplywxzldq", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "815 pike st, seattle" }, { "geometry" : { "location" : { "lat" : 47.609336, "lng" : -122.337791 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "691548827b64fe2609fb7c27abbb1bcbe224f327", "name" : "kress iga supermarket", "opening_hours" : { "open_now" : false }, "photos" : [ { "height" : 600, "html_attributions" : [], "photo_reference" : "cnrnaaaal-_qcxeqc8uatumrqdzg_bdcp56lf2i2cpbbmxyj71vlemlidrqpc38wmdtwshvoff_pgjlbo4vqhfpjm2nslrpmhqeotyysytwbhocxpf9isdvunjbbyguwcufybdvdcdizachoo0bei5jvzrxnhriqvsyovueat6gfrodcoh95hhous-mac5clzjft12vsx_e7m_vuifi", "width" : 398 } ], "place_id" : "chijbdiholnqkfqrmtihcn6w4nu", "rating" : 4.4, "reference" : "coqbdwaaan3wdcagdfatcilhebd3vwnp0z_zqjq8ninljnqpzhyj2ieg6vegxvfmqcu8bfawcrxo7mtu08gxtelthcypdrqy5kffagdj1dfqi8puh5r7wkkchjgn-spj2cqrsir-k853wjmlnmahzsjmc2xwahlbmy2abxoe_9lspoqfye72ehcobhik_e0gtgpetycfrp6mghslbgpkklzl00qldn6xd44y1tdj7a", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1427 3rd ave, seattle" }, { "geometry" : { "location" : { "lat" : 47.606546, "lng" : -122.335449 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "3f23cf0c8bfdbe746a69d518c031dcafbd266d64", "name" : "netzel associates", "place_id" : "chij1q6vb7fqkfqr0pcosjtlqpm", "reference" : "coqbdaaaabimsr5ilbmkvjterpvavhij7jmxhtacajvz9ytfxvqycp8he5wd4pafaou5dbli4oagjappq8quif9_hyn_ihtkpynhafwqcohshe-6kkio1siie5qdlg-buz2tqkvipmzpqk67x60dgrux31vzjf10dg6bviziimtk5q8d4azwehcjkbwcknurotkkyatmh0jwghs2i7o8ionef9a5_qtbl3n1k8v4fg", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1111 3rd ave # 2500, seattle" }, { "geometry" : { "location" : { "lat" : 47.612607, "lng" : -122.336984 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png", "id" : "1672b9dd46c6dcb5ae1409d0f87b23f1c38f33d0", "name" : "market fresh winter garden", "place_id" : "chijrdhdmksvkfqr0ugnkk-w7fk", "reference" : "coqbfaaaaaxvlhmqlrtabi8g1bbkemysu_pdqmypmkmwnie37krzknukxrqkbpivos7ccb4yxijgz2x79qqw1dtfpj9ee4jclrskmfqzdqzpet1vhcr_imcsiwrlz_51iveuruw8r2gszbwcdislu1ib1gbult58ub8ghs-n3_ygxqae_1jaehbjn_a6kpphjqgq9_pr4aifghqneeknt7jsyb1mvxcdgz4o83anng", "scope" : "google", "types" : [ "meal_takeaway", "restaurant", "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "509 olive way, seattle" }, { "geometry" : { "location" : { "lat" : 47.613069, "lng" : -122.329411 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "08e8916d1ade44b3403b1a1268fc038bd449952b", "name" : "pike grocery", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 384, "html_attributions" : [], "photo_reference" : "cnrnaaaamx9yeunwuacoeswmlueyy2zjqt-glprsd0_wxwhv0pp7c42-fvqycfkprodpchiqlzjswa_fpcqadgvai_halfccuhcibbrtejosvlp1ba_acdwmpbdf26vyc6xajqmtr37exiz5j-svyh09_hpezriqap8c87zkuwiyfsr6zsag2rousabkv4fllfmsktthhebvdd0g9vm", "width" : 512 } ], "place_id" : "chijmwdemspqkfqruqq91n-ufeo", "reference" : "cnrvaaaapcluek8vrv5wcsbp4g08nttaphmkftasuhtar4i8vuntfksp7np06jc4y3xj7qtr9i105d7hpvkqjhuh6hdylzej-fm5ydc7lqnmmkran3ccmqezcd9mhszkdxdtdktsyazv4ggwogi4lqfcugfhdbiqd1m7sq4-ewj4y6cnujpkhbounhovxfwyl3lk7imaxjkxgkknh9k", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1011 pike st, seattle" }, { "geometry" : { "location" : { "lat" : 47.606521, "lng" : -122.337704 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "110c00b34dc635662716772ab4a0e0f6deced28a", "name" : "young's market", "place_id" : "chij44qiilfqkfqrw1tsxz9h2kg", "reference" : "cnrwaaaaxmdsj6fxuip8s9c42j9nsu7xtmyny612ts6njqubsozlbjwpr6gmxsrrkrepttltbsywomq4gp2ovwo2utvqtlpjhcws2ycfhnkj4k8sz7f_d3aoazownkmip88bpxmbpujj9eki5gvtxct9cfre4biqoltwxcaybhklutmnfvgnfhoulo1jmn7wrjubvbcnzye5qubtl_w", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1210 1st ave, seattle" }, { "geometry" : { "location" : { "lat" : 47.608777, "lng" : -122.33973 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "d2f9218e208a84da7c7a7e2980cebd3671a8f386", "name" : "double dorjee", "place_id" : "chijkx3s-ljqkfqrqrexqcn0jqy", "reference" : "cnrvaaaaordvxz8w_qmewpmjxxulaz9ls562rrqgirkeihgxesloxngcjsw2iqiymeukrmvqwraoulyroia8t1ypqdyyaveajqixcz0pwzmeueaduckl37p_wgzkojuhhv0ki_3z10bopwmcnvo5xiofz7j1abiqk9udmy_ktiytp8tnog5t_roulyeozrnbyy8eulqd7lugs_e7kru", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1501 pike st, seattle" }, { "geometry" : { "location" : { "lat" : 47.608248, "lng" : -122.339523 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "efeff82fc657a72cf8a3079aabe0e27d0d91a6c5", "name" : "lina's fruit & produce", "place_id" : "chijd22j-ljqkfqrxheagumcphs", "reference" : "coqbeaaaafcdpyes7w9sdbbhp_boynqrm1cuqichslnr-hyxateywmptknieds27q0hr5blfqazqvgp_yim2eldrfsjtsdtvgijlwzuvhtsbridv4n8cthl6uihzjnmtevrbyrq7geid2bp_izilj4k6nyipsykljnpbbvckasbesn4tatm-ehcyse2fgypwegx4zhaku6t7ghs2-n0cgphzmvmagnmkyp2gcw23-g", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1431 1st ave # 7, seattle" }, { "geometry" : { "location" : { "lat" : 47.605109, "lng" : -122.333955 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "d81b188da1c901ec10149c5224e6fd1beac9ef9c", "name" : "second avenue sundries", "place_id" : "chijexg9_rbqkfqri7zb8km4p98", "reference" : "coqbeqaaaoh07x4jtyj3wta6swnshxcpgitpl7kbsjbqfref2vuj-vxjenchmiogcvsireyesv_dzyyxg3rompezucukuivlsaet1wxjck6t0tm8qhyltdcc9ijrmje_npy9rtbiehbixa5esv1egmf_rhyhqjyhpjaz7hmdcdlysebruyssehaq3ulvuena0ac8l59q8zefghsurfu9dmukkl24sq6rmqva74mb5w", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "999 3rd ave, seattle" }, { "geometry" : { "location" : { "lat" : 47.614062, "lng" : -122.335451 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "69ff94699431b37223bdea4fd7792c7244a6b36c", "name" : "sphere foods", "place_id" : "chij1ef53eovkfqrlyzowpy7dha", "reference" : "cnruaaaa6qjcwzs9h_eb5x5uoan2j99lisj9nevr-ltbjuolkx5ojmlmggyeazqmbf02rp8trqyevee41rhimdgdvnqkj5wblrxqcvm195y3blssymy7kutfvaiclgzjvdepf5wlcc9xl6jjfiwxqn-5i1oeihiqztgmyrh317g1c7rrqwd9mxoumsfftx5fwgeczfdh7hrfx4f5mja", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1700 7th ave # 2100, seattle" }, { "geometry" : { "location" : { "lat" : 47.614425, "lng" : -122.334307 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/shopping-71.png", "id" : "e5be7cde6eb52cb0a5a7aa975ea915e2f80bd7dc", "name" : "stewart street market", "opening_hours" : { "open_now" : true }, "photos" : [ { "height" : 1152, "html_attributions" : [], "photo_reference" : "cnrnaaaaqezqn6galgijib2wanacw7gdnljucc6avrmcf543gbpl9tglj99cs0dmrdbhywvmcw_h7q_lzgoqqklwkilb95sjxsjqu4o3kmvqqaqtqwhw27u2vkvktoqxawtdppdmanopmulfp2lln1zya33z2xiqy-si5ntvqw9cptd2ahp9nxourwp9wssgmzy2dtc1q6oeznsuvqw", "width" : 2048 } ], "place_id" : "chij7ybfx0ovkfqrcljvxnf_3qg", "reference" : "coqbeaaaadtkepb503o9qn93lxgtilh8x-uyigris0pj_-ggxpxqoqkanigcmvygdlezcftpgzdchjxrwmns1rpuhqnthnjp4_vmg3zp42zfndao_q2_yowpim7wgz3oqsr66uiebkznnw9qrrd_gmba64odlzgrn7wzwvdp5uwccnjje0nfehbkdwgnlhztu2y4boi6zl-lghsbbds4npetalx_cwgpmtmkupp43g", "scope" : "google", "types" : [ "convenience_store", "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1812 8th ave, seattle" }, { "geometry" : { "location" : { "lat" : 47.609322, "lng" : -122.325655 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "87b467979468e6d2b5b203c7486d84e08505dd17", "name" : "plaza select foods", "photos" : [ { "height" : 720, "html_attributions" : [ "from google user" ], "photo_reference" : "cnrnaaaahzdjbafparrh7mlsub87bvza6erjkrsvynku6pga1ecblihzmqnx67hzqog-eo7wkvag7kp0bnxwvnxo9rf5u2vynxzz-5v7z7khl7tomfwi7u7n6afr9sls_fz_kcpbmh-m63nl4h6e5gdfzwwnuxiqjuhogatxdda9yt62kvkejhouvenpqc8obghyjowtpijdxsf2ah8", "width" : 960 } ], "place_id" : "chijy1bfh7zqkfqrxpkoz2nfh2y", "reference" : "coqbdaaaajz0wnou_progj7t62fbe2adox6sggh0yir1kngrqiz9scwkjbjmhuhb3vnkzzeuvfuibpojrfbtkbjpeuthcc8hhbe_hsulcyp2fui2afdvgbwb49x4fpla0icnooecfezwrskswckgcnyob1wt_mb2neebqvfdr8w6vhrsl1eyehbgagq9wxqzlhzzzrs84jeyghrm0rx5tif0g11uft5mg6v6uhr97g", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1024 madison st, seattle" }, { "geometry" : { "location" : { "lat" : 47.608802, "lng" : -122.340552 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "14a2e0601f06734e7c8be82ed00d3806e3f9ecd4", "name" : "corner produce", "place_id" : "chijn9fr9rjqkfqr89xobvdunbe", "reference" : "cnrwaaaafad6cccaww55vmsdqvh9xczzhx5loyfh2mht5ykfm9nznr7l3ekhd02_vnseunz3smlcyvt37k-tg6ezv4muwvoz2imbvrpx1oergjws6ogxx-fhabcaj2w5jgrkcshwehjwtw0dnyndx5gen-a1hriqnscen53q1pc3nahctutgarou-4qq8zofjff3lyyc1xf66fn8kq0", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1500 pike pl, seattle" }, { "geometry" : { "location" : { "lat" : 47.60884, "lng" : -122.340616 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/shopping-71.png", "id" : "2a7a890254bcb2b1ae409cbf78d4e741800f036f", "name" : "oriental mart", "photos" : [ { "height" : 460, "html_attributions" : [ "\u003ca href=\"https://plus.google.com/115115924044576716973\"\u003ematt good\u003c/a\u003e" ], "photo_reference" : "cnrtaaaayab-xnz1tm-iib1qfxzjic-t--li7mr5har62p-rlgtraiapk2lhwogwotqcfjpihcim2ayn2iu-qkqpvgsegony955zdeo6t3ooukgnvt5wzvw6w_wu3andylnh0xh-wri4tni6t70jutwps6qkrriqbdkblq6yk1rolxynfsyf0boun9chrbamj73djleiqezjxmi-9ny", "width" : 816 } ], "place_id" : "chijt7fx9rjqkfqr-r2iorwxyxq", "reference" : "cnrvaaaa8b_d2xlfyevl6oi5uygrdjilg6dw3orrlu8q9xd9eukh2omatgnlupkgahjjren5jinkdj9fsmpr4f0du2xmbw9xmmepo6cmpeg8zbbhqvnbs2zhzu2_m0wfnlv21mdxfad20gvx6f6cdz2cokb_khiqhh6kz-vny430yf0evmh7ebouz3tvjq_rhxxly_jpan1qk2yc3um", "scope" : "google", "types" : [ "convenience_store", "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1506 pike pl #509, seattle" }, { "geometry" : { "location" : { "lat" : 47.608918, "lng" : -122.340729 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "301d23a6579067833036e39ef46357e1d8e5ba68", "name" : "frank's quality produce", "place_id" : "chijpdhb8ljqkfqro8x7roxoz2u", "reference" : "coqbeqaaakebhfrm9opub4cwc5bc1hyamxofc0lzwywcx-4eyhtooievcxhisj4y1xkbixtisttpetjynr5kkux3y3q5zf7skuttqirybk0hesohet1_edcnpu31_ibrlo9w-t_7widb3fnn24rymz9j9kz7pxhlykyr2vlmutlmalnljc2yehchddy463zp0hrizaasfsg3ghte1n0deejjdnxnb2ak4zof1hgkmw", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1508 pike pl, seattle" }, { "geometry" : { "location" : { "lat" : 47.609231, "lng" : -122.340848 } }, "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png", "id" : "228c792a04f0d9c3b8086b9f857521945f87c975", "name" : "choice produce", "place_id" : "chijmbby97jqkfqr4jkukxvdt3a", "reference" : "cnrwaaaawe1ak6eoe-rdrjgs2hjzhb__vicdwu2u7qx0chme1cgdnnoycw_dcim98szb2bzujty12wgk9fgo42jpywl-zevm_ilfqi6q7jvrqxsgvsybbzau_tc_orgj41gz8fwk1r6_yvat1n0ii9dpfca1lxiqvirixzwl3grqyk3dun_4zrourndpghpgzhkunggpibllh46zoqi", "scope" : "google", "types" : [ "grocery_or_supermarket", "food", "store", "establishment" ], "vicinity" : "1514 pike pl, seattle" } ], "status" : "ok" }

i need parse , lat , long values

i have assigned this

jsonarray ja=new jsonarray(result); jsonobject json= null;

where result contains web service response. how can parse , required values?

cast response jsonobject this

jsonobject jsonobj = new jsonobject(result);// result response got

get result array this

jsonarray results = jsonobj.getjsonarray("results"); // results tag in resposne

now have entire array in results loop entire stuff

for(int i=0;i<results.length();i++) { jsonobject location = results.getjsonobject(i).getjsonobject("geometry").getjsonobject("location");; string lat = location.optstring("lat"); string lng = location.optstring("lng"); }

if need lat , long within array, add together array.

android json

python - how to remove constant variable in pandas? -



python - how to remove constant variable in pandas? -

i have csv file 10000 one thousand of variables. remove variables constant or standard deviation close zero.

then translate remaining variables in numpy ndarray.

how can that?

python pandas

jquery - Button onClick event is not executing when button in tag is clicked -



jquery - Button onClick event is not executing when button in <div> tag is clicked -

i have created button in div. div defined as:

<div id="popupdiv"title="basic modal dialog" style="display: none" >

in div have asp button. when click button doesn't phone call onclick event in code behind. if remove style="display: none" works. code is:

<%@ page title="" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="department.aspx.cs" inherits="projectmfrp.department" %> <asp:content id="content1" contentplaceholderid="headcontent" runat="server"> <!--for jquery--> <title>ad department</title> <link type="text/css" rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"/> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js> </script> <script type="text/javascript"> $(function () { $('#btnclick').click(function () { $("#popupdiv").dialog({ title: "add department", width: 430, height: 450, modal: true, buttons: { close: function () { $(this).dialog('close'); } } }); }); }) </script> <!-- *******************************************************--> </asp:content> <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <!--*************for jquery*********************--> <!-- <form id="form1">--> <div> <div id="popupdiv"title="basic modal dialog" style="display: none" > <table> <tr> <td> <asp:requiredfieldvalidator id="emailrequiredvalidator" runat="server" controltovalidate="adddeptemailtextbox" forecolor="red" errormessage="email can't blank"> </asp:requiredfieldvalidator> </td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td> <asp:label id="adddepartmentnamelabel" runat="server" text="department name"> </asp:label> </td> <td> <asp:textbox id="adddepartmenttextbox" runat="server"> </asp:textbox> </td> </tr> <tr> <td>&nbsp;</td> <td> <asp:requiredfieldvalidator id="adddepartnamerequired" runat="server" controltovalidate="adddepartmenttextbox" forecolor="red" errormessage="can't blank"> </asp:requiredfieldvalidator> </td> </tr> <tr> <td> <asp:label id="addreportingmanager" runat="server" text="reporting manager"> </asp:label> </td> <td> <asp:dropdownlist id="addreportingmanagerddl" runat="server"> </asp:dropdownlist> </td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td> <asp:label id="adddeptcontactnolabel" runat="server" text="contact number"> </asp:label> </td> <td> <asp:textbox id="adddeptcontactnotextbox" runat="server"> </asp:textbox> </td> </tr> <tr> <td>&nbsp;</td> <td> <asp:requiredfieldvalidator id="addcontactvalidator" runat="server" controltovalidate="adddeptcontactnotextbox" forecolor="red" errormessage="can't blank"> </asp:requiredfieldvalidator> </td> </tr> <tr> <td> <asp:label id="addemaillabel" runat="server" text="email"> </asp:label> </td> <td> <asp:textbox id="adddeptemailtextbox" runat="server"> </asp:textbox> </td> </tr> <tr> <td>&nbsp;</td> <td> <asp:regularexpressionvalidator id="addemailcomparevalidator" runat="server" controltovalidate="adddeptemailtextbox" forecolor="red" errormessage="must abc@def.com" validationexpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"> </asp:regularexpressionvalidator> </td> </tr> <tr> <td> <asp:label id="adddeptinfolabel" runat="server" text="department information"> </asp:label> </td> <td> <asp:textbox id="adddeptinfotextbox" runat="server" > </asp:textbox> </td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td> <asp:button id="adddepartmentbutton" runat="server" text="save" onclick="adddepartmentbutton_click" /> </td> </tr> </table> </div> <table align="right"> <tr> <td> <asp:label id="adddepartmentlabel" runat="server" text="add new department"> </asp:label> </td> <td><input type="button" id="btnclick" value="+" /></td> </tr> </table> </div> <!--</form>--> <!--*************for jquery*********************--> <asp:gridview id="viewdepartmentgridview" runat="server" width="100%" allowpaging="true" autogeneratedeletebutton="true" autogenerateeditbutton="true" onrowcancelingedit="viewdepartmentgridview_rowcancelingedit" onrowdeleting="viewdepartmentgridview_rowdeleting" onrowediting="viewdepartmentgridview_rowediting" onrowupdating="viewdepartmentgridview_rowupdating"> </asp:gridview> </asp:content>

how resolve this?

thank you.

what's orphan <div> tag on line 31?

are sure you've pasted total markup?

also, why comment <!-- <form id="form1">--> on line 30? have more 1 <form runat="server"> element?

updated:

just modify dialog initialization follows:

$('#btnclick').click(function () { var popup = $("#popupdiv").dialog({ title: "add department", width: 430, height: 450, modal: true, buttons: { close: function () { $(this).dialog('close'); } } }); popup.parent().appendto($("form:first")); });

jquery html css asp.net

javascript - How do I add each new element in table to top of table when each element is dynamically created from server using angularJS? -



javascript - How do I add each new element in table to top of table when each element is dynamically created from server using angularJS? -

in next code, creating table uses angularjs grab info server , adds each item table using 'ng-repeat'.

<table class=" table table-striped" id="eventtable"> <thead> <tr> <th>index</th> <th>time</th> <th>description</th> <th>source</th> </tr> </thead> <tbody> <tr data-ng-repeat="event in eventslist"> <tr> <td>{{event.idx}}</td> <td class="text-left" nowrap> {{event.srvtime | date :'yyyy-mm-dd hh:mm:ss'}} </td> <td class="text-left"> <a data-ui-sref="events.details({edidx: event.idx})">{{event.desc}}</a> </td> <td class="text-left" nowrap> {{event.s0.id}} </td> </tr> </tbody> </table>

i have polling set on web page javascript controller(see below) stays near 'real-time'. need each new item coming in added top of table, how do this, should in controller or can straight html file? thanks!

$scope.latesteventindex = 0; var poll; eventsfactory.getevents() .success(function (result) { angular.foreach(result.v, function (d) { $scope.eventslist.push(d); if (d.idx > $scope.latesteventindex) { $scope.latesteventindex = d.idx; } }); $rootscope.eventslist = $scope.eventslist; }) .error(function (error) { $scope.status = 'unable events: ' +error.message; console.log($scope.status); }); poll = $interval(function() { eventsfactory.getlatestevents($scope.latesteventindex) .success(function (result) { angular.foreach(result.v, function (d) { $scope.eventslist.push(d); if (d.idx > $scope.latesteventindex) { $scope.latesteventindex = d.idx; } }); $rootscope.eventslist = $scope.eventslist; }) .error(function (error) { $scope.status = 'unable events: ' + error.message; console.log($scope.status); }); }, 1000);

since array not appear sorted, can insert new items $scope.eventlists array using array.splice. here's plunker:

<!doctype html> <html ng-app="myapp"> <head> <script data-require="angular.js@*" data-semver="1.3.0-beta.5" src="https://code.angularjs.org/1.3.0-beta.5/angular.js"></script> </head> <body ng-controller="mycon"> <h1>{{test}}</h1> <div> <div ng-repeat="item in list">{{item}}</div> </div> <input ng-model="newitem" /> <button ng-click="additemattopoflist()">add</button> <script> var app = angular.module('myapp', []); app.controller('mycon', function($scope){ $scope.list = []; $scope.additemattopoflist = function(){ $scope.list.splice(0, 0, $scope.newitem); $scope.newitem = ""; } }); </script> </body> </html>

let me know if doesn't answers question sufficiently.

javascript html angularjs

c# - How to search through two list members? -



c# - How to search through two list members? -

i have next class:

public class fixfirstduplicate { public string firstparam { get; set; } public string secondparam { get; set; } }

and list:

public static list<fixfirstduplicate> firstduplicate = new list<fixfirstduplicate>();

the list total of values firstparam , secondparam each correspond each other. it's table, first firstparam associated first secondparam , on.

then have:

list<string> conlines = new list<string>();

i want through conlines, , everytime string contains both firstparam , secondparam, perform method on string.

if doing 1 list, firstparam, utilize hashset, don't know how equivalent given have firstparam , secondparam

you need check if conlines contains both firstparam or secondparam like:

var query = firstduplicate.where(r => conlines.contains(r.firstparam) && conlines.contains(r.secondparam));

edit: if want phone call method when find match , order of import can utilize simple foreach loop like:

foreach (var item in firstduplicate) { string matchingstring = conlines.firstordefault(r => (r.indexof(item.firstparam)>= 0 && r.indexof(item.secondparam) >= 0) && (r.indexof(item.firstparam) < r.indexof(item.secondparam))); if(matchingstring != null) { //callyourmethod(matchingstring); } }

c# string visual-studio-2010 list hashset

r - Reshape2 - multiple rows to single rows with name change and varying numbers of rows per group -



r - Reshape2 - multiple rows to single rows with name change and varying numbers of rows per group -

i have next info set newbie reshape2 functions:

df<-data.frame(site=c("a", "a", "a", "b", "b", "c"), polygonarea=c(0.6, 0.3, 0.1, 0.7, 0.3, 1.0), originyear=c(1900, 1910, 1905, 1950, 1975, 2000))

i want turn dfinto dataframe structure:

df2<-data.frame(site=c("a", "b", "c"), polygonarea1=c(0.6,0.7,1.0), originyear1=c(1900, 1950,2000), polygonarea2 = c(0.3, 0.3, na), originyear2 = c(1910, 1975, na), polygonarea3 = c(0.1, na, na), originyear3 = c(1905, na, na))

i've tried without success utilize reshape2 bundle illustration has 'na' cells no aggregate function. also, column headers alter names (i.e., '1', '2', '3', etc.).

how do this?

you can do

df2 <- dcast( melt(cbind(df, id=ave(rep.int(1, nrow(df)), df$site, fun=seq_along)), id.vars=c("site","id")), site~variable+id )

here utilize ave give each row unique id each site. looking @ part, gives

#cbind(df, id=ave(rep.int(1, nrow(df)), df$site, fun=seq_along)) site polygonarea originyear id 1 0.6 1900 1 2 0.3 1910 2 3 0.1 1905 3 4 b 0.7 1950 1 5 b 0.3 1975 2 6 c 1.0 2000 1

then melt variables along site/id. looks like

#head(melt(cbind(df, id=ave(rep.int(1, nrow(df)), df$site, fun=seq_along)), id.vars=c("site","id"))) site id variable value 1 1 polygonarea 0.6 2 2 polygonarea 0.3 3 3 polygonarea 0.1 4 b 1 polygonarea 0.7 5 b 2 polygonarea 0.3 6 c 1 polygonarea 1.0

then dcast them them in order want.

site polygonarea_1 polygonarea_2 polygonarea_3 originyear_1 originyear_2 originyear_3 1 0.6 0.3 0.1 1900 1910 1905 2 b 0.7 0.3 na 1950 1975 na 3 c 1.0 na na 2000 na na

this set "_" in variable names. if want remove it, can do

names(df2) <- gsub("_(?=[^_]+$)","", names(df2), perl=t)

(it's bit awkward want create sure remove lastly "_" , not others)

r plyr reshape reshape2

How to refund clients when payment card details aren't stored? -



How to refund clients when payment card details aren't stored? -

people purchase stuff on site through paypal or payment card. need refund clients don't have payment/card/bank details utilize so.

considering not storing payment details mutual , refunding people common, usual solution deal situation?

presumably have original order details stored, you'll have name, transaction reference, payment method, etc. paypal payments, can issue refund straight paypal business relationship - cross reference order details have stored in paypal.

for other card payments, payment processor use? main processors have refund functionality built apis. in experience, payment processor (who pci compliant) stores card details , provides unique token identifies card. communicate them using token, payments or refunds can processed on right card.

payment credit-card

ios - How to restrict from adding to database before saving context object? -



ios - How to restrict from adding to database before saving context object? -

insertnewobjectforentityforname method inserts object database core info in ios before saving context .how restrict adding database before saving context object??

help in resolving please.....

here code.... -(bool)addteam:(team *)team{

bool result = no; nslog(@"inside dao %@ context obj %@",team.team_name,context); //here getting newly created object before saving context... nslog(@"array of team before saving context :%@",[self getallteams]); // 3 nserror *error; if (![context save:&error]) { nslog(@"whoops, couldn't save: %@", [error localizeddescription]); result = no; } nslog(@"team saved"); result = yes; homecoming result;

}

ios

javascript - Select text with mouseup event and dbclick event with call a function -



javascript - Select text with mouseup event and dbclick event with call a function -

i jquery select text event , found this example. in illustration mouseup event work dbclick event.

i add together function code homecoming value dbclick doesn't work. jsfiddle

if (!window.james) { james = {}; }

james.selector = {}; james.selector.mouseup = function (e) { var userselection; if (window.getselection) { userselection = window.getselection(); } else if (document.selection) { // should come last; opera! userselection = document.selection.createrange(); } var selectedtext = userselection; if (userselection.text) selectedtext = userselection.text; if (selectedtext != '') { homecoming selectedtext + '------' + e.pagex + '/' + e.pagey; } } $(document).ready(function () { $(document).bind("mouseup", function (e) { alert(james.selector.mouseup(e)) window.getselection().removeallranges(); }); });

i think mean this: http://jsfiddle.net/wblqz/11/

just set settimeout() allow able dblclick well.

javascript jquery getselection

linux - Enabling the VT-x -



linux - Enabling the VT-x -

i work in ubuntu oracle virtual machine installed on top of windows. have activated vt-x feature in host bios. after created new virtual machine vt-x , ept enabled.

now run

egrep ‘(vmx|svm)’ /proc/cpuinfo

from invitee check if vmx feature enabled , reply 0, i.e. not enabled.

how can enable feature on invitee vm?

thank you.

you can't enable vt-x within virtual machine. virtual machine softwares reject run if found it's running within virtual machine or in virtual machine levels deep.

http://serverfault.com/questions/46960/is-it-possible-to-setup-a-virtual-machine-inside-another-virtual-machine http://serverfault.com/questions/28399/how-to-run-vmware-esx-or-esxi-in-a-virtual-machine http://superuser.com/questions/312433/can-you-run-one-virtual-machine-inside-another

linux virtualbox virtualization ubuntu-10.04

java - Inject stateful EJB beans in a maven project -



java - Inject stateful EJB beans in a maven project -

i don't understand 1 thing hope of explain me. have maven enterprise project developed glassfish.

i utilize insert code netbeans function (right click) phone call bean in servlet , in particular annotation

@ejb

i don't understand why when phone call stateful session bean through insert code function in netbeans bean called through jndi. here mean

private bookingbeaninterface lookupbookingbeanlocal() { seek { context c = new initialcontext(); homecoming (bookingbeaninterface) c.lookup("java:global/it.volaconnoi_volaconnoi-webapp-ear_ear_1.0-snapshot/it.volaconnoi_volaconnoi-webapp-ejb_ejb_1.0-snapshot/bookingbean!it.volaconnoi.logic.bookingbeaninterface"); } grab (namingexception ne) { logger.getlogger(getclass().getname()).log(level.severe, "exception caught", ne); throw new runtimeexception(ne); } }`

the above function hasn't been wrote me

i can't inject stateful session bean through ejb?

here solution problem:

as know single servlet instance used handle multiple requests multiple clients stateful ejb should not injected straight in servlet , kept instance property, or face obvious thread-safety related issues. in our case fetching jndi within doget method , storing in http session each user have it's own sateful ejb instance.

java maven java-ee

java - how to use char in a array? -



java - how to use char in a array? -

please i'd know how create jtxtscore[6] show letter grade, calculates grade average want show letter grade too.``

public class scoregui extends jframe implements actionlistener{ final int size=6; jbutton jbtncalculate = new jbutton ("calculate"); jtextfield [] jtxtscore = new jtextfield[size]; jtextfield [] jtxtweight = new jtextfield[size]; jlabel [] jlblmodulename = new jlabel[size]; jpanel scorepanel = new jpanel(); jpanel buttonpanel = new jpanel(); double []scores = new double[size]; double []weights = new double[size]; public scoregui(){ jlblmodulename [0]= new jlabel("assignments"); jlblmodulename [1] = new jlabel("mid term"); jlblmodulename [2]= new jlabel("final exam"); jlblmodulename [3]= new jlabel("final project"); jlblmodulename [4]= new jlabel("grade average"); jlblmodulename [5]= new jlabel("letter grade"); scorepanel.setbackground(color.gray); scorepanel.setlayout(new gridlayout(7,3,5,9)); for(int i=0; i<size;i++){ scorepanel.add(jlblmodulename[i]); jtxtscore[i] = new jtextfield(8); scorepanel.add(jtxtscore[i]); jtxtweight[i] = new jtextfield(8); scorepanel.add(jtxtweight[i]); //add(jtxtweight[i]); } buttonpanel.setbackground(color.cyan); jbtncalculate.addactionlistener(this); buttonpanel.add(jbtncalculate); add(scorepanel, borderlayout.center); add(buttonpanel, borderlayout.south); setvisible(true); setsize(500,500); setdefaultcloseoperation(jframe.exit_on_close); setlocationrelativeto(null); } public double calculatescore(double[]score, double[]weight){ double grade=0.0; grade = (score[0]*weight[0]+score[1]*weight[1]+score[2]*weight[2]+score[3]*weight[3]); homecoming grade; } public char calculateletter(char grade){ char letter='n'; if(grade>=90) letter = 'a'; else if(grade>=80) letter = 'b'; else if(grade>=70) letter = 'c'; else if(grade>=60) letter = 'd'; else if(grade<50) letter = 'f'; homecoming letter; } public void actionperformed(actionevent e){ for(int i=0;i<4;i++){ scores[i] = double.parsedouble(jtxtscore[i].gettext()); weights[i] = double.parsedouble(jtxtweight[i].gettext()); } jtxtscore[4].settext(calculatescore(scores,weights)+""); jtxtscore[5].settext(calculateletter) // have here? } }

`

these lines here:

jtxtscore[4].settext(calculatescore(scores,weights)+""); jtxtscore[5].settext(calculateletter) // have here?

you should calculate scores , first set value returned double variable.

i.e.,

double score = calculatescore(scores,weights); jtxtscore[4].settext(score + "");

you should utilize score value in calculateletter method desired char. note might want alter calculateletter take double parameter , not char char parameter makes no sense.

[edited] side note, while applaud utilize of arrays since simplifying code greatly, don't think should utilize them final 2 jtextfields, since these jtextfields don't hold same type of info others. in code, think you'd much improve off naming these jtextfields, scorefield , lettergradefield, or similar. doing create code self-commenting , create much easier others , future self understand code.

also, i'd utilize loop here:

grade = (score[0]*weight[0]+score[1]*weight[1]+score[2]*weight[2]+score[3]*weight[3]);

rather hard-code everything. allow utilize different number of scores later if desired.

java swing

Android Parcelable error when exiting from Activity with Spinner -



Android Parcelable error when exiting from Activity with Spinner -

i hope reading can shed lite here :)

i having problem when close app activity, error:

java.lang.runtimeexception: parcel: unable marshal value

background: saving spinner adapters info in list< spinneritem> in onsaveinstancestate() method , restoring in onrestoreinstancestate() works no problems.

however, when come exit app fires off onsaveinstancestate() , parcelable error. have tried commenting out code saves list in bundle , stops error appearing.

clear it's list cannot understand why or find way around it.

heres code

onsaveinstancestate() -

super.onsaveinstancestate( savedinstancestate ); if ( loginresponse != null ) { savedinstancestate.putserializable( save_login_response, loginresponse ); } //company states list<spinneritem> companyspinnerlist = getspinneradapteraslist( spinner_setupcompany.getadapter() ); if ( companyspinnerlist != null ) { savedinstancestate.putserializable( save_company_list, (java.io.serializable) companyspinnerlist ); } savedinstancestate.putint( save_company_selection, spinner_setupcompany.getselecteditemposition() ); savedinstancestate.putboolean( save_company_enabled, spinner_setupcompany.isenabled() ); //depot states list<spinneritem> depotspinnerlist = getspinneradapteraslist( spinner_setupdepot.getadapter() ); if ( depotspinnerlist != null && depotspinnerlist.size() > 1 ) { //great 1 because first value empty savedinstancestate.putserializable( save_depot_list, (java.io.serializable) depotspinnerlist ); } savedinstancestate.putint( save_depot_selection, spinner_setupdepot.getselecteditemposition() ); savedinstancestate.putboolean( save_depot_enabled, spinner_setupdepot.isenabled() ); // save view states savedinstancestate.putboolean( save_view_enabled_server, edittext_servername.isenabled() ); savedinstancestate.putboolean( save_view_enabled_username, edittext_setupusername.isenabled() ); savedinstancestate.putboolean( save_view_enabled_password, edittext_setuppassword.isenabled() ); savedinstancestate.putboolean( save_button_enabled_login, button_login.isenabled() );

getspinneradapteraslist() -

final list<spinneritem> list = new arraylist<spinneritem>(); ( int = 0; < adapter.getcount(); i++ ) { list.add( (spinneritem) adapter.getitem( ) ); } homecoming list;

thanks much, have great day!

:)

first advise utilize parcelable instead of serializable (it faster):

savedinstancestate.putparcelable(save_depot_list,<your list>);

second, list not parcelable create calss implment parcelable

see link

android spinner android-spinner android-adapter

android - Unable to create AVD manager - Configuration area not writable -



android - Unable to create AVD manager - Configuration area not writable -

i can't create avd manager. i've tried via 'create new android device manager' menu option, when nail ok nil happens. if run monitor file in tools folder error saying configuration area @ /users/user_name/.eclipse/ not writable.

that makes sense, because running osx 10.9.3 mavericks , directories @ top levels of file scheme not writable. logging in root didn't help. know how take writable location config area? i've tried researching issue couldn't find meaningful information.

sudo chmod -r +w <directory> or sudo chmod -r 660 <directory>

from terminal create writable

android avd

Optimize DOM selection in jQuery -



Optimize DOM selection in jQuery -

here commplete demo

i new javascript/jquery plugin.

how create jquery plugin next script , dom selection can more optimize.

var alternative = {"n":"none","f":"friends","ff":"friends of friends","e":"everybody"} $("#uisettingspanel").find(".head").click(function(){ $("#uisettingspanel").find(".csli").slideup(); $(this).parent().find('.csli').slidedown("slow"); }); $("#uisettingspanel .sli .privacy .row .caption").click(function(){ $("#uisettingspanel .sli .privacy .row .caption") .parent().find(".body").slideup("slow"); $(this).parent().find(".body").toggle("slow"); }); $("#uisettingspanel .sli .privacy .row .body select").change(function(){ $(this).parent().parent().parent().find(".caption .right div") .html("<span class='wait'>please wait...</span>"); var val = $(this).val(); var = $(this); settimeout(function() { it.parent().parent().parent() .find(".caption .right div").html(option[val]); },4000); });

first thing can cache selectors , utilize find() cut down selection range.

like so:

var uisettingspanel = $("#uisettingspanel"); var row = uisettingspanel.find('.sli .privacy .row'); var caption = row.find('.body .caption');

you should think of cleaver way cut down number , range of dom selections.

also avoid dom selections in event handlers each time (get elements once, cache them).

looking @ code think you'll able cut down .parent() calls.

jquery jquery-plugins jquery-selectors

java - JavaFX packages not found -



java - JavaFX packages not found -

i trying create project combined swing , javafx components javafx packages not found ide (tried netbeans , eclipse).

import javafx.embed.swing.jfxpanel;

says package javafx.embed.swing.jfxpanel not exist, same other fx packages.

this happens when create project using new project > java application, if seek create javafx sample, works...

i have no thought missing here. here background info , steps have tried:

i using win7 , jdk7 (in java fx should included) my project in netbeans (version 8) has jdk 1.7 selected deafult library i updated path: java_home: c:\program files\java\jre7 and scheme path: %systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;%systemroot%\system32\windowspowershell\v1.0\;c:\program files\intel\dmix;c:\program files\java\jdk1.7.0_17\jre\bin;c:\dev\ant\bin;c:\program files\tortoisesvn\bin;c:\program files\java\jdk1.7.0_17\jre\lib\jfxrt.jar

what else should create javafx work? troubleshooting... info setting javafx far seem outdated.

you must include in project in ide jfxrt.jar otherwise not included default behavior prior java 8.

then depending on scheme , way build jar project, , must there running jar. create project export required libraries.

java javafx

excel - Search a string for certain amount of spaces -



excel - Search a string for certain amount of spaces -

i looking formula allows me search number of " " starting end of text (right) in text string in cell a, , looks on right of text string , search bit of text exact match against text range in column text column b.

if exact match found should pick in corresponding column c , homecoming value. if more 1 match found in column b error should given.

i have next bit of code looks @ 3rd space doesn't homecoming of text on right hand side

=right(b8,search(" ",b8,search(" ",b8,search(" ",b8)+1)+1)-1)

and still require compare text formula cell b , c.

try:

=trim(right(substitute(b8," ",rept(" ",777)),2331))

though i'm not @ clear other parts question. perhaps give examples?

regards

excel

html - Error 404 but not if I click on it -



html - Error 404 but not if I click on it -

if go illustration www.example.com(requires log in(i log in)) , has list of links.

i click on 1 of them , redirects me working page. if re-create url (of link) , paste browser 404 message. how possible , why?

does have cookies? have no idea.

thanks help.

there server variables credential and/or in-favorite created when login site. can not expect view same facility while not logged in.

html hyperlink website http-status-code-404

rdf - How to extract nodes that occur as both subject and object in a graph? -



rdf - How to extract nodes that occur as both subject and object in a graph? -

i want retrieve list of nodes(vertices in graph) occur both in subject , object part of triple(not same triple).

i tried doing using sub query follows:

select ?x { ?x ?p ?o. { select ?x { ?s ?p ?x . } } }

it not giving me exact results in sense getting multiple instances of node instance. , when tried distinct, gave more instances reason.

on side note, if wanted extract nodes subject or object, how should go doing that?

please excuse if there mistakes in vocabulary used.

nodes subjects , objects short , sweet

just inquire appears subject , object:

select distinct ?x { ?s1 ?p1 ?x . ?x ?p2 ?o2 . } making illegible (just fun)

if want create bit shorter, much less readable, can utilize

prefix : <...anything...> select distinct ?x { ?x (:|!:) ?o ; ^(:|!:) ?s . }

the pattern (:|!:) matches property either : or not :. means matches everything; it's wildcard. (you utilize ?p wildcard, too, maintain reading…) path ^p means p, in reverse direction (so, e.g., ?person foaf:name ?name , ?name ^foaf:name ?person match same data. since (:|!:) wildcard, ^(:|!:) wildcard in reverse direction. can't utilize variables in property paths, though ?p "forward wildcard", can't utilize ^?p "backward wildcard". ; notation lets abbreviate, e.g., ?x :p2 :o1 , ?x :p2 :o2 ?x :p1 :o1 ; :p2 :o2. using here, can get:

?x (:|!:) ?o ; # every ?x subject ^(:|!:) ?s . # every ?x object

removing comments , linebreaks, get

?x (:|!:) ?o ; ^(:|!:) ?s .

you should utilize readable one. :)

nodes subjects or objects

this answered in previous question computing node degree, how calculate maximum grade of directed graph using sparql?. reply there used query compute degree:

select ?x (count(*) ?degree) { { ?x ?p ?o } union { ?s ?p ?x } } grouping ?x

it can find nodes subjects or objects, too, though. alter to:

select distinct ?x { { ?x ?p ?o } union { ?s ?p ?x } }

alternatively, utilize wildcard approach here, too:

select distinct ?x { ?x (:|!:)|^(:|!:) []. }

rdf sparql

Sikuli integration with Selenium Webdriver info -



Sikuli integration with Selenium Webdriver info -

i have added required jars in build path, error when execution reaches sikuli apis

[error] resourceloaderbasic: checklibsdir: libs dir not on scheme path: c:\users\general\desktop\sikuli\libs [action] resourceloaderbasic: checklibsdir: please wait! trying add together user's path [info] runcmd: reg query hkcu [info] runcmd: reg query hkey_current_user\environment /v path [error] resourceloaderbasic: checklibsdir: logout , login again! (since libs folder in user's path, not activated) [error] terminating sikulix after fatal error!

sorry, makes no sense continue! if not have thought error cause or solution, run 1 time again debug level of 3. might paste output q&a board.

here code

import org.junit.test; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.firefox.firefoxdriver; import org.sikuli.script.app; import org.sikuli.script.findfailed; import org.sikuli.script.pattern; import org.sikuli.script.screen; public class sikuli_test3 { @test public void functionname() throws findfailed { // create new instance of firefox driver webdriver driver = new firefoxdriver(); // , utilize visit google driver.get("http://www.google.co.in"); //webelement element = driver.findelement( by.id("gbqfq")); //element.sendkeys("hello"); //element.click(); //create , initialize instance of screen object screen screen = new screen(); //add image path pattern image = new pattern("c:\\sikuli_images\\iam_feeling_lucky.png"); //wait 10ms image screen.wait(image, 10); //click on image screen.click(image); } }

see if user defined environment variables %sikuli_home% nowadays in scheme , added path environment variable. if present, restart system. should work.

http://doc.sikuli.org/faq/030-java-dev.html

let me know if helps you.

selenium-webdriver sikuli

jquery - kendo dropdownlist with checkbox -



jquery - kendo dropdownlist with checkbox -

good day,

i have kendo dropdownlist has checkboxes. info dropdown coming table in sql database. problem when select info in dropdown doesn't display in dropdownlist (i want show multiselect function). im not sure if im getting value of selected item when select it.

heres code:

html:

<input id="dropdownlist" runat="server" /> <script type="text/x-kendo-template" id="checkboxtemplate"> <li unselectable="on" class="k-item nowrap check-item"> <input type="checkbox" name="#= day #" value="#= id #" class="check-input" #= "" ? "checked" : "" # /> <span>#= day #</span> <br/> <span>#= starttime #-#= endtime #</span> </li> </script>

scripts:

<script type="text/javascript"> $(document).ready(function () { var clientcusid = $("#clientcusid").val(); var clientid = $("#clientid").val(); var clientcusposid = $("#clientcusposid").val(); var info = new kendo.data.datasource({ transport: { read: { url: '/customer/loadcustomerpositionshiftlist?clientcusid=' + clientcusid + '&clientid=' + clientid + '&clientcusposid=' + clientcusposid, datatype: "json", type: "post" } } }); dropdown = $("#dropdownlist").kendodropdownlist({ datatextfield: "day", datavaluefield: "id", optionlabel: { day: "--select all--", starttime: "", endtime:"", id: "" }, template: $("#checkboxtemplate").html(), datasource: data, select: function (e) { e.preventdefault(); } }).data("kendodropdownlist"); //it doesn't go here dropdown.list.find(".check-input,.check-item").bind("click", function (e) { var $item = $(this); var $input; if ($item.hasclass("check-item")) { // text clicked $input = $item.children(".check-input"); $input.prop("checked", !$input.is(':checked')); } else // checkbox clicked $input = $item; var val = $input.val(); //check clicked? if (val == "") dropdown.list.find(".check-input").prop("checked", $input.is(':checked')); var ddl = $('#dropdownlist').data().kendodropdownlist; var model = ddl.dataitem($input.closest('.k-item').index()); alert(model.text); updatedropdown() e.stopimmediatepropagation(); }); updatedropdown() }); function updatedropdown() { var items = []; dropdown.list.find(".check-input").each(function () { var $input = $(this); if ($input.val() != "" && $input.is(':checked')) items.push($input.next().text()); }); // check check if items checked $(dropdown.list.find(".check-input")[0]).prop("checked", items.length == dropdown.list.find(".check-input").length - 1); dropdown.text(items.tostring()); } </script>

hope help me this.

this reference: http://jsfiddle.net/gregmarkv/jnnd5/

http://jsfiddle.net/mg89g/331/

jquery asp.net-mvc-3 checkbox kendo-dropdown

java - Jenkins Plugin, share local configuration -



java - Jenkins Plugin, share local configuration -

i have plugin 2 builders (buildera & builderb)

each builder has own local config step , dropdown field called 'server', default value 'defualt' , options have been defined global. these steps can run independently (so buildera doesn't need builderb ...) or togher buildera b.

when running e.g. buildera builderb, if buildera has had server set should able leave builderb default , should pick server used buildera. i've gotten close with:

project p = (project)build.getproject(); list<builder> blist = p.getbuilders(); for(builder b : blist){ //somethinghere }

from debugging blist contains builders build , in loop b specific builder in case buildera. can name check right builder, can not server value (though can see debug).

any ideas?

fixed it!

check b class looking (example buildera) then:

buildera = (buildera)b;

you can access getter methods other builder

java jenkins jenkins-plugins

sails.js - SAILS 0.10: Async & Promise issue when save to database -



sails.js - SAILS 0.10: Async & Promise issue when save to database -

it seems have issue async on promise. have tested sails-mysql, sails-mongo, sails-postgres version 0.10-rc-xx , problem happen. when utilize sails-disk, there's no problem. comment below

var storeinvoicedetail = function( detail ) { homecoming function( cb ) { cb(null, detail); }; } var getpreviousdetail = ['storeinvoicedetail', function( cb, results ) { var invoicedetail = results.storeinvoicedetail; previousdetail .findone({ invoice: invoicedetail.invoice, product: invoicedetail.product.id }) .sort('createdat desc') .exec(cb); }]; var createpreviousdetail = ['storeinvoicedetail', function( cb, results ) { var invoicedetail = results.storeinvoicedetail; previousdetail .create({ invoice: invoicedetail.invoice, product: invoicedetail.product.id, quantity: invoicedetail.quantity }) .exec(cb); }]; var getstockdifference = ['storeinvoicedetail', 'getpreviousdetail', function( cb, results ) { var difference = results.storeinvoicedetail.quantity - results.getpreviousdetail.quantity; cb(null, difference); }]; // see here var updateproductstock = ['getpreviousdetail', 'getstockdifference', function( cb, results ) { product .findone(results.getpreviousdetail.product) .then(function(product) { // imagine value of 'results.getstockdifference' 5 product.stock += results.getstockdifference; product.save(); // when log, output is: 5, value not updated database // seems 'product.save()' @ above not called // maybe code have issues 'async' & 'promise' // know how right this? console.log(product.stock); cb(null, product.stock); }); }]; exports.updateproductstock = function (details) { var beforemodifyproductstock = {}; async.each(details, function( detail, callback ) { beforemodifyproductstock = { storeinvoicedetail: storeinvoicedetail(detail), getpreviousdetail: getpreviousdetail, createpreviousdetail: createpreviousdetail, getstockdifference: getstockdifference, updateproductstock: updateproductstock }; async.auto(beforemodifyproductstock, function( err, results ) { console.log('now latest stock ' + results.updateproductstock); callback(); }); }, function (err) { // no action }); }

.save() asynchronous method. rewrite updateproductstock function as:

var updateproductstock = ['getpreviousdetail', 'getstockdifference', function( cb, results ) { product .findone(results.getpreviousdetail.product) .then(function(product) { product.stock += results.getstockdifference; // note callback argument .save() product.save(function(err, product) { console.log(product.stock); cb(err, product.stock); }); }); }];

and should okay.

promise sails.js waterline async.js sails-mongo

module - AngularJS, Jasmine, and run() -



module - AngularJS, Jasmine, and run() -

it may question has been answered, cannot find addresses forgive me if reasking has been answered somewhere else.

according angularjs documentation:

run blocks - executed after injector created , used kickstart application. instances , constants can injected run blocks. prevent farther scheme configuration during application run time.

i'm writing unit tests , need test next code:

'use strict'; angular.module('htmlfwapp', []).run(['applicationmodel', function(applicationmodel) { applicationmodel.mergefromjsonasync('application.config.json'); // code makes phone call 'application.config.json' // , merges via _.extend applicationmodel. } ]); beforeeach(module('htmlfwapp')); beforeeach(inject(function($httpbackend) { $httpbackend.whenget('application.config.json').respond({ 'applicationnameshort': 'jasmine config', 'applicationnamelong': 'jasmine config', 'applicationdescription': 'this test of everything!', 'applicationkey': 'test' }); })); describe('applicationmodel test', function() { it('should inject , defined', inject(function(applicationmodel) { expect(applicationmodel).tobedefined(); })); it('should merge properties provided json', inject(function(applicationmodel) { expect(applicationmodel.applicationnameshort).tobe('jasmine config'); })); });

the problem run method not called before test. there way trigger run called or missing obvious?

after doing digging , asking around, found solution. set $q promise on applicationmodel , in test wait promise resolve:

it('should merge properties provided json', inject(function(applicationmodel, $httpbackend) { runs(function () {console.log('starting!')}); waitsfor(function () { homecoming applicationmodel.loadingpromise === undefined; }); runs(function () { expect(applicationmodel.applicationnameshort).tobe('jasmine config'); }); $httpbackend.flush(); }));

angularjs module jasmine

Excel 2007 - Mandatory single cell input with unique value -



Excel 2007 - Mandatory single cell input with unique value -

i working in phone call center , create daily reports of tickets. daily study contains tickets(logged calls in system) , queue(language) have been logged. ex.: "call12121/im12121212 - it/fr/en/ro queue"

the excel file looks sth this:

...............a.......... |...............b................|..............c..............|

1 .....ticket nr ....|.... language fr.....|.....language it....|

2 ....im123456......|..............1.................|..............................|

3.......................... |.................................|..............................|

so, need is, basically, when agent completes excel study ticket number (e.g. im1213123) must come in value queue , value number 1. after queue/language cells row locked/blocked , agent not able come in other values.

for example: excel sheet looks empty above one. agent enters/copy-paste ticket number in cell in column ticket , after needs come in queue/language value. , in case doesn't come in value queue (a windows guess) prompt him, when tries add together value in other cell(except corresponding one), has completed study correctly (or that)

example: column named ticket column b named fr , column c named it. agent , need finish study , lets have single ticket report. open excel daily study file -> paste ticket number in a2 cell, , after finish language/queue column. lets come in 1 in b2 fr language. , if want come in 1 on c2 show me error or rest of row blocked not allow come in multiple values in language part in report. mean 1 ticket (imxxxxx) can't created on both fr , queue. 1 queue allowed 'selected'. 1 language able come in value.

so above example: im123456, should come in single value, either 1 fr, either 1 it, can't both , if none come in , move on next row or trying save file receive warning cell values have not entered. same thing row , same next 1 etc. ticket nr entered in row, 1 value entered on 1 of language columns row.

i know part of excel macros , vb programming(where have no knowledge) can please give me code or maybe should read more etc ?

i working in excel 2010.

you utilize dropdown list instead , have 1 field called language

check out : http://www.excel-easy.com/examples/dependent-drop-down-lists.html

excel-vba excel-formula excel-2010

virtualhost - How to restrict apache virtual hosts? -



virtualhost - How to restrict apache virtual hosts? -

i have 1 site enabled, illustration foobar.com. when open ip address 127.0.0.1 - it's opens foobar.com. whatever maps 127.0.0.1 in /etc/hosts open - foobar.com opened.

how can configure virtualhost/apache allow access foobar.com?

apache 2.4, ubuntu 13.10

apache uses first virtualhost "default" host. is, whenever can't map requested hostname (127.0.0.1 in case) specific virtualhost, utilize default one.

just define virtualhost before foobar.com one. if have both in same configuration, configure default 1 first. if have separate config files, name "default" 1 so, gets loaded before foobar.com one. many linux distributions utilize name 00-default.conf default vhost.

apache virtualhost

sql - sum equal zero for variables for sas -



sql - sum equal zero for variables for sas -

i looked @ net not find relevant.

i have table thousands of variable.

i'm trying sum of 1 single variable , find out , variable in sum , equal zero.

example

col1 col2 col3 0 0 0 1 0 2 1 0 3

results

col2 0

however, proc means not want take clause.

proc sql; create table toto select nomvar,monotonic() num_lig dicofr nomvar <> 'date'; proc sql; select nomvar :varnom separated ' ' toto num_lig between 0 , 1000; %put varnom: &varnom; proc means data=afr sum (where=(sum(&varnom)=0) ; var &varnom; output out=want; run;

what doing wrong?

thank can lead me solution.

this it. believe requires sas 9.3+ stackedodsoutput option.

*generating data; info have; array x[100]; phone call streaminit(7); = 1 20; _t = 1 dim(x); if rand('uniform') < 0.9 x[_t]=0; else x[_t]=1; end; output; end; run; *ods output grabs want proc means; ods output summary=want(where=(sum=0)); proc means data=have sum stackodsoutput; var x:; run; ods output close;

sql sas

c# - Changing the color of a linkbutton on click? -



c# - Changing the color of a linkbutton on click? -

i have user command called courses displays available courses. in user command file, utilize repeater command display courses. course of study names rendered linkbuttons within itemtemplate. utilize user command in page called foo.aspx. using javascript function alter color of value within itemtemplate when clicked. color changes sec when click, goes original color. know doing wrong here?

my javascript function.

<script> function changecolor(e) { e.style.color = "red"; } </script> <asp:linkbutton id="linkbutton1" onclientclick="return changecolor(this);" runat="server">linkbutton</asp:linkbutton>

as said on comment, careful page postback.

to prevent linkbutton color reseted, think should save them within viewstate

i don't know whether it's best solution or not, @ to the lowest degree i've seek help :)

here aspx:

<asp:repeater id="myrepeater" onitemcommand="myrepeater_itemcommand" runat="server"> <itemtemplate> <asp:linkbutton id="mylinkbutton" runat="server" commandname="change_color" forecolor="<%# system.drawing.color.fromname(container.dataitem.tostring()) %>">your text</asp:linkbutton> </itemtemplate> </asp:repeater>

here code behind (c#):

first create viewstate (this key prevent info lost after postback)

list<string> listdata { set { viewstate["listdata"] = value; } { if (viewstate["listdata"] == null) homecoming new list<string>(); else homecoming (list<string>)viewstate["listdata"]; } }

on page load:

protected void page_load(object sender, eventargs e) { if (!ispostback) { listdata = new list<string>(); listdata.add("blue"); listdata.add("blue"); listdata.add("blue"); } myrepeater.datasource = listdata; myrepeater.databind(); }

when click linkbutton repeater trigger onitemcommand

protected void myrepeater_itemcommand(object sender, repeatercommandeventargs e) { if (e.item.itemtype == listitemtype.item || e.item.itemtype == listitemtype.alternatingitem) { if (e.commandname == "change_color") { linkbutton linkbutton = (linkbutton)e.item.findcontrol("mylinkbutton"); if (linkbutton.forecolor != system.drawing.color.red) { linkbutton.forecolor = system.drawing.color.fromname("red"); listdata[e.item.itemindex] = "red"; //this key! prevent color reset, save them within viewstate } else { linkbutton.forecolor = system.drawing.color.fromname("blue"); listdata[e.item.itemindex] = "blue"; } } } }

c# javascript asp.net

xcode - How to present a modal atop the current view in Swift -



xcode - How to present a modal atop the current view in Swift -

(xcode6, ios8, swift, ipad)

i trying create classic web-like modal view, outside of dialog box "grayed-out." accomplish this, i've set alpha value of backgroundcolor of view modal 0.5, so:

self.view.backgroundcolor = uicolor.blackcolor().colorwithalphacomponent(0.5)

the problem when modal becomes full-screen, presenting view removed. (ref transparent modal view on navigation controller).

(a bit irritated @ concept here. why remove underlying view? modal is, definition, appear atop other content. 1 time underlying view removed, it's not modal anymore. it's somewhere between modal , force transition. wa wa wa... anyway..)

to prevent happening, i've set modalpresentationstyle currentcontext in viewdidload method of parent controller, , in storyboard... no luck.

self.modalpresentationstyle = uimodalpresentationstyle.currentcontext self.navigationcontroller.modalpresentationstyle = uimodalpresentationstyle.currentcontext

how prevent presenting view beingness removed when modal becomes total screen?

tyvm.. more info below.

also in storyboard, (presentation: current context)

thx help... documentation below:

i had same problem. worked me remove explicit setting of modal presentation style , 1 thing:

in storyboard set modalviewcontroller's modalpresentation style "over current context"

i checked checkboxes in root(presenting) viewcontroller - provide context , define context. seem working unchecked.

xcode ipad modal-dialog swift transparent