Posts

Showing posts from February, 2011

javascript - setting/getting/checking multiple cookies generated by user-input (textboxes) in one go -

i'm bashing head against wall , hoping can help. i've got include 3 text boxes users enter values following cookies: name, city, , hobby. need use single button onclick event call function create 3 cookies (with values). need further function check existence of each cookie when page accessed. if 1 or more of cookies not set, alert box should notify user set unset cookie(s). if 3 cookies set, alert box should display contents of each cookie. where hung (i think) on how pass value textbox , corresponding key arguments generic setcookie function. w3schools gives code template creating, getting , checking cookies (below) i've no idea how implement setting cookies via user-input or setting 3 @ once! thick brick, seems. my html textboxes , submit button: please enter name: <input type = "text" name = "name" id = "name"> <br> please enter city: <input type = "text" name = "city" id = ...

web scraping - Python web scrape with Beautiful Soup -

i able scrape sites tables no issue; however, access tables customize need login first scrape because if not default output. feel close, relatively new python. looking forward learning more mechanize , beautifulsoup. it seems logging in correctly due fact "incorrect password" error if purposely enter wrong password below, how connect login url want scrape? from bs4 import beautifulsoup import urllib import csv import mechanize import cookielib cj = cookielib.cookiejar() br = mechanize.browser() br.set_cookiejar(cj) br.open("http://www.barchart.com/login.php") br.select_form(nr=0) br.form['email'] = 'username' br.form['password'] = 'password' br.submit() #print br.response().read() r = urllib.urlopen("http://www.barchart.com/stocks/sp500.php?view=49530&_dtp1=0").read() soup = beautifulsoup(r, "html.parser") tables = soup.find("table", attrs={"class" : "datatable ajax"}...

events - How to properly block code execution in Python? -

i need block execution of greenlet till condition occurs, following: ... while not some_condition: gevent.sleep(0.00000000000001) ... this approach cpu intensive. if change gevent.sleep(0.000000000001) gevent.sleep(0.1) , cpu usage drops 1/10. time, in worst case scenario, code continue execution 0.1 seconds after some_condition occurs, not right after. so, how can make greenlet pause execution until condition occurs? using gevent.event.event solved problem: http://www.gevent.org/gevent.event.html

Display Popup Using Javascript After This Div is VIsible -

i want display "share popup" when specific div appears. using embedded quiz on website user has answer multiple choice questions gets result. result div class called result_screen_container . i have popup it's written triggered time. want trigger when result there after questions finished. #popup_box { display:none; position:fixed; _position:absolute; left: 50%; top: 50%; z-index:10001; background:#fff; box-shadow: 0px 0px 15px #000; border-radius: 8px; } #popup_box .inner1 { text-align: center; padding:0 40px; color:#000; padding:20px; } #popupboxclose { font-size:0; right:-22px; top:-14px; position:absolute; cursor: pointer; width: 38px; height: 37px; display: block; } /* popup ends */ #fbshare{width:275px;height: auto;overflow: hidden;} .inner-fbshare{width:275px;overflow: hidden;} .inner-fbshare h3{font-size: 19px;margin: 0 0 10px 0;} .inner-f...

ruby - Rails - How do I change any key that has a string for a value in a hash into arrays -

i have following form <% if (current_user.mod_of_game?(@guide) unless current_user.nil?) %> <%= form_for([@category, @page], url: update_pages_path) |f| %> <%= render 'shared/error_messages', object: f.object %> <%= select_tag 'content[key1]', options_for_select(['atk', 'def', 'hp', 'sing'], 'atk' ), { :multiple => true} %> <%= select_tag 'content[key2]', options_for_select(['atk', 'def', 'hp', 'sing'], 'atk' ), { :multiple => true} %> <%= select_tag 'content[key3]', options_for_select(['atk', 'def', 'hp', 'sing'], 'atk' ), { :multiple => true} %> <%= select_tag 'content[key4]', options_for_select(['atk', 'def', 'hp', 'sing'], 'atk' ), { :multiple => true} %> <%= f.submit "save" ...

javascript - Get back initial content of array -

