Posts

Showing posts from July, 2015

ios - Pass self as argument within init method in Swift 1.2 -

the following class has ' let ' property declared implicitly unwrapped variable. worked xcode 6.2: class subview: uiview { let pandgesturerecognizer: uipangesturerecognizer! required init(coder adecoder: nscoder) { super.init(coder: adecoder) self.pandgesturerecognizer = uipangesturerecognizer(target: self, action: "panaction:") } func panaction(gesture: uipangesturerecognizer) { // ... } } after updating xcode 6.3 (with swift 1.2), following compilation errors occur: property 'self.pangesturerecognizer' not initialized @ super.init call immutable value 'self.pangesturerecognizer' may initialized once moving following line before super.init call: self.pandgesturerecognizer = uipangesturerecognizer(target: self, action: "panaction:") gives following error: 'self' used before super.init call the property ' pangesturerecognizer ' requires no mutation, therefore h

java - byte z[] = new byte[5]; - What does this mean? -

this question has answer here: difference between int[] array , int array[] 25 answers i'm trying head around piece of code found. firstly, i'm not sure why code appears like: byte z[] = new byte[5]; instead of: byte[] z = new byte[5]; i mean, byte z[] not there declare array of bytes ? or code doing else? secondly, why choose bytes on doubles or ints . seems byte number -128 127. what's point in choosing on double ? byte[] z equivalent byte z[] 2 different methods of represent same. note java code conventions of sun (before becoming oracle) propose use first on second. preferreable use byte[] z = new byte[5]; instead of byte z[] = new byte[5]; for second part of question. byte uses 1 byte char uses 2 bytes int uses 4 bytes long uses 8 bytes so best use smallest numeric type avoid memory occupancy.

java - Extracting live stock price using JSP -

can please tell me how extract company live stock prices of using jsp? i tryed without success extract it. uh no idea asking. use yahoo finance , use html parser parse html stock price.

ruby on rails - Capybara Element not found -

i wondering if explain me why getting error when element can seen on test page. writing test allow entries archived. @ point acting more separate saving mechanism clean show page or @ least allow be. test follows. "can archive diagnostic report" diagnostic_info = fg.create(:diagnostic_info) diagnostic_info.save! visit admin_diagnostics_path page.should have_content("test message") click_button "save" end the view = form_for [:admin, @diagnostic], url: admin_diagnostic_path |f| .field = link_to :raw_json, admin_diagnostic_path(@diagnostic, format: :json) .field = label_tag :device = label_tag %pre= json.pretty_generate(@diagnostic.data["device"]) .field = label_tag :localstorage = simple_format(@diagnostic.notes) -if @diagnostic.data["localstorage"] = label_tag %pre= json.pretty_generate(@diagnostic.data["localstorage"]) = s

javascript - Angular: Is sharing a Controller between views a sign that Service is needed? -

i'm building angular app includes 3 (potential) initial views users not signed in: intro.html : gives user option 'sign in' or 'register' register.html : new user registration form login.html : existing user login form i have 1 service, auth.service.js connects firebase : angular .module('app') .factory('authservice', authservice); authservice.$inject = ['$firebaseauth']; function authservice($firebaseauth) { var ref = new firebase('https://[my-firebase].firebaseio.com'); return $firebaseauth(ref); } i have 1 controller, login.controller.js , depends on authservice create user accounts, login users, connect facebook, etc. here portion of controller: angular .module('app') .controller('registercontroller', registercontroller); registercontroller.$inject = ['authservice','$location']; function registercontroller(authservice,$location) { var vm = this; vm.createuse

c# - Parsing JSON key/value pairs with JSON.NET -

i have .net project. i'm using json.net library. need use library parse json. json looks this: {"1":"name 1","2":"name 2"} the object list of key/value pairs. trying figure out how use json.net 1) parse json , 2) loop through key/value pairs. there way this? if so, how? the thing see de-serializing strongly-typed object. thank much! you can deserialize dictionary<string, string> var dict = jsonconvert.deserializeobject<dictionary<string, string>>(json); foreach(var kv in dict) { console.writeline(kv.key + ":" + kv.value); } since jobject implements idictionary , can use jobject.parse var dict = jobject.parse(@"{""1"":""name 1"",""2"":""name 2""}");

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null .

Problems serving .js and .css assets cloudfront CDN Heroku Rails 4 App -

Image
i trying host assets of rails 4 app on cloudfront cdn. used use asset_sync , s3 wanted switch on cdn. when go heroku app, see pages bare html. none of js or css being loaded. these errors getting console: screenshot of console errors: http://i61.tinypic.com/15rxdsj.jpg also, not sure if have set origin domain name , origin path correctly on cloudfront origin settings. using heroku app url origin domain name , "/production/assets" origin path. production.rb file: http://pastebin.com/2dzlpgfe i have been trying unsuccessfully past week heroku app display css , js. appreciate insight. in advance! moving cloudfront isn't drastic change seem think if had working s3. after all, cloudfront distributes contents of s3 bucket edge locations. means have let rails know cdn , not s3. there lot of things going on. have misconfigured cloudfront, should pointing s3 bucket origin. should test setup checking see asset in browser using cloudfront url. main poin

javascript - How to get a circle position in a g element in SVG using D3.js -

i have circle inside g element in svg. g element can move according x-coordinates. position of g element can change moves. circle moves in g element. question how can retrieve position of circle in svg not position in g element? tried following code not expecting: circlegroup.on("mouseover", function() { var translate = d3.transform(d3.select(this).attr("transform")).translate; alert(translate[0].x); }); may assist me retrieve position of circle in svg not in g element, please? need position of circle in order draw line starting position in svg not g element circle in. assistance appreciated. here is: jsfiddle if want position of circle moused-over, create .on handler on circles instead of g element (this way know element received event): ... var circles = circlegroup.selectall("circle") .data(circledata) .enter() .append("circle") .on("mouseover", mouseover) ... function mou

javascript - ALWAYS Getting the same ID from the different dropped images -

i have 7 different divs (from #rang1 #rang7) , can drop images on them. images class .draggeditem come database , of them have different id's. display these images normal fetch_assoc. if it's necessary see code of doing please tell me can post it. it's regular fetch_assoc method. no further talking let's jump code the js: <script type="text/javascript"> $(function(){ $(".draggeditem").draggable({ helper:'clone', cursor:'move', revert: true }); $('#rang1').droppable({ drop: function( event, ui ) { //$('#rang1input').val($(ui.draggable).attr('id')); var elemid = ui.draggable[0].id; $("#rang1input").val(elemid); var imgsrc = ui.helper[0].src; var $img = $('<img></img>'); $img.width(90); $img.height(90); $img.attr('src', imgsrc); $(&#

c++ - Memory reservation for java objects -

i know when declaring object instances in c++ so: object object the object constructor called , memory provided object, find when in java object instance doesn't have value until: object = new object() is written. want know when memory provided object. thought both construction , new keyword allocated memory object object = new object() seems redundant. read on oracle's site declaration "reserves" memory , new "allocates" memory, know difference between two. you need differentiate between space required variable , space required object . bear in mind value of variable reference - pointer in c++. if have: object x = null; then variable x takes enough space reference (usually 4 or 8 bytes). if have: x = new object(); that creates object - value of x reference newly created object. x takes same amount of space before, there's space required object (basically fields, reference type of object, , data synchronization , house-k

java - Why isn't my listview updating? -

i've got problem listview. when press button should add item listview, doesn't. i've used toast sure onclick event button good. can me ? fragment's java code. package com.wordpress.softwarebycs.i_cseditor; import android.app.actionbar; import android.app.activity; import android.content.context; import android.graphics.color; import android.os.bundle; import android.support.annotation.nullable; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.text.layout; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.webkit.webview; import android.widget.adapterview; import android.widget.arrayadapter; import android.widget.button; import android.widget.edittext; import android.widget.linearlayout; import android.widget.listview; import android.widget.spinner; import android.widget.tabhost; import android.widget.tabwidget; import android.widget.textview; import and

jquery - Ajax Call Custom Model Binder returning FormData in URL -

i have created custom model binder complex collection posting via ajax. , good, until return jsonresult page, entire formdata appended url. there small missing here? i have ajax post form. $(document).ready(function() { $("#savebutton").click(function(e) { var form = $("#myform"); $.ajax({ type: "post", url: '/mycontroller/saveall', data: form.serialize(), datatype: "json", error: function(xhr) { console.log('error: ' + xhr.statustext); }, success: function(result) { console.log(result); }, async: true }); }); }); the controller action. public jsonresult saveall([modelbinder(typeof(custommodelbinder))]provincelistviewmodel model) { // process return this.json(new { sucess = true }, jsonrequestbehavior.allowget); } here custom

python - Apple root certificate for push notifications on openshift -

i stuck on step of apns (apple push notification) process. have app-specific certificates , keys developer.apple.com work fine local dev server on osx system, on rhel based openshift cloud servers don't seem work. there cryptic step apple's documentation. https://developer.apple.com/library/ios/documentation/networkinginternet/conceptual/remotenotificationspg/chapters/communicatingwithaps.html#//apple_ref/doc/uid/tp40008194-ch101-sw1 note: establish tls session apns, entrust secure ca root certificate must installed on provider’s server. if server running os x, root certificate in keychain. on other systems, certificate might not available. can download certificate entrust ssl certificates website. i did obtain said certificate, both .der , .cer site. https://www.entrust.net/downloads/root_request.cfm# now put them? running django app (might switch in future, separate topic) on openshift. if want send apple push notifications shared server or paas ,

php - MySQL Date stored as 12h without AM/PM -

i realized, 6 months after system went live, insert query had h instead of h , bunch of entry dates stored 12 hour dates without am/pm indicator. there relatively simple method of fixing problem? database powered mysql 5.1.56-log . i'm idiot. i managed write python script achieved needed, if else ever runs problem, work fix it. (hooray!) import datetime #example data entries = [ ('2014-10-10 04:07:48', 1, 1136, 'jh'), ('2015-04-13 08:31:33', 0, 3066, 'mez'), ('2015-04-13 09:38:06', 0, 3067, 'vl'), ('2015-04-13 10:34:54', 1, 3068, 'j.a'), ('2015-04-14 02:43:08', 1, 3069, 'acm'), ('2015-04-14 03:35:49', 0, 3070, 'acm'), ('2015-04-14 08:30:39', 0, 3071, 'ic'), ('2015-04-14 09:35:07', 1, 3072, 'dk'), ('2015-04-14 10:38:36', 0, 3073, 'zg'), ('2015-04-14 11:36:09', 0, 3074, 'vl

android - Unable to change TextView size on button click, why? -

hello guys right i'm working on app in there many quotes, in textview , want change size of textview on button click, if small button clicked textview should become small, if large clicked should large, etc. each time press button app force closes! what's problem? here's onclicklistener button : small = (button) findviewbyid(r.id.small); small.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { textview tv = (textview)findviewbyid(r.id.quotes); tv.settextsize(20); } }); p.s: textview , button in different activities . there no way change textview size button 1 activity in other activity . nullpointerexception because findviewbyid method not find view , return null. should use sharedpreferences . should save text size value when click button , read in second activity . in setting activity: small.setonclicklistener(new view.onclicklistener() {

Generating invoice email using Webhook in Stripe and Mailchimp -

can please tell me (or point me in direction) how generate invoice email using webhook api in stripe mailchimp account? you can't directly because can't create mailchimp endpoint receives data through web. need intermediary layer in between stripe , mailchimp, receives data stripe, validates data, converts data according needs, , using mailchimp api sends mailchimp sent out email. easier approach (in opinion) creating in-house solution sending out emails instead of using mailchimp.

c++ - How to implement Find-on-Page command in MFC web browser control with pre-filled search word? -

i'm using mfc web browser control in dialog-based mfc project display html content , trying make show "find on page" dialog window search word pre-selected in it. (what you'd if hit ctrl+f in ie web browser.) if following find dialog shown ok, doesn't seem support way pre-fill search word: iwebbrowser2* pwebbrowser = null; lpunknown unknown = m_browser.getcontrolunknown(); unknown->queryinterface(iid_iwebbrowser2,(void **)&pwebbrowser); if(pwebbrowser) { hresult hr; ccomvariant varnull; if(succeeded(hr = pwebbrowser->execwb(olecmdid_find, olecmdexecopt_promptuser, &varnull, &varnull))) { //success! } pwebbrowser->release(); } if(unknown) { unknown->release(); } i found this msdn page , says: olecmdid_showfind tells receiver show find dialog box. takes vt_dispatch input param. so evidently there's find command olecmdid_showfind id, can't seem make work. don't understa

c# - StreamWriter add an extra \r in the end of the line -

i created class responsibility generate text file each line represents information of object of 'mydataclass' class. below simplification of code: public class generator { private readonly stream _stream; private readonly streamwriter _streamwriter; private readonly list<mydataclass> _items; public generator(stream stream) { _stream = stream; _streamwriter = new streamwriter(_stream, encoding.getencoding("iso-8859-1")); } public void generate() { foreach (var item in _items) { var line = anotherclass.getlinefrom(item); _streamwriter.writeline(line); } _streamwriter.flush(); _stream.position = 0; } } and call class this: using (var file = new filestream("name", filemode.openorcreate, fileaccess.readwrite)) { new generator(file).generate(); } when run application on visual studio (i test run (ctrl+f5), debug (f5), debug

css - how can I edit text in scaffold -

i use scaffolding in rails , have part of text:text. how can change text not in 1 line. if press return/enter save return/enter in data? now in 1 line! i don't undestand question. don't know if asking form or style-css? look @ tutorial: https://www.codeschool.com/courses/rails-for-zombies-redux and here have scaffold: https://http://railscasts.com/episodes/216-generators-in-rails-3

java - Generate IDP Certificate in Azure AD for SSO -

i implementing sso azure ad 3 applications.i can able make work 2 applications developed in .net third application running on java , need enable sso that.in configuring page of java application requires idp certificate , not sure portal.could show me pointer around this? i have searched through web , of posts talk need upload x.509 certificate.but cant see process obtain one. i have found way obtain x.509 certificate application. in azure portal under active directory on application tabs having list of application developing , owns.click on application want create certificate for.on bottom banner there link saying view endpoints.in pop first link federation link load in browser search x509.copy string save .crt , done. here link

c# - Quartz.Net XML config start-time / end-time -

i trying set trigger in quartz_jobs.xml launches job @ 8:05am , finishes today @ 12:10pm monday friday. job not repeated, job fetching continuous data. idea how that? can simple trigger, cron trigger not have control on end-time? i this, not know syntax: <start-time>todayt08:05:00.0z</start-time> <end-time>todayt12:10:00.0z</end-time> find below code try not work: <job> <name>simplejob</name> <group>jobgroup1</group> <description>jobdesciption1</description> <job-type>bigbrother.scheduledjobs.datafeedjob, bigbrother</job-type> <durable>true</durable> <recover>false</recover> <job-data-map> <entry> <key>jobmapdatakey_histrtd</key> <value>rtd</value> </entry> <entry> <key>jobmapdatakey_paramaterfile</key> <value>config\parametersdata_test.csv</value> &

operating system - NTFS vs FAT32 Search Time -

i'm doing paper on ntfs vs fat32 , showing comparison between both file systems. far knowledge goes, know ntfs uses mft holding files , directories whereas fat32 knows following cluster specific file or directory. means fat32 doesn't know a-priori first block of file if not found first looking in specific directory. my question following, if ntfs holds information regarding file system in file mean it's going faster when doing raw search filename "test.txt" within system? know, fat have scan every directory in hard drive , in each directory if filename exists whereas in ntfs, needs scan mft file contiguous record has name : "text.txt". right or i'm missing something? i don't know, yes(40% bet), turn problem stack overflow coding on-topic here resources can find answer , give self-answer : probably, reading "text": ntfs.com: ntfs basic microsoft technet: file systems technologies → how ntfs works for sure, reading

MySQL(Joomla) - Unknown Column -

i've migrated 1 component 1 of website another. in same version , looks fine except 2 errors i've listed below. unknown column 'a.downloads' in 'where clause' sql=select a.*,c.cid category, c.name category_name ve63d_joomgallery left join ve63d_joomgallery_catg c on c.cid = a.catid a.published = 1 , a.approved = 1 , a.downloads > 0 order a.downloads desc limit 0, 5 the other 1 : unknown column 'c.password' in 'where clause' sql=select c.cid, c.parent_id, c.name, c.access, c.published, c.hidden, c.owner ve63d_joomgallery_catg c lft > 0 , c.published = 1 , c.access in (1,1) , (c.password = '' or c.cid in (0)) order c.lft how can fix these tables?

c# - Error while querying Entity Framework, OutOfMemoryException or error when using context.AsNoTracking() -

i'm trying return application list application via json (using ajax). tried in 2 ways: using select var query = (from ad in db.addressnameplaces.asnotracking() ad.cepplace == zipcode.replace("-", string.empty) select ad ).tolist(); .where(expression) method: var query = db.addressnameplaces.asnotracking().where(l => l.cepplace == zipcode.replace("-", string.empty)).tolist(); both of them works fine. considerations: related tables in addressnameplace has on 770k records, , if use without .asnotracking() method, application returns json outofmemoryexception. entity framework instantiate lot of objects each record, , .asnotracking() method avoid it. if use queries above, i'm getting following error: "when object returned notracking merge option, load can called when entitycollection or entityreference not contain objects." so, what's wrong here? i find solution case. before

Solution for a bpmn diagram with multiple, related inclusive gateways -

Image
i've designed complicated bpmn solution , having trouble finding information explains behavior that's occurring. derive behavior testing take long time, tool i'm using quite cumbersome. here's picture of diagram, in hopes able explain behavior that's occurring. what's happening this: 'approval process' splits 4 branches, bottom branch being based on conditional. the top 2 branches converge on inclusive gateway the third branch converges on different inclusive gateway the fourth branch converges on both original inclusive gateway, later inclusive gateway i've included few notes on diagram explain failing. task near top right never hit, , believe consequently final process isn't hit either. know it's going wrong? it turns out diagram above defined how wanted be. issue turned out task 'wasn't firing' not given visibility type of user running workflow as. since couldn't see task, couldn't complete i

php - Data saved twice in MySQL database. Don't know what I do wrong? -

i working on feature on website. implemented interactive map using osm , leaflet , users add location reports map. although, first issue ran when users adding location report data being send websites mysql database registered twice should not. i kindly ask take @ code , search thing duplicate data. function map_location_report_form() { if( current_user_can( 'create_users' )) { global $wpdb; $this_page = $_server['request_uri']; $page = $_post['page']; if ( $page == null ) { echo '<form method="post" action="' . $this_page .'"> <div class="formfield-report" id="formfield-report-firstname"> <label for="first_name" id="first_name">navn: </label> <input type="text" name="first_name" id="firs

ios - Can I create a WatchKit app without a storyboard (entirely in code)? -

my team working on ios application in don't use storyboards @ all. create ui in code instead. consistency's sake great if create watch app target entirely in code. however, both "getting started watchkit" video , watchkit framework reference mention need storyboard watch app target. furthermore, in wkinterfaceobject.h init method marked unavailable: - (instancetype)init ns_unavailable; so impossible create watch app without using storyboards? if so, reasons behind decision? mean, can create iphone / ipad app entirely in code, why different watch? if read watchkit programming guide see app executing on user's iphone , app sends information displayed watch watchkit. as there none of code executing on watch itself, can't perform programmatic layout - watchkit uses storyboard provide layout , render information provided app running on iphone. apple has said possible develop native watch applications in future, may possible then.

html - CSS classes being called but not having effect -

i have following code: <html> <head> <style> .gr { color: "#ffffff"; background: "#00ff00"; border-radius: 8px 0 0 15px; } .or { color: "#00ff00"; background: "#ffa500"; border-radius: 0 15px 8px 0; } </style> </head> <body> <span class="gr">test1</span><span class="or">test2</span><br> </body> </html> but classes aren't having effect @ all. remains way if call external stylesheet. but , if <span style="color:#ffffff;background:#00ff00;border-radius:8px 0 0 15px"> works. can me this? you need remove quotes in css. .gr { color: #ffffff; background: #00ff00; border-radius: 8px 0 0 15px; } .or { color: #00ff00; background: #ffa500; border-radius: 0 15px 8px 0; } working jsfiddle here http://jsfiddle.net/u36k17v6/1/

spring batch sftp session auth failure: Caused by: java.lang.IllegalStateException: failed to connect -

i trying connect sftp using spring batch. using jsch way of sending files using sftp. getting following error: console log follows: i have added jsch-0.1.44.jar file apr 14, 2015 3:56:46 pm org.springframework.integration.sftp.session.jschlogger log info: connecting <servername> port 22 apr 14, 2015 3:56:46 pm org.springframework.integration.sftp.session.jschlogger log info: connection established apr 14, 2015 3:56:46 pm org.springframework.integration.sftp.session.jschlogger log info: remote version string: ssh-2.0-6.1.8.136 ssh tectia server apr 14, 2015 3:56:46 pm org.springframework.integration.sftp.session.jschlogger log info: local version string: ssh-2.0-jsch-0.1.44 apr 14, 2015 3:56:46 pm org.springframework.integration.sftp.session.jschlogger log info: checkciphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256 apr 14, 2015 3:56:46 pm org.springframework.integration.sftp.session.jschlogger l

python - In django template urls are imported correctly but don't work -

i total noob in django, might seem may miss obvious. i using django userena app. following official documentationv include userena urls this from django.conf.urls import patterns, include, url django.contrib import admin urlpatterns = patterns('', # examples: url(r'^accounts/', include('userena.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^$', 'mysite.views.home', name='home'), # url(r'^blog/', include('blog.urls')), ) and when try use url in template load correctly, don't work. <div class="search_button" type="submit"> find </div> <div href="{% url 'userena_signin' %}" class="enter"> sign in </div> <div href="{% url 'userena_signup' %}" class="enter"> sign </div> when load page

sql server - how I can Fix this error (migrate to sql azure) -

i error total_write not supported in current version when try validate database sql server migration in sql azure. how can fix error migrate sql azure also git error sp_spaceused not supported in current version of azure sql database storedprocedure [dbo].[p_sizetables] -- 'db_name there several differences between sql server , sql database need accounted when migrating on-prem cloud. more information please check https://msdn.microsoft.com/en-us/library/azure/ee730904.aspx in case, several builtin functions applicable sql server on prem. need remove them sps before migrating cloud. also, complete compatibility sql server, make sure have v12 database on sql azure. more details check http://azure.microsoft.com/en-us/documentation/articles/sql-database-preview-whats-new/

python - How to plot a bar plot in realtime using matplotlib -

i've continuous stream of data bins of histogram. can plot in real-time if use following: import pylab plt matplotlib.pyplot import figure, show import numpy np plt.ion() x = np.linspace(0,4095,16) y = np.linspace(0,10000,16) f, axarr = plt.subplots(4, sharex=true) graph_low, = axarr[0].plot(x,y,label='somelabel') graph_low.set_ydata(z) but plots line-plot. the issue can't find similar set_ydata bar plot. does job you? ax = plt.bar(left, height) ax.patches[i].set_height(x) where i index particular bar , x desired height.

php - Exporting Nodes using drush as csv files issues -

i want export nodes specific type drupal website csv file using drush have trying command fails. drush node-export --type=break,article --format=dsv --sql "select nid node limit 100" --file=/root/article.csv error output: the directory 1 not contain valid drupal installation [0.1 sec, 5.71 mb] could please advice the problem has been solved following steps : 1- have select needed nids databases. 2- have passed nids drush command following : 3- drush node-export --type=break,article --format=dsv nids 33 300 3012 45 --file=/root/article.csv you have make sure have node-export enabled drupal.

javascript - Trying to prevent default -

this project working on, little popup ad client's website tell users summer camps coming up. want ad show on load, , user can choose close ad or click link go registration page. i trying code work problem when click 1 of close buttons ad closes, page reloads , ad right was. trying figure out appropriately place "prevent default" code either works before ad can show first time, or in case shown here... not @ all. i realize using both jquery , js new , piecing code find it. <script type="text/javascript"> $(".close").click(function(){ $("#summercampad").addclass("hidden"); onload.preventdefault(); }); window.onload = function () { document.getelementbyid("summercampad").classname = document.getelementbyid("summercampad").classname.replace ( /(?:^|\s)hidden(?!\s)/g , '' ) }; </script> <div id="summercampad" class="hidden" > <div id="popupcontainer&