Posts

Showing posts from July, 2010

javascript - How to refresh div with jquery, without duplicating -

i'm using code refresh div every 10 seconds: <script type="text/javascript"> setinterval(function(){ $('#feed').load('forum.php #feed').fadein("slow"); }, 10000); </script> works great, except first load (after 10 seconds) makes duplicate of div, it's 1 sitting atop other. after that, div refreshes every 10 seconds, without making more duplicates. any ideas what's wrong code? div is: <div id="feed">... stuff ... </div> thanks! from jquery docs : when method executes, retrieves content of ajax/test.html, jquery parses returned document find element id of container. this element, along contents, inserted element id of result , , rest of retrieved document discarded. so inserting same element page multiple times. try changing selector $('#feed').load('forum.php #feed>*').fadein("slow");

Difference in garbage collector behavior on Android device versus the emulator -

i'm testing application's memory usage on emulator. , problem on emulator app heap growing , growing, little bit of resources freed. , if no collections made cause outofmemory exception on big resolution screens. i downloaded sony sdk , there emulator configuration xperia z has 1080x1920 resolution , default heap 64mb. think it's small heap size resolution because app uses 40mb starting up. on phone it's using 15mb of 64mb (res. 540x960). quite small heap size (might not real?) + gc behavior causing outofmemory quite fast. on real device (i've tested on mine), gc working nicely, it's freeing resources no longer used, cannot predict if work on other phones. should ignore how gc working on emulator or might app's problem? growing heap on emulator indicates @ point have memory leak. they common when send intents between different applications ( e.g select image gallery) . of device can handle such leaks no problem. another reason heap

javascript - Get json of header included link -

i localize website using json. want include files inside html. how can access json object later in javascript ? <link rel="localization" hreflang="en" href="lang/en.json" type="application/l10n+json"/> i don't use path string directly inside javascript. link element loaded automatically ? should use different header tag declare path json file. how can access header tags ? you can use ajax request if have jquery: $.getjson("lang/en.json", function(data) { alert(data); }); without jquery gets complicated: consuming json data without jquery (sans getjson)

can't connect android app to mysql using php the error is with my android code -

import android.os.bundle; import android.app.activity; import android.view.menu; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import java.io.ioexception; import java.io.unsupportedencodingexception; import java.util.arraylist; import java.util.list; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.namevaluepair; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.message.basicnamevaluepair; import android.os.strictmode; import android.util.log; import android.widget.edittext; public class login extends activity { button button2; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.act

.htaccess Add an exception to 404 redirect to particular sub-directory -

the sub-directory /addon/ stores data sub-domains a.k.a addon domains. in sub-directory store primary domains data, primary domain website.com rewriteengine on rewritecond %{http_host} ^(www.)?website.com$ [nc] rewritecond %{request_uri} ^/addon/(.*)$ rewriterule ^(.*)$ - [l,r=404] okay part done, if enter website.com/addon/mysecondwebsite-com 404. if enter mysecondwebsite.com see contents of website.com/addon/mysecondwebsite-com. this great, thats wanted. now tricky part, set website.com use website.com/addon/website-com. no need tell me how configure /addon/website-com website.com. need disable 404 website.com configured use /addon/website-com/ need make sure if enter website.com/addon/website-com directory returned 404.* my rewrite conditions mention if enter /addon/* on primary domain (website.com) returned 404 error. great addon domains because use /addon/ , not primary domain. how block /addon/* still use primary domain? website.com = 404 / bad (w

sql server - How to select output of XML Path query in SQL? -

doc table contains lot of columns (even not used ones): doc_ddfid doc_rentdate doc_returndate etc. --------- ------------ -------------- ---- 1 2012-07-28 2012-07-28 but want query used ones within doc 's table. docdefinitionfields list columsn in use document: select dfl_colname docdefinitionfields dfl_ddfid = 1 docdefinitionfields : dfl_colname ----------- doc_rentdate doc_returndate ........... so want select columns (listed second query) doc table. example (if 2 columns added document definition form want select them): doc : doc_rentdate doc_returndate ------------ -------------- 2012-07-28 2012-07-28 tried subquerying select concatenation of fields using xml path: select (select dfl_colname + ', ' docdefinitionfields xml path('') ) doc it's not simple tho. suggest? what need here dynamic sql, this: declare @sql varchar(max) set @sql = 'select ' + stuff((sele

sql - How to Remove a Column Article for Transaction Replication -

i followed direction following link, how to: define , modify column filter (replication transact-sql programming) . have setup i'm replicating @ table, users. no longer want replicate column, ssn. test, inserted new row users table including ssn. executed following sql statements no errors. after synced publication using replication monitor, new row didn't show in replicated database. decided insert , resync. other row didn't show new 1 did missing ssn expected. there did wrong? exec sp_articlecolumn @publication = n'publisher test 01', @article = n'users', @column = n'ssn', @operation = n'drop', @force_invalidate_snapshot = 1, @force_reinit_subscription = 1 exec sp_articleview @publication = n'publisher test 01', @article = n'users', @change_active = 1 exec sp_startpublication_snapshot @publication = 'publisher test 01' exec sp_reinitsubscription @publication = n'publisher test 01

ListView android: I can't see my list items -

i'm trying show listview in android application. (i know i'm not extending of listactivity, can error?) code: public class home extends activity{ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_home); startlocation(); createmenutabs(); final string[] datos = new string[]{"lista 1","lista 2","lista 3","lista 4","lista 5"}; arrayadapter<string> adaptador = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, datos); listview urban_lines_list = (listview)findviewbyid(r.id.urban_lines_list); urban_lines_list.setadapter(adaptador); } } the xml is: <linearlayout android:id="@+id/urbano" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_par

2-legged OAuth 1.0a in Objective C - ios app development -

i developing iphone application in objective-c , quite new in it. have request url, consumer key , secret. how can 2 legged authentication, provide me code please. checked afnetworking project , other samples think complex noob me. thanks. unfortunately using oauth not simple, , library gtm-oauth ( http://code.google.com/p/gtm-oauth/ ) has decent documentation , samples doesn't make easy. i try seeing if service provider has own library on github should wrap complexity. otherwise gtm-oauth place start.

java - Error given only in terminal? -

i have rock paper scissors program done, , when run in eclipse compiles fine , game plays okay. although, when compile in terminal (using ubuntu) following error: xx@xx:~/dropbox$ cd t* xx@xxxx:~/dropbox/xx$ ls rpsgame.java rpsplayer.java rpstournament.java xx@xx:~/dropbox/xxxx$ javac rpstournament error: class names, 'rpstournament', accepted if annotation processing explicitly requested 1 error xx@choloboy:~/dropbox/xx$ any idea mean? you need include file extension ".java" on command line when compiling. to compile use: javac rpstournament.java to run use: java rpstournament

Is there any command that I can learn the size of a table at Hbase? -

is there command can learn size of table @ hbase? use hbase hold crawl data nutch. if running hbase on hadoop following command can used hadoop fs -du [path] [path] has replaced value of hbase.rootdir in hbase-site.xml the output like: $ hadoop fs -du /hbase 4056 hdfs://127.0.0.1:9000/hbase/-root- 22307 hdfs://127.0.0.1:9000/hbase/.meta. 0 hdfs://127.0.0.1:9000/hbase/.corrupt 0 hdfs://127.0.0.1:9000/hbase/.logs 0 hdfs://127.0.0.1:9000/hbase/.oldlogs 1716 hdfs://127.0.0.1:9000/hbase/table1 1472 hdfs://127.0.0.1:9000/hbase/table2 1498 hdfs://127.0.0.1:9000/hbase/table3 1320 hdfs://127.0.0.1:9000/hbase/sampletable the size displayed here in bytes. if running hbase on local filesystem (os filesystem) can use normal du command. this give rough idea size of table in hbase.

text - JSON Keeping only certain fields -

i have json file , save jobid , exec fields in separate file. here format of file, "2595272":[{"jobid":"2595272", "account":"a-ch51", "user":"yongjin","pkgt": [], "startepoch":"1338406823", "runtime":"56574", "exectype":"user:binary", "exec":"lmp_tacc", "numnodes":"3", "sha1":"ef281f0fe457a2b338fe03734297bc7233985f8c", "execepoch":1337289959, "execmodify":"thu may 17 16:25:59 2012", "starttime":"wed may 30 14:40:23 2012", "numcores":"48", "sizet":{"bss":"136","text":"4455504","data":"103440"}}], i ideally new file formatted follows 2595272 lmp_taac what best , easiest way accomplish this? not programmer need as can get. thanks.

sharepoint - Team separation in TFS but share projects? -

i'm new tfs , we're loving it! i'm having difficult time figuring out how best organize tfs version control , agile/scrum/sharepoint sites, keeping isolation of teams yet sharing of code , projects. for scenario let's have 3 teams. team 1, 2, 3. want each team have access projects work on, , each team have isolation alerts , notifications, sharepoint, agile, etc. let's there 5 total projects. team 1: --project 1 --project 2 team 2: --project 1 --project 4 --project 5 team: 3: --project 1 --project 2 --project 3 --project 4 we have 1 collection setup, defaultcollection. right have 1 team doesn't give isolation , separation of features. how can best configure tfs keep separation of teams not have separate code projects? projects shared , point of contention - don't know how handle part. acme widget has x projects , have "company shared" x projects. may working on different products such acme widget 1, 2, 3 share , work on compan

python - Pandas: change data type of columns -

i want convert table, represented list of lists, pandas dataframe. extremely simplified example: a = [['a', '1.2', '4.2'], ['b', '70', '0.03'], ['x', '5', '0']] df = pd.dataframe(a) what best way convert columns appropriate types, in case columns 2 , 3 floats? there way specify types while converting dataframe? or better create dataframe first , loop through columns change type each column? ideally in dynamic way because there can hundreds of columns , don't want specify columns of type. can guarantee each columns contains values of same type. you can use pd.to_numeric (introduced in version 0.17) convert column or series numeric type. function can applied on multiple columns of dataframe using apply . importantly, function takes errors key word argument lets force not-numeric values nan , or ignore columns containing these values. example uses shown below. individual column / series

java - Removing duplicates from one list by comparing with another list -

i have 2 lists of objects , remove instances 1 list there in other list. e.g. have following 2 lists , suppose each letter represents object. list lista = {a, b, c , d, e, f, g, h , , j} list listb= {d, g, k, p, z} now, listb has d , g there on lista want lista lista = {a, b, c , e, f, h , , j} can guys please suggest solution o(n) or less o(n2). i can iterate on both lists , remove duplicate instances comparing want have more efficient. if lists unsorted, , arraylists or other similar list implementations o(n) contains method, should create hashset items of listb in order perform removal. if items not put set end o(n^2) performance. easiest way need thus: lista.removeall(new hashset(listb)); arraylist.removeall(collection) not put items set (at least in jdk 1.6 , 1.7 versions checked), why need create hashset in above. the removeall method copy items wish keep beginning of list traverses it, avoiding array compacting each removal, using against pas

image - Java ImageIO.write to classpath? -

i trying use imageio class save image , resource using input stream. problem keep getting nullpointerexception whenever try create input stream. if go , put image file in class path, works. here code: imageio.write(image, "png", new file("temp.png")); inputstream imgis = aptcap.class.getresourceasstream("temp.png"); byte[] imgdata = new byte[imgis.available()]; // null here. i have tried specifying direct locations files on c drive both of them, still null pointer exception. rather not anyway, keep in classpath (for purposes of multi os support). bytearrayoutputstream baos = new bytearrayoutputstream(); // create outputstream imageio.write(image, "png", baos); // write os inputstream imgis = new bytearrayinputstream(baos.tobytearray()); // grab bytes os //..

Undefined Method in Picture Controller -

warning, i'm newb , trying learn ror on own. been doing tutorials etc , trying learn through experience. long story short i'm trying attach user picture url defined them, default pic if don't supply one. been running kinds of errors, think have down 1 primary issue after hours of trying figure out (since i'm new @ this). right error i'm getting is: nomethoderror in gravscontroller#update undefined method `update_attributes' nil:nilclass i know means need like: @something = model.new/build(params[:method]) but don't know define in controller (i'm guessing gravs_controller right?) here's code, tear apart , see if can me image function working, please :) class gravscontroller < applicationcontroller before_filter :signed_in_user gravs_controller def create @graver = current_user.gravs.new(params[:content]) @grav_bool = false if @graver.save @grav_bool = true @grav_bool.save flash[:

regex - sed path parsing is not working -

pwd | sed "s%^\(/[^/]*/\).*?\(/[^/]+\)$%\1...\2%" i not sure why not work. have tried both greedy , non greedy star after first capture group. not using lookaheads or anything. works in regex testers. i'm trying grab first , last text-part of path (to squish while still providing idea of dir i'm in). this tmux prompt line i'm kind of trying avoid bringing in heavyweight perl job. why not use parameter expansions ? parameter expansions cost way less processing power command, pipe , external command have there: start="${pwd#/}"; start="${start%%/*}" end="${pwd/*\//}" printf '/%s/…/%s $ ' "$start" "$end"

shadowing - Process crashes on second message in Erlang -

i have simple car process implemented in erlang: -module(cars). -compile(export_all). -record(state, {count=1}). make_car() -> spawn_link(fun() -> car_proc(#state{}) end). car_proc(s) -> receive {idle, x} -> io:format("idling ~p second(s)~n", [x]), timer:sleep(x*1000); {move, {x,y}} -> io:format("move; x=~p, y=~p~n", [x,y]); {stop, reason} -> x = s#state.count, io:format("stopped count ~p because ~p~n", [x+1, reason]) end, x = s#state.count, car_proc(s#state{count=x+1}). i can make idle, if call idle twice in row, breaks: 59> c = cars:make_car(). <0.207.0> 60> c!{idle,1}. idling 1 second(s) {idle,1} 61> c!{idle,1}. idling 1 second(s) {idle,1} 62> =error report==== 9-apr-2013::00:00:00 === error in process <0.207.0> exit value: {{badmatch,2},[{cars,car_proc,1,[{file,"cars.erl&quo

HTML Help: How do I make the width of an image fit the entire container -

i want banner image fit white container instead of go on side right, can't seem ignore margin on left. i've tried know; max-width setting margin @ 0px nothing works. this code have: <p style="text-align: center;" dir="ltr"> <img class="aligncenter size-full wp-image-504" title="bannercommunity" src="image.png" alt="" width="960" height="140" /> </p> any , appreciated, thanks! you can add width: 100% <img> . note having browser resize images inefficient, should avoid if can , resize image correct size want use instead.

php - Correct way to fetch posts which are posted 3 days ago? -

my data has column named "date" includes post dates in unix date format. using query fetch posts posted 3 days ago $result=mysql_query("select * track from_unixtime(date,'%y-%m-%d %h:%m:%s') > now() - interval 3 day , from_unixtime(date,'%y-%m-%d %h:%m:%s') < now() - interval 2 day"); this works, however, selects posts date in range of -48 hours , -72 hours. want fetch posts day names. mean, example if post added 40 hours ago, not theorically 48 hours (2 days) if @ day name, 2 days ago. how can fetch posts ? select * track from_unixtime(date,'%y-%m-%d') = curdate() - interval 2 day

System.DirectoryServices produces .PageRequestManagerServerErrorException when deployed in production -

i getting error message: sys.webforms.pagerequestmanagerservererrorexception: unknown error occurred while processing request on server. status code returned server was: 500 when running application in iis. i think system.directory.services produces eror. not produce 1 on local machine. below snippet of code. string[] = request.requestcontext.httpcontext.user.identity.name.split('\\'); system.directoryservices.directoryentry adentry = new system.directoryservices.directoryentry("winnt://" + a[0] + "/" + a[1]); string arranger = adentry.properties["fullname"].value.tostring(); error produced: message: sys.webforms.pagerequestmanagerservererrorexception: unknown error occurred while processing request on server. status code returned server was: 500 line: 940 char: 13 code: 0 uri: http://hrmd/scriptresource.axd? d=qotxfiehqnpsyvjbhkkk60v8kyvgjujo4u_qpocxnkdwp8h53opf6xwrybsvhraj1rwb7mwhq0uuukoxxzp-__efny8u9hnsn9h4tg_rigg5a2mr

android - When writing a mobile app, is there way to have the app automatically download another specified app? -

i have idea mobile app (call app) use qr codes. won't go details, because of way implemented, huge, huge benefit user not have install app plus qr scanning app. crap download. before decide invest anymore thought idea, i'd know whether or not possible have installation code following: user downloads app app checks see if qr scanner given list of possible scanners on user's phone. if yes: nothing else: download , install qr scanner (after prompting user) i have 0 experience mobile apps, either in development or usage, sorry if stupid question. while there no mechanism install 1 application (besides loading appropriate app store), can use free (apache license 2.0) library, zxing , embed qr code processing ios and/or android application.

Linkers and Loaders for Objective-C -

i came across john levine's book "linkers , loaders." book written in year 2000. if has read book, author says still relevant objective-c in year 2013? asking, because looks book have on shelf, if info out of date don't want study book. thanks! yes & no... i don't know specific book, if up-to-date in 2000 material in should still valid learn how things work under hood. however , not need know linking , loading understand variables , pointers. nor need understand symbol tables such. symbol table data structure used compilers track variables during compilation part of translating program code write instructions cpu understands. the concepts of variables , pointers in programming languages abstractions of concepts of memory locations , memory addresses @ cpu level (which in sense abstractions of lower-level stuff, ending circuits and, if dig deep enough, electrons! ;-)) what should looking book on programming language concepts rather

ruby on rails - Accessing properties with has_many :though -

in below code have 2 models associated via has_many :through . component model belongs_to category model. i'm trying access category.title property collection though component like: @collection.components[:id].category.title in below code ":components" puts: [#<component id: 23, name: "l-shaped-desks", title: "l-shaped desks", category_id: 10, created_at: "2013-04-07 00:18:07", updated_at: "2013-04-07 00:18:07">, #<component id: 25, name: "writing-tables", title: "writing tables", category_id: 10, created_at: "2013-04-07 00:18:29", updated_at: "2013-04-07 00:18:29">] where each "#<component>" 1 checked form generated check boxes. the problem can't figure out how access information. i've tried :components[0].category.title error: undefined method `category' :components:symbol _form.html.haml = form_for @collection |f| - if @coll

.net - User settings/configuration with impersonation -

is possible configurationmanager.openexeconfiguration use impersonated user (when impersonation being done similar code sample windowsimpersonationcontext ) - following being small extract? using (safetokenhandle) { console.writeline("did logonuser succeed? " + (returnvalue ? "yes" : "no")); console.writeline("value of windows nt token: " + safetokenhandle); // check identity. console.writeline("before impersonation: " + windowsidentity.getcurrent().name); configuration config; //config = configurationmanager.openexeconfiguration(configurationuserlevel.peruserroamingandlocal); //console.writeline("local user config path: {0}", config.filepath); // use token handle returned logonuser. using (windowsidentity newid = new windowsidentity(safetokenhandle.dangerousgethandle())) { using (windowsimpersonationcontext impersonateduser = newid.impersonate()) {

javascript - Get parameter of template in Play Framework -

i have template parameter : @(people: list[models.person]) <html> <head> </head> <body> <table class="centered" id="table_people"> <thead> <tr class="table_header"> <th></th> <th class="people_column">name</th> <th class="people_column">active</th> </tr> </thead> <tbody> @for(p <- people) { <tr> <td><button id="timesheet_view_" >view</button</td> <td><b>@p.getname()</b></td> <td>@p.isactive()</td> </tr> } </tbody> </table> that code shows list of people. , now, wanna when click on button view, shows information of people. that, have write that: <script> $( "#timesheet_view_<%= people[i].id %>" ) .

navigationbar - Drop-down menu in CSS -

i trying build drop-down multi-level navigation menu bar in pure css. here code (i know turns out ugly): <!doctype html> <html> <head> <title>menu</title> <style> * { margin: 0; padding: 0 } ul { list-style: none } li { float: left; width: 120px; height: 20px; background: pink } li > ul { display: none } li:hover > ul { display: block; position: relative; top: -20px; left: 120px; background: red } #nav > li:hover > ul { top: 0px; left: 0px } li:hover { background: red } </style> </head> <body> <ul id="nav"> <li>1 <ul> <li>1.1 <ul> <li>1.1.1 <ul> <li>1.1.1.1</li> <li>1.1.1.2</li> <li>1.1.1.3</li> <li>1.1.1.4</li> </ul> </li> <li>1.1.2</li> <li>1.1.3</li&

javascript - limit checkbox and uncheck after changing tab -

i trying show , hide divs select tag. in divs there check boxes has logic of disabling them after user checked 2. when changing divs checkboxes staying disabled. reason max 2 checkbox logic disabling checkboxes. here fiddle http://jsfiddle.net/sghoush1/yjcyw/ the jquery looks $('.selectoption').change(function(){ $('.desccontent').hide().eq(this.selectedindex).show(); $('.resourcemsg').hide(); }); var max = 2; var checkboxes = $('input[type="checkbox"]'); checkboxes.change(function(){ var current = checkboxes.filter(':checked').length; checkboxes.filter(':not(:checked)').prop('disabled', current >= max); if(current >= max){ $('.resourcemsg').show(); } else{ $('.resourcemsg').hide(); } }); just uncheck checkboxes , set disabled property false whenever select element changed: $

c# - Is it possible to track all outgoing WCF call? -

our application calls external services like //in client factory fooserviceclient client = new fooserviceclient(binding, endpointaddress); //in application code client.barmethod(); //or other methods is possible track of these calls (e.g events or that) application can collect statistics number of call, response time, etc? note application needs access values, not write log file. what can think create subclass of visualstudio-generated fooserviceclient , add codes this override void barmethod() { raisestart("barmethod"); base.barmethod(); raiseend("barmethod); } and raisestart , raiseend method raise events listened code. but seems tedious (because there lot of methods override) , there lot of repeated codes, code needs change everytime service contract changes, etc. there simpler way achieve this, example using reflection create subclass or tapping built-in method in wcf, if any? the first thing @ see if counters available in server

android - How to trigger bulk mode scan in zxing -

i read there key enable bulk mode scan in zxing. may know how enable key in android application? i using such codes scan barcode individually: intent intent = new intent("com.google.zxing.client.android.scan"); intent.putextra("scan_formats", "product_mode,code_39,code_93,code_128,data_matrix,itf"); startactivityforresult(intent, 0); // start scan thanks! there no concept of "bulk mode" within zxing don't think. you can implement behavior looking though zxing inside own application. use code have in question kick of scanning first time. add declaration class: arraylist<string> results; then add inside oncreate before start scanning initialize it: results = new arraylist<string>(); inside onactivityresult() can add current result arraylist , start next scan. /*here come after barcode scanner done*/ public void onactivityresult(int requestcode, int resultcode, intent intent) { if (requestcode ==

dataset - .rdlc report in c# does not display any output data? -

my friends im using visual studio 2008,and develop small project in c# , want add reports in ,(.rdlc reports) . here code try { reportviewer1.reset(); con.open(); command.connection = con; command.commandtype = commandtype.storedprocedure; command.commandtext = "select_book_specific"; param = new sqlparameter("@isbn", "isbn1"); param.direction = parameterdirection.input; param.dbtype = dbtype.string; command.parameters.add(param); adapter = new sqldataadapter(command); adapter.fill(ds); // (int = 0; <= ds.tables[0].columns.count - 1; i++) // { // messagebox.show(ds.tables[0].rows[0][i].tostring()); //} testing purpose this.reportviewer1.localreport.reportpath = @"c:\documents , settings\administrator\my documents\visual studio 2008\projec

jquery - Any Known IE10 JavaScript Quirks? -

apologies in advance vagueness of question. i'm going list detail know problem, admittedly not much. perplexing. background: have developed large app entirely js. passes linting (jslint , jshint) on strict settings. works in: ie7 ie8 ie9 mozilla firefox 3.5+ safari (whatever latest on os x... , pretty far back) chrome (all versions) however in ie10, 1 part of app fails work @ all. strange thing is, throws no errors whatsoever ie10 developer console. no errors thrown in firebug or chrome inspector matter either, not surprisingly since works fine in browsers. after code passed linting, took going on line line manually , didn't see out of order. i'm wondering if there known quirks ie10 javascript engine? googling , searching on yielded little information beyond extremely specific things i've checked app for. i provide code sample... reasonably large file dedicated piece of functionality isn't working (note app modular, 95% of works). i considerin

javascript - Object cannot access JS constructor function -

i new js. learning js oop's concepts. trying use constructor create private variables in js. when try access values using getters, error 'typeerror: 'undefined' not function ' function card(n,s) { var number = n; var suit = s; //getters var getnumber = function(){ return this.number; }; var getsuit = function(){ return this.suit; }; } var test = new card(10, 1); test.getnumber(); i not able figure out error might be. need on this. because did not attach functions this , points instance of constructor. properties , functions attached this "public" properties , methods in classical oop. also, variables number , suit live inside instance not properties of instance. cannot accessed via this because didn't attach them. act "private variables" in classical oop. but since getters in same scope (the constructor card ) variables, have access them, "getters" , "

ios - Assign HTML tag string in NSstring for UIweb view -

how assign html tag string format string directly, can display in uiweb view directly. <tr> <td align="center"><b> disclaimer</b></td> </tr> <tr> <td colspan="2" style="text-align:justify" class="imageborder"> <p> personal trainer endeavor bhasinsoft provide in depth details , knowledge on exercises , workout regimes work towards health , fit body. while great care has been taken provide accurate knowledge , details possible referring knowledge in public domain, guidance fitness specialists , doctors, bhasinsoft not responsible accuracy of data. data provided , understand bhasinsoft not responsible accuracy, usefulness or safety resulting use of content. further understand , acknowledge may exposed content inaccurate, offensive, indecent, or objectionable, , agree waive, , hereby waive, legal or equitable rights or remedies have or may have against bhasinso

C++ Primer Exercise -

i started learn c++ , , come across 2 exercises in c++ primer . 1 of exercises can't understand . exercise 2.22 c++ primer assuming p pointer int ,explain following code: if (p) //.... if (*p) //.... as understand in 1 statement checking condition of pointer p whether true or false in 2 statement actions same except time use dereference operator if i'm wrong, can tell me mistake. and next exercise ,this exercise cant understand exercise 2.23 given pointer p ,can determine whether p points valid object ? if so, how? if not , why not? the thing know when variable initialized , have same type pointer might know pointer points valid object. , trying access invalid pointer can bring code problem , compiler ant find problem. there else exercise can added ? or guessing wrong ? thank time ! assuming int *p = null; then: if (p) checks whether p null or not , return false. if (*p) checks whether (*p) == 0 , i.e. integer pointed p 0 or

jquery - Custom Javascript Won't Run in Joomla -

i using joomla-3 websites , have created simple small javascript(ajax) file attached through template config file(as seen on template's documentation). i added html in article(without tinymce etc know accepts code). script works fine in simple .html or .php file doesn't work along joomla . my script has 2 dependent ajax dropdown menus(static content). have ideas on go wrong? thank in advance! ps. can find code of javascript here . here's code: $(window).load(function () { var services = []; services['service1'] = [{ "name": "giannis", "url": "giannis" }, { "name": "kostas", "url": "kostas" }, { "name": "fillipos", "url": "fillipos" } ]; services['service2'] = [{ "name": "maria", "url": "maria" }, { &q

one to many - what hibernate parameters should i use? -

i have table device has unique id of deviceid. have second table called deviceinfo primary key sequence deviceinfoseq info table has deviceid field foreign key pointing device. in device hbm have following deviceinfo <?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-mapping public "-//hibernate/hibernate mapping dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping default-lazy="true" package="com.xxx.xxx.xxx"> <class name="device" table="device" dynamic-update="true"> <id name="dstring" column="deviceid" type="java.lang.string" unsaved-value="null" length="9"> <generator class="assigned"/> </id> .... <many-to-one name="deviceinfo" class="deviceinfo" outer-join="true" foreign-key

autorun - How to run C .exe file in auto run by USB? -

i have c program(i.e .exe) , want execute program through usb in auto run mode, when usb on file should run . make auto run file i.e autorun.inf .inside auto run file content [autorun] action=v1.exe open=v1.exe but not working . what operating system using? thought auto run disabled in windows 7. see : http://blogs.technet.com/b/srd/archive/2009/04/28/autorun-changes-in-windows-7.aspx

testing - Laravel Artisan Error 'LARAVEL_ENV' is not recognized as an internal or external command -

for life of me cannot work 1 out, fresh laravel install ontop of wamp (win7 64) appropriate path variables added etc , arisan responding if run "php artisan test" get: 'laravel_env' not recognized internal or external command, operable program or batch file. ideas? see commit, breaks functionality in windows: https://github.com/laravel/laravel/commit/4046313ecd4934e09a621ee930ee31f88262475e a solution given in forum oli change code in runner.php: protected function test() { ... putenv('laravel_env='.request::env()); passthru('phpunit --configuration '.$esc_path, $status); ... } you should able use php artisan --env=test test again

java - Passing parameters to resource using embedded Jetty -

i have resource want expose has constructor parameters injection. i'm not using injection framework, , i've got jetty embedded. right jetty scans resources this: servletcontexthandler servletcontexthandler = new servletcontexthandler(server, "/server"); servletholder jerseyservletholder = new servletholder(servletcontainer.class); jerseyservletholder.setinitparameter("com.sun.jersey.config.property.packages", "my.package.to.scan"); servletcontexthandler.addservlet(jerseyservletholder, "/*"); but prevents me injecting in constructor, have use default constructor. i'd specify own instance pass resource constructor. there way instantiate resource manually , add servlet container? is possible : myrestresource resource = new myrestresource(param1, param2); servletcontexthandler.addservlet(resource); or that? if myrestresource servlet , can use existing servlet holder constructor . servletcontexthandler servlet

javascript - How to redirect page when user close tab or window -

sorry if question exists search don't want when user close window show him message we've special offer , if says yes redirect page otherwise close window but what's happening showing alert not on closing tab when going other same website link also. here's code : <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> window.onbeforeunload = function() { alert('1'); }; $(document).ready(function() { $('a').click(function() { window.onbeforeunload = null; }); $('form').submit(function() { window.onbeforeunload = null; }); }); </script>

linux - C TUI Developement - Help / Tutorials? -

i have been looking through previous questions regarding topic , far none of them answer question. looking way (without libraries) build own tui ground up. want start off simple program reads directory , displays contents ability use arrow keys move , down highlighting 1 item. simple may seem need started on rest of project. all need point me in right direction clearing , printing screen , not using print statement or external library. appreciated. well, honest, can. others tell you, curses right tool job. that said, isn't 80s anymore. <overgeneralization>everybody uses xterm.</overgeneralization> xterm uses ansi vt100 control codes, mimicking classic dec vt-100 . if target this, should reasonably ok , portable. but curses nice. lot of hard work (and there's plenty of hard work left keep busy).

coffeescript - Chain function call after function definition -

this question has answer here: ember computed properties in coffeescript 3 answers how can chain function call after function definition in coffeescript? equivalent javascript be: var foo = function () { // stuff }.bar() the way managed is: foo = `function () { // stuff }.bar()` but hope better solution embedding javascript in (beautiful) coffeescript code try this: foo = (-> stuff).bar() for example: square = ((x)-> x*x).bar() compiles into: var square; square = (function(x) { return x * x; }).bar();

javascript - Open email popup on enter key hit on email address -

i have email address shown on screen on user can click , outlook mail instance opened (used simple <a mailto:/> ). however, user can use tab sequence come on email address , press enter. want open outlook mail instance in similar fashion on it. how can it? <a href="" onkeypress="check()"> function check(e) { if (!e) e = window.event; // resolve event instance if (e.keycode == '13') { //your code opening outlook } }

entity framework - How to get column names from database? -

i'm working entity framework. there method column names of table database? i want display column names in database. not directly entity framework, far know - can execute standard t-sql query against catalog views: select columnname = c.name, schemaname = s.name, tablename = t.name sys.columns c inner join sys.tables t on c.object_id = t.object_id inner join sys.schemas s on t.schema_id = s.schema_id this give columns, along schema , table they're part of, current sql server database.

asp.net mvc 4 - How can I make my ViewModel map to my actual Model? -

i have tab in application, upon clicking which, user's details displayed (using placeholder html attribute) him inside editable text-boxes. user can view them or can edit whichever detail wants to. now question is: should create view model class scenario or should use actual account model class? guess have create view model class require 'some' properties account model class, if so, how make 'editable' , subsequently, map edited properties(if any) actual account model class? also, please tell me need store view model class if need create one. should create view model class scenario or should use actual account model class? yes, it's best create model represents action need , prevent under , on posting. work on properties expect users work on. example, if have accountmodel has lot of properties , need work on ten of on add action , 5 of properties on edit action, create 2 viewmodels: // model or entity public class accountmodel {

ruby on rails - superclass mismatch for class CommentsController (TypeError), best way to rename? -

i ran problem tonight while deploying , i'm trying fixed asap i have no idea why happening. works fine locally not on heroku. tried sorts of different fixes after researching may have resort renaming class commentscontroller (hopefully works). best way go that? i'm pretty new rails need on making these changing correctly. here's commentscontroller looks fyi: class commentscontroller < applicationcontroller def new @post = post.new(params[:post]) end def show @comment = comment.find(params[:id]) respond_to |format| format.js end end def create @post = post.find(params[:post_id]) @comment = comment.new(params[:comment]) @comment.micropost = @post @comment.user = current_user if @comment.save redirect_to(:back) else render partial: 'shared/_comment_form', locals: { post: @post } end end end comments associated each post (users able comment on posts). post other codes if needed.

mobile - DLNA versus APIPA -

i notice in mobile phone wifi settings, there dlna auto-ip option that's checked. description : " check use dlna when no dhcp server available ", i found that's something same apipa mechanism: " with apipa (automatic private ip addressing), dhcp clients can automatically self-configure ip address , subnet mask when dhcp server isn't available. " what's dlna meant here , differences between dlna , apipa? due dlna specification, have support auto-ip when there no dhcp server. "dhcpcd" used android , supports auto-ip, there 2 designs inside framework make auto-ip not available. 1. wireless manager timeout same default dhcp discover timeout.(30s) 2. dhcpcd set failed property when auto-ip we have tried following methods modify dhcpcd. 1. using property system a. when dlna on, set property note status. b. dhcpcd reads status property. when status on, set default dhcp discover timeout 10s. c. script reads status property. wh

Python: Output a numbered variable every time a function is called? -

i'm using turtle show sorter. have number sorting working fine working on sorting bars. know if there's way assign output of function variable each time called. more specifically, want able assign each separate bar variable, , put bar variables list , sort simultaneously numbers nums. i'm making sense. appreciated. nums=[30,60,90] ##sorted list draw(): ##draws bar based on height of number in list t.fd(5) t.lt(90) t.fd(nums[i]) t.lt(90) t.fd(5) t.lt(90) t.fd(nums[i]) t.lt(90) t.pu() t.fd(50) t.pd() in range(len(nums)): ##draws lines in list draw() do mean this: def draw(num): ##draws bar based on height of number in list t.fd(5) t.lt(90) t.fd(num) t.lt(90) t.fd(5) t.lt(90) t.fd(num) t.lt(90) t.pu # typo? t.fd(50) t.pd() nums=[30,60,90] ##sorted list num in nums: draw(num) if not, please give example of you're trying achieve.

c# - Store an entity in a hidden field of a parent page and access the hidden field entity value in child page? -

in our project, there requirement avoid session , view state. in parent page, there filter option done search criteria entity. have keep search criteria entity value of parent page , pass popup(child page). you can pass value query string.

mysql - Having problems with a Gambling Application on my website (PHP) -

i'm trying make section of website support gambling (with game money, not irl) goal: create simple buy ticket, wait tickets gone, randomly select winner. end user can buy amount of tickets left total of 8 available tickets , script choose winner out of number of applicants bought ticket. current issue: main issue having problems php storing , retrieving data. <form action="games.php" method"post" name="add_tickets"> <ul> <li> <input type="radio" name="ticket" value="one"><br> <input type="radio" name="ticket" value="two"><br> <input type="radio" name="ticket" value="three"><br> <input type="radio" name="ticket" value="four"><br> <input type="submit" value="submit"> </li> </ul> </form> so i'm using radio buttons

xaml - How to use x:Uid in windows phone 8? -

we can use x:uid in windows-8 as where in .resw have define maintitle.text = "your name" in way textblock 's text becomes your name . how can achieve same in windows phone 8? when put maintitle.text in .resx gives error. you have use binding in windows phone 8. the simple way see in action create new project , take @ mainpage.xaml. binding demonstrated in following comment for example: text="{binding path=localizedresources.applicationtitle, source={staticresource localizedstrings}}" to localize text, bind localizedstrings class (created project) wraps static resource file. <textblock text="{binding path=localizedresources.applicationtitle, source={staticresource localizedstrings}}" /> the localizedstrings resource there in app.xaml <local:localizedstrings x:key="localizedstrings"/>

Hibernate CacheException -

i try create , fill database of hibernate. my hibernate-config: <?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.url"> jdbc:h2:c:\users\data\datastore </property> <property name="connection.username">admin</property> <property name="connection.password">admin</property> <property name="connection.driver_class">org.h2.driver</property> <property name="dialect">org.hibernate.dialect.h2dialect</property> <property name="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.ehcacheregionfactory</property> <property