i have function wich deletes elements array,is there way initial content of array when there no elements in ? know have use if(array.length=0){ } but beats me put inside curly braces.i've tried create array duplicate first one,and after implementing function assigning empty array duplicated one,but didn't work if want copy of array need called deep copy. var = [11,22,33,44,55,66,77,88,99]; var a_copy = a; var a_backup = []; console.log("original length = " + a.length) for(var = 0;i<a.length;i++){ a_backup[i] = a[i]; } for(var = 0;i<a.length;i++){ a[i] = undefined; } console.log("original = " + a.join(",")) console.log("copy = " + a_copy.join(",")) console.log("backup = " + a_backup.join(",")) console.log("original length = " + a.length) for(var = 0;i<a_backup.length;i++){ a[i] = a_backup[i]; } console.log("restored = " + a.join(","))...

java - Spring web MVC Hibernate File upload error -

i making spring project trying upload image editprofile.jsp <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <table> <tr> <td> <form:form action="${pagecontext.request.contextpath}/editprofilehandler" method="post" modelattribute="userform" enctype="multipart/form-data"> <table> <tr> <td> first name : </td> <td> <form:input path="firstname" value="${userdetails[0].firstname }" /> <form:errors path="firstname" class="error" /> </td> </tr> <tr> <t...

javascript - css show button over image -

i making simple reactjs app need put button on image. html looks like: <div classname={"panel-body"}> <img classname={"img-responsive center-block"} src={album.photos.data[0].source} /> {(this.state.ismouseinsideid === album.id) ? <button>your button</button> : null} </div> its fine except button shown below image. want show button on image or in middle of div how can make work ? make button position relative , use z-index: maybe helpful you.

parsing - Solaris/UNIX passing "$*" to compiled java -

i having strange issue passing "$*" java compiled program. program not parse variables when pass following command line: /export/home/checkout>/tmp/jsnmp.sh -f noc2 -t 4,4 -x \"resdiag silentdiag 1\",18 the "/tmp/jsnmp.sh" contains following: #!/bin/sh $java_home/bin/java -jar /export/home/checkout/jsnmp.jar $* now if run this: $java_home/bin/java -jar /export/home/checkout/jsnmp.jar \ -f noc2 -t 4,4 -x "resdiag silentdiag 1",18 everything works. any ideas folks? you want maintain quoting within script, use "$@" .

c# - Is there any debugging tool or analyzer for UN/EDIFACT PAXLST/CUSRES formate? -

un/edifact paxlst/cusres we need create flight manifest un/edifact paxlst formate having inbound , outbound manifest pilots , crew in both , send customs through api. there debugging tool or analyzer un/edifact paxlst/cusres formate ? i did lots of search on google on it, , found : http://www.edidev.com/ the tool edidev provide if fredi, , not open source, , use tool think have create .sef files manually. found not useful. any suggestion , appreciated. in advance! www.edifabric.com open source , supports transaction sets mentioned.

regex - Regular Expressions and EditPlus -

Image
i'm using edit plus , have following type of lines in text file represent directory structure , file. \apps\mccsdocs\general\10-11 arrat\bridge river_\bridge river-pa0900021_dec 21.pdf \apps\mccsdocs\general\10-11 arrat\burns lake\burnslake_pa1100062-se_mar2010.xls \apps\mccsdocs\general\10-11 arrat\campbell river\campbellriver_pa0900004_arrat_oct2010.pdf what need grab directory structure \apps\mccsdocs\general\10-11 arrat\bridge river_\ , place in buffer /1 , grab file name bridge river-pa0900021_dec 21.pdf , place in buffer /2 . if easier start @ end of line , grab file name , grab left, work too. (\\.*\\.*\\.*\\.*\\.*\\)(.*) \\ = literal \ .* = the result be: \apps\mccsdocs\general\10-11 arrat\bridge river_\=======bridge river-pa0900021_dec 21.pdf \apps\mccsdocs\general\10-11 arrat\burns lake\=======burnslake_pa1100062-se_mar2010.xls \apps\mccsdocs\general\10-11 arrat\campbell river\=======campbellriver_pa0900004_arrat_oct2010.pdf is want? ...

make onmouseenter and onmouseleave to work in chrome - html, javascript, jquery -

