Posts

c# - SyntaxError: JSON.parse: unexpected character error unexpected token < -

i have html button "button-account" name in html body , want update aspx page ajax when user click button i error in google chrom syntaxerror: json.parse: unexpected character and in fire fox syntaxerror: json.parse: unexpected character here's code <script type="text/javascript" > $(document).ready(function () { $("#button-account").bind("click", "accountregister"); function accountregister() { var waitobj = "<span class='wait' > <img src='resource/images/loading.gif' alt='' /> </span>"; var user = $("[name='username']").val(); var pass = $("[name='password']").val(); var dataobj = { "username": user, "password": pass, }; $.ajax({ type: "post", ...

Hadoop HDFS connection in PowerCenter -

i have installed cloudera's hadoop quickstart vm , attempting pass records local database hdfs using powercenter mapping. i've set hadoop_hdfs_connection in powercenter workflow manager when run workflow following error: "unable establish connection specified hdfs host". gives "java.net.connectionexception" error when trying connect host name , port. think error may in hostname notation. on cloudera manager on vm, host name listed 'localhost.localdomain' don't know how translate in powercenter connection settings. anybody got connection work? many thanks. brian

Python XML XPath partial failure message -

in code maintain there's xml parsing using minidom library. for xml structure similar below: <a val="a1"> <b val="b1"> <c val="c1"> data </c> </b> </a> code looks like: for in doc.getelementsbytagname("a"): aid = a.getattribute("val").encode('ascii') if aid == aexpected: afound = break else: # not found raise exception("no '%s' found" % aexpected) b in afound.getelementsbytagname("b"): bid = b.getattribute("val").encode('ascii') if bid == bexpected: bfound = b break else: # not found raise exception("no b '%s' found" % bexpected) # similar c i wanted use xpath data. can (elementtree): root.findall(".//a[@val=%s]/b[@val=%s]/c[@val=%s]" % (aexpected, bexpected, cexpected)) the code looks nicer now. but, when no data can found in...

sql - @ Symbol - a solution for Recursive SELECT query in Mysql? -

there lot of questions recursive select query in mysql, of answers "there no solution recursive select query in mysql". actually there solution & want know clearly, question following of previous question can found @ ( how-to-do-the-recursive-select-query-in-mysql ) suppose have table: col1 - col2 - col3 1 - - 5 5 - d - 3 3 - k - 7 6 - o - 2 2 - 0 - 8 & want find links connect value "1" in col1, i.e. want print out: 1 - - 5 5 - d - 3 3 - k - 7 then can use simple query: select col1, col2, @pv:=col3 'col3' table1 join (select @pv:=1)tmp col1=@pv ok, good, however, if table has 2 records containing "1" in col1 & 2 records containing "3" in col1, ex: col1 - col2 - col3 1 - - 5 1 - m - 9 5 - d - 3 3 - k - 7 6 - o - 2 3 - v - 10 2 - 0 - 8 then, when users search "1" in col1, should show links connecting 2 "1...

android - How to present keyboard and not shrink background image in layout -

i have scroll view , inside there layout out. inside layout have included form (basically textfields , textviews) when in runtime. if press on textfield keyboard appear tottaly normal. there problem background image has been shrinked. is there way avoid it. background image shouldn't shrink you have change manifest file in activity tag android:windowsoftinputmode="adjustpan" add this. see http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

postgresql - Rails Article.find 1 raises ActiveRecord::StatementInvalid on legacy database -

i'm creating rails app on legacy database table. works fine locally, on server hit error whenever article.find(1) could not log "sql.active_record" event. nomethoderror: undefined method `name' nil:nilclass activerecord::statementinvalid: pg::error: error: zero-length delimited identifier @ or near """" line 1: select "articles".* "articles" "articles"."" = $1 limit 1 the legacy database has id field, schema describes id with create_table "articles", :id => false, :force => true |t| t.decimal "id", :precision => 10, :scale => 0, :null => false ... note article.find_by_id(1) returns record without problem. any ideas how fix this? updated - see below it turns out, adding following model fixes this: class article < activerecord::base set_primary_key :id ... presumably, because rails didn't create table, doesn't know field pr...

C implicit extern for global variable, when does it happen, how does it work -

i'm trying understand ways in c global variable can shared between multiple files (compilation units). i've read excellent question , answer here . after doing few tests i'm still left stuff don't get: basically question be: if there's variable declared (but not defined) in header without extern keyword, ok include header in various compilation units in order make available variable compilation units? in scenario it's implied 1 (and one) compilation unit contains code initializing (defining?) variable, , called first before other compilation units try variable. if true, procedure what's called "implicit extern" ? i'll illustrate question example: header "mycommonheader.h" contains: //mycommonheader.h int* i; //pointer int file myfirstheader.h contains: //myfirstheader.h void changeit(int newvalue); file myfirstsource.c contains: //myfirstsource.c #include "myfirstheader.h" void changeit(int newvalue) {...