<div style="position: relative; left: 50px; top: 30px; width: 300px; height: 150px; background: #222222;" onmouseenter="this.style.background='#aaaaaa'" onmouseleave="this.style.background='#222222';"></div> http://jsfiddle.net/z8kue/1/ onmouseenter , onmouseleave events works in firefox , opera, apparently doesn't work @ in chrome... how can simple basic div in fiddle become functional in chrome, without changing it's content (beside assigning class)? the ideal solution, if possible, somehow register onmouseenter , onmouseleave events chrome users, without assigning class. edit: know onmouseover , onmouseout, out of question - need workaround code have practical reasons. edit 2: right have jquery specific class - http://jsfiddle.net/z8kue/6/ . have lot of divs it's events written in html, inside of <div></div> so example, have 2 divs these ( http://jsfiddle.net/z8kue/8/ ). imagine th...

HttpStatusCode not set in exceptions when using Google .Net APIs -

i'm having issues when using google apis .net. when calling service , call fails reason googleapiexception thrown. httpstatuscode 0 in exception. can parse status code message of course not nice solution. i'm using latest binaries nuget (1.5.0.28972) i'm having problem getting exponentialbackoff algorithm work , think related issue. below som code duplicate behaviour. const string serviceaccount = "000000000000@developer.gserviceaccount.com"; const string keyfile = @"c:\privatekey.p12"; const string keypass = "notasecret"; const string applicationname = "test"; const string user = "admin@some-domain.com"; // user wish act static void main(string[] args) { var certificate = new x509certificate2(keyfile, keypass, x509keystorageflags.exportable); var provider = new assertionflowclient(googleauthenticationserver.description, certificate) ...

php - how to sort multiarray with the sub value -

i have multidimensional array unexpected numbers of product groups i want sort these groups lowest count number these groups as example : first group after resort input product group because has lowest count number , input product group ..etc how this? <?php $a = // output product group array( array('id' => 117, 'name' => 'monitor', 'count' => 60), array('id' => 118, 'name' => 'printer', 'count' => 16), array('id' => 119, 'name' => 'sound card', 'count' => 19), // input product group array( array('id' => 120, 'name' => 'keyboard', 'count' => 11), array('id' => 121, 'name' => 'hard', 'count' => 21), array('id' => 122, 'name' => 'mouse', 'count' => 24) ) ) ; // ...

iphone - Dynamic Height For UITableViewCell and The content inside -

i have particularly problem can't seem solve have looked @ code few hours , can't seem fix problem. when add messages tableview messages overflows wrapper within uitableviewcell , wrapper gets cutoff cell. how make sure wrapper big enough hold txt (lblmessage) , cell big enough hold wrapper. thanks in advance ! -(cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { cgfloat height = [self heightformessage:indexpath]; if(height < 50) { nslog(@"normal : %d , row : %d", 100,indexpath.row); return 100; } else { nslog(@"custom : %f , row : %d", 70 + height,indexpath.row); return 70 + height; } } -(cgfloat)heightformessage:(nsindexpath *)indexpath { messageobject * model = [self.chats objectatindex:indexpath.row]; cgsize size = [model.message sizewithfont:[uifont fontwithname:@"helveticaneue-light" size:12] constrainedtosize:c...

JOOMLA 2.5 / Login with an AJAX Request -

is there posibility session id, maybe ajax request joomla instance? thank feedback! http://extensions.joomla.org/extensions/access-a-security/site-access/authentication at least 2 of extensions listed have ajax in names.

jquery - Tabs only rendering first page -

i have app making , using jquery tab control navigation. renders first page, second page blank content. when navigate tab first tab, first tab still displays correctly. here master page tabs <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head id="head1" runat="server"> <title></title> <link href="~/styles/site.css" rel="stylesheet" type="text/css" /> <link href="styles/jquery-ui-1.10.3.custom.css" rel="stylesheet" type="text/css" /> <script src="scripts/jquery-1.10.2.js" type="text/javascript"></script> <script src="scripts/jquery-ui-1.10.3.js" type="text/javascript"></script> <s...

ios - Is there a way for having the same string readable and editable from C and Objective-C? -

i have following problem: ios app written objective-c (as usual) uses parts of code written c. c code core of application, code written objective-c uses job done c , coordinates whole application. for doing job, c code reads preferences file, name cabled in c file. possible (in c code) read name of file @ run-time rather @ compile-time? idea modify string objective-c , let c code read string. assuming .c file looks this: #include <stdbool.h> static const char *_prefsfilename = "userprefs.css"; bool readprefs() { file *fp = fopen(_prefsfilename, "r"); .... } then need add function allow _prefsfilename set before attempt made use open file: void setprefsfilename(const char *prefsfilename) { _prefsfilename = prefsfilename; } and ensure call before calling readprefs() . this assumption of course, that's have work with.

google cloud storage - How to count number of file in a bucket-folder with gsutil -

is there option count number of files in bucket-folders? like: gsutil ls -count -recursive gs://bucket/folder result: 666 files i want total number of files compare amount sync-folder on server. i don't in manual. the gsutil ls command options -l (long listing) , -r (recursive listing) list entire bucket recursively , produce total count @ end: $ gsutil ls -lr gs://pub 104413 2011-04-03t20:58:02z gs://pub/someoftheteam.jpg 172 2012-06-18t21:51:01z gs://pub/cloud_storage_storage_schema_v0.json 1379 2012-06-18t21:51:01z gs://pub/cloud_storage_usage_schema_v0.json 1767691 2013-09-18t07:57:42z gs://pub/gsutil.tar.gz 2445111 2013-09-18t07:57:44z gs://pub/gsutil.zip 1136 2012-07-19t16:01:05z gs://pub/gsutil_2.0.releasenotes.txt ... <snipped> ... gs://pub/apt/pool/main/p/python-socksipy-branch/: 10372 2013-06-10t22:52:58z gs://pub/apt/pool/main/p/python-socksipy-branch/python-socksipy-branch_1.01_all.deb ...

mongoose - Mongodb : array element projection with findOneAndUpdate doesn't work? -

i using mongoose , i'm trying update array element , updated. document structure : { name:string, friends:[ { name:string, age:number } ] } when execute following query friends in result want 25 year old friends : thecollection.findoneandupdate( { name : 'cherif', 'friends.name':'kevin' }, { $set:{ 'friends.$.age':25 } }, { friends: { $elemmatch: { age : 25 } } }, function(err,result){ if (!err) { console.log(result); }}); as the docs findoneandupdate specify, need include projection object select property of options parameter: thecollection.findoneandupdate( { name : 'cherif', 'friends.name':'kevin' }, { $set:{ 'friends.$.age':25 } }, { select: { friends: { ...

django - Why SlugField generates these indexes? -

i have model slugfield. and, after ran south migrate, saw 2 indexes, mentioned below , in postgres. use of second index? create index school_student_slug on school_student using btree (slug); create index school_student_slug_like on school_student using btree (slug varchar_pattern_ops);

Python - Opening successive Files without physically opening every one -

if read number of files in python 3.2, 30-40, , want keep file references in list (all files in common folder) is there anyway how can open files respective file handles in list, without having individually open every file via file.open() function this simple, use list comprehension based on list of file paths. or if need access them 1 @ time, use generator expression avoid keeping forty files open @ once. list_of_filenames = ['/foo/bar', '/baz', '/tmp/foo'] open_files = [open(f) f in list_of_filenames] if want handles on files in directory, use os.listdir function: import os open_files = [open(f) f in os.listdir(some_path)] i've assumed simple, flat directory here, note os.listdir returns list of paths file objects in given directory, whether "real" files or directories. if have directories within directory you're opening, you'll want filter results using os.path.isfile : import os open_files = [open(f) f in o...

javascript - Rows disappearing on Datatables? -

so let me first explain trying emulate. home page, there main table recent table entries. user given set of "favorite" folders can drag , drop table rows main table. rather dragging whole visible row (my rows rather wide, , difficult tell folder drop into) have "information" icon, in case arrow. user can drag icon , drop folder, when @ point should removed main table , appended table within favorite folder. far, of happening in following fiddle (except row not removed main table). problem starts become apparent use of datatables. after adding row favorite folder, there, until click next , previous on pagination. disappears. also, never seems part of table because information on bottom left of datatables not updating. showing 1 2 of 3 entries, when there may 4 total (from rows user dragged). understand add rows datatables, need fnadddata i'm not sure how use in instance, ideas? thank in advance. fiddle: http://jsfiddle.net/yk5fg/4/ $( ".drag" ).d...

php - RewriteRule to redirect on different file for subdomain -

i want write rewriterule , rewritecond, whenever sub domain called different file going processed, same url. i have tried following code, but's not working me rewritecond %{http_host} !^mydomain\.test\.com$ [nc] rewritecond %{http_host} ^(.*)\.mydomain\.test\.com$ [nc] rewriterule ^$ /app/test/index.php?param=$1 [nc,qsa,l] i have configured other steps properly. every time calling index file www, not mentioned folder. you're not capturing $1 in rewriterule , change code this: rewritecond %{http_host} ^([^.]+)\.mydomain\.test\.com$ [nc] rewriterule ^((?!app/test/index\.php).*)$ /app/test/index.php?param=$1 [qsa,l,nc]

asp.net - Deploy MVC4 on IIS7.5 -

i deployed mvc4 application developed using framework v4.5 on iis 7.5. application works fine on iisexpress, not on iis7.5. when try access application on machine at: localhost/clientedigital.web/ i'm redirected login page, @ wrong address, localhost/account/login/ . if force right address, localhost/clientedigital.web/account/login/ page displayed, when enter login , password, won't redirect home. login page reappears. i'm sure problem iis configurations, , not in application. i'm using integrated pipeline , have enabled anonymous , forms authentication on iis application. in this post guilerme longo said solved problem, didn't how. anybody have idea?

How to avoid downcasing acronyms in ruby / rails -

i have field contains titles "it professional" or "db administrator". want display in middle of sentence , need down-case. unfortunately, downcases acronyms , end "thanks joining community of professionals". a start solution mentioned grantovich below, i.e. specifying acronyms in config/initializers/inflections.rb : activesupport::inflector.inflections |inflect| inflect.acronym "it" inflect.acronym "db" end the problem going route firstly, don't want store them in lower case suggested part of solution because titles , should stored capitals. secondly, defined in uppercase , bad idea make them lower case. solution found: since want title appear in middle of sentence, hence need lower case, solved downcasing title, constructing sentence , calling #humanize on that. humanize capitalize first letter of sentence , defined acronyms. if possible, store strings "it professional", "db administrator...

php - Magento adding commas into download link -

having issues magento adding commas download link. safari, firefox, , internet explorer fine escaping commas , downloading file, google chrome doesn't escape commas , when download link clicked displays white page no download occurring. i'm wondering if there way fix occurring? this format of link magento distributing: /store/downloadable/download/link/id/mc4zmti1njkwmcaxmzc5nte3mzcymtixotkzmdi3nzqwnq,,/ i have other downloadable products work fine (including products multiple download links). apparently, magento's downloadable core extension replaces '+/=' '-_,'. see line 115 in file /app/code/core/mage/downloadable/model/observer.php. can modify behavior local overwrite. however, try adding new product , deleting old 1 change product id used input in base64_encode() - maybe can help.

php - Preg replace can not replace this tag? -

i using code remove between tag,however can't make happen. missing here? $str ='<tr class="main_row pc"> <td class="details"> <a href="./view/4135660/"><span class="p_t">fiat cinquecento </span></a> <a class="info" href="./view/4135660/">(info)</a><br> <div class="attribs">16345, <span class="p_l">blue</span>, phone 6914576304 </div> </td> </tr>'; $str = preg_replace('#(<tr class="main_row pc">).*?(</tr>)#', '$1$2', $str); you need use s modifier . match newlines: $str = preg_replace('#(<tr class="main_row pc">).*?(</tr>)#s', '$1$2', $str);

javascript - slide overflows while slideup and slide down is used continuesly -

hi every 1 here tried make slider effect on click of button, on click of button details regarding part appears in particular div running facing bug here if click if click slide1 , after slide2 other slide overflowing div looks code breaking badly. please me out or let me know missing.i have provided part of code form jsp page. <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <style> .sp { background-color:white; width:788px; height:500px; float:left; text-align:center; font-size:100%; display:none; } </style> </head> <body> <div> <div style="width:200px;height:500px;background-color:#e6e6e6;text-align:center;float:left;"> <a class="last_item" id="slide1">slide1</a><br> <a class="l...

python - How to pass proxy to pythonbrew for downloading setuptools? -

i installed pythonbrew on ubuntu precise system. had issues using proxy during installation (see an earlier post ). i'm able install different versions of python , switch between them, setuptools not installed during python installation: error: failed install setuptools. see /usr/local/pythonbrew/log/build.log see why. skip installation of setuptools. the build.log contains: downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz traceback (most recent call last): file "distribute_setup.py", line 556, in <module> sys.exit(main()) file "distribute_setup.py", line 552, in main tarball = download_setuptools(download_base=options.download_base) file "distribute_setup.py", line 211, in download_setuptools src = urlopen(url) file "/usr/local/pythonbrew/pythons/python-2.6/lib/python2.6/urllib2.py", line 124, in urlopen return _opener.open(url, data, timeout) file "/usr/local/pythonbrew/...

perl - WWW:Mechanize setvisible -

setting radio button in current form simple: $clone->set_visible([radio => '1']); with unknown number of radio buttons (probably 10 20) loop should work: while(1) {last if (!$clone->set_visible([radio => '1']));}; however, though setvisible returns 1. guess returns 0 when nothing set @ all. if 1 field set, can "re-set". how stop after radios set? or need determine how many there first? you can find inputs need first: my @radio_inputs = $mech->find_all_inputs( type => 'radio', );

How to fix this layout issue in JQuery Mobile -

Image
i created popup listview inside. applied list filter. however, not correctly formatted. there way can push bit (like list divider be)? edit: code <div data-role="content"> <div data-role="popup" id="popupmenu" data-theme="d"> <ul data-role="listview" data-inset="true" id="symptomslist" style="min-width:210px;" data-theme="d" data-filter="true"> </ul> </div> </div> to best results of jquery mobile styles of contents inside page, dialog, panel or popup, place them inside data-role="content" . <div data-role="popup" id="popupmenu" data-theme="d"> <div data-role="content"> <ul data-role="listview" data-inset="true" data-theme="d" data-filter="true"> <!-- list items --> </ul> </div> ...

c - base64 decode not working -

i have following code: char *encoded = "dghpcybpcybhihrlc3qgc3ryaw5n"; char *unbase = unbase64(encoded,strlen(encoded)); printf("original: %s\n",unbase); free(unbase); char *unbase64(unsigned char *input,int length) { bio *b64,*bmem; char *buff = (char *)malloc(length); b64 = bio_new(bio_f_base64()); bmem = bio_new_mem_buf(input,length); bmem = bio_push(b64,bmem); bio_read(bmem,buff,length); bio_free_all(bmem); return buff; } char *base64(const unsigned char *input,int length) { bio *bmem,*b64 = null; buf_mem *bptr; b64 = bio_new(bio_f_base64()); bmem = bio_new(bio_s_mem()); b64 = bio_push(b64,bmem); bio_write(b64,input,length); bio_flush(b64); bio_get_mem_ptr(b64,&bptr); char *buff = (char *)malloc(bptr->length); memcpy(buff,bptr->data,bptr->length-1); buff[bptr->length-1] = 0; bio_free_all(b64); return buff; } which doesn't show decoded string. base...

javascript - Scroll a div over top of a div above -

i'm trying replicate effect seen on page: http://www.falve.co.nz/collection/ as scroll page white section beneath darker hero section scrolls on top of top hero section, curtain. how replicate this? jquery thing or css position thing? unsure how approach this? that called parallax effect , achieved through javascript. here few resources can use own projects.

.net - Regex commas out of expression -

i attempting regex replace commas in-between quotations in string. can't seem match them in non-greedy fashion won't regex entire line. text , regex i'm trying below. regex i'm trying, picking commas in-between each element. ex "remove,comma","nocomma" yields "remove,comma" , "," match. also, picking matches "nocomma"," "nocomma","nocomma". i working on matching first, narrowing down replacing commas. using .net 4.0 text before regex "remove,comma","remove,comma","nocomma","remove,comma","remove,all,commas,here,too","also,remove,commas" text want after before regex "removecomma","removecomma","nocomma","removecomma","removeallcommasheretoo","alsoremovecommas" regex \".*?(,).*?\" regex.replace(input,@",(?!([^""]*""[^...

Transposed parameter in Matrix Market Format of gensim - python -

in gensim library, there mmreader class converts matrix market format file python object. necessary transpose matrix , hence transposed parameter introduced in mmreader . however, confused why @ lines 525-526 , 567-568 of https://github.com/piskvorky/gensim/blob/develop/gensim/matutils.py , inversion of term-document values , id happens when transposed == false . anyone familiar term-document matrices in information retrieval care enlighten me? class mmreader(object): """ wrap term-document matrix on disk (in matrix-market format), , present object supports iteration on rows (~documents). note file read memory 1 document @ time, not whole matrix @ once (unlike scipy.io.mmread). allows process corpora larger available ram. """ def __init__(self, input, transposed=true): """ initialize matrix reader. `input` refers file on local filesystem, expected in sparse (co...

.net - Using Razor to get HTML from Resource File -

i storing string within resourcefile: please select @html.actionlink("personal", "personalaccount", "help"), or @html.actionlink("corporate", "businessaccount", "help") account. now want put content on span element inside title attribute. i tried without success : <span class="tooltip-icon tooltip" title="@html.raw(httputility.htmldecode(tooltips.accounttype))"> </span> the issue seeing regular text, not content encoded. razor not going double parse page, parses page , renders content of resource text having @ in it(please select @html.actionlink("personal", "personalaccount", "help")). doesn't care in resource. any how, can't way , shouldn't, culture specific part of code link's text should put part in resource file not whole of line.

javascript - how to make alert prompt only display once? -

i want alert apear once. <head> <script type="text/javascript"> var name; name = window.prompt("enter name"); </script> </head> this in body <div style="left:750px;top:60px;position:absolute;"> <script type="text/javascript"> document.writeln("welcome "+name+" !"); //name request display here </script> </div> ================================================================================== also promotion popup when page load here promotion.html <body> <script type="text/javascript"> popupcenter() //for name enter on request form </script> </body> here promotion.html:- <body> <div id="promotion"> <table border="1"> <tr><td><p> <script language="javascript"> <!-...

post - AJAX username check don't pass value -

i trying make validation of username field in silverstripe 3. ajax checks if username exist , if exist, shows "this name taken" via ajax. but problem is, no value passed variable via ajax. $_post['username'] empty. so code in controller: public function checkuser1(){ $params = $this->geturlparams(); if($params['id'] == '1'){ if (director::is_ajax()) { $username = $_post['username']; // seems dont receive value input vie ajax $username = mysql_real_escape_string($username); $check_for_username = mysql_query("select id member username='$username'"); if(mysql_num_rows($check_for_username)) { return '1'; } else { return '0'; } } else { ...

Proper way to implement python-social-auth with Django and Steam backend -

i want use python social auth authenticate users using steam openid end. i've followed django configuration steps . but, @ point don't know next steps. theoretically, application ready use openid provider can't find in documentation tells me how use provider. need make use of functionality? probably bit late useful answer, in case... bare bones procedure cobbled together, should started. assuming got django-specific parts done (including syncdb ), need complete generic social auth , steam configuration... you need steam api key (get here ) in settings.py , add key: social_auth_steam_api_key = '...' and add backend: authentication_backends = ( 'social.backends.steam.steamopenid', #others, if want them... ) in urls.py , add social urls: urlpatterns = patterns('', url('', include('social.apps.django_app.urls', namespace='social')), ) now create login link using /login/steam?next=/ , ne...

html - tbody border not showing -

why doesn't border show around tbody in following? tried rules="groups" , border appears, between 2 tbody sections , collapsed. <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset="utf-8"> <title>test</title> <style type="text/css"> table.sectioned tbody { border: 2px solid black; border-collapse: separate; border-spacing: 4px; } </style> </head> <body> <table class="sectioned"> <tbody> <tr><td colspan="2"><b>general data</b></td></tr> <tr><td>tail number</td><td>n0809021</td></tr> <tr><td>type of ownership</td><td>personal</td...

jquery - Issue with multiple checkboxes -

disclaimer: have been working jquery week , html/css 2 weeks. i have form contains couple of checkboxes , various text input fields. first checkbox #ship_to_billing. if checked hides , unrequires fieldset #shipping_info. if not checked of fields within fieldset must have value. so, either ship_to_billing checkbox must checked or fieldset fields must filled out in order user submit form, otherwise alert instructing them complete appropriate areas. that's working excellently on own. but, added additional required checkbox @ bottom of form , can't figure out how incorporate current jquery setup. new checkbox #age_verification. needs checked independent of of other inputs on form. if not, should receive alert check box before proceeding. after adding validation last checkbox, nothing working, lets user submit form without filling out or checking of inputs. also wondering if doing result in potentially 2 alerts popping @ same time if try submit form without filling in or if ...