Posts

Showing posts from January, 2010

php - Decorate or extend HTTP request class in Silex -

in example, want add additional methods request class, getrequiered*($name) throw exception in case of missed param in request. i'd implement this: class mysmartrequest extends request { // ... function getintrequired($name) { $res = $this->get($name, null); if (null === $res) { throw new exception('missed required param'); } return (int) $res; } } // ... $app->before(function(request $r) { return new mysmartrequest($r); }); is possilbe? yes, possible (never done this, following tip reading code). you'll need create subclass of silex\application , , overwrite run() function this: public function run(request $request = null) { if (null === $request) { $request = mysmartrequest::createfromglobals(); } $response = $this->handle($request); $response->send(); $this->terminate($request, $response); } to avoid duplication, can try this: public function run(request $...

string - Filter out a specific word in Excel Vba -

i want filter out specific words , string. example, "this sample file." word filtered out in excel vba = "file". please help, in dire need of code. thank you. instr("this sample file.", "file") give position of first occurrence of "file" in longer string, or 0 if not there. you can remove elements of string using left , mid , right . len gives length of string. putting together: sub test() dim s1 string dim s2 string dim pos integer s1 = "this sample file." s2 = "file" pos = instr(s1, s2) if pos > 0 debug.print left(s1, pos - 1) & mid(s1, pos + len(s2)) end if end sub

Excel vba and XMLHTTP with ADFS - not returning xml -

i have excel macro has been in use years posts database using xmlhttp call. code digitally signed. recently site being posted has enabled adfs. instead of getting xml contents of adfs authentication form. there no prompt credentials in since authentication occurred. open url web browser goes through expected existing credentials used , page loaded. i tried setting trusted setting url , allowed external content didn't matter. have missed something? the html looks like... <html><head><title>working...</title></head><body><form method="post" name="hiddenform" action="https://isvcci.jttest.com:444/"><input type="hidden" name="wa" value="wsignin1.0" /> ... <noscript><p>script disabled. click submit continue.</p><input type="submit" value="submit" /></noscript></form><script language="javascript">...

Method in C++ to get the available screen space on Linux -

i'm looking way actual available screen space, similar cocoa nsscreen visibleframe method, on linux. displays resolution minus menu-bar/dock/title-bar. i'm using sdl2 windowing code, can't find within library documentation might help. sdl_getwindowmaximumsize seems closes candidate, returning 0,0 me. any ideas? use sdl_getdesktopdisplaymode() ,( sdl_getvideoinfo() in sdl1.2) https://wiki.libsdl.org/sdl_getdesktopdisplaymode

c# - Use flowlayoutpanel to hold forms -

i'm trying use flowlayoutpanel hold several forms ( public partial class subform : form ). tried: subform sf = new subform (); sf.toplevel = false; sf.parent = this; // form containing flowlayoutpanel1 sf.show(); flowlayoutpanel1.controls.add(sf); //flowlayoutpanel1 created design there 2 problems this: i cannot "select" subform. specific, enter , leave , etc events never triggered when click on subform in flowlayoutpanel1 i cannot resize subform what need create "main" window containing several subforms("sub" windows) in flowlayoutpanel, should able select, resize, close "sub" windows. i'm using .net 4.0 edit: i need enable user create/delete/move/resize "sub" windows inside "main" window, , "sub" windows should automatically aligned . that's all. if did wrong, please point out specific control(s) should use.

sql server - Sql Database analyse, where should files go? -

i'm analyzing system has routine accounting actions , data plus customer relation management (crm). in crm part of system record customers' calls , save them somewhere, may save customers' pictures, logos, signatures, scanned documents , on. should deal wide range of files (sound, image, pdf, word documents, etc ...) i need deciding keep files. in old system kept files on hard disk drive space , saved path database, , @ time of need open file using address. think (correct me if i'm wrong) not solution keep files on hdd because : we lose data integrity. file names may changed (renamed, moved, deleted, overwritten) reason, resulting wrong path in database. moving whole data (moving server) time consuming process, let's have 1,000,000 files totally reaching 20 gb. if want move 1 million files 1 computer another, assuming pc tolerates , not burn, take long time move files (i/o time copying lot of small files more copying big file) moving single file of 20 g...

python - Steaming insert / insertAll - long delay? -

i'm streaming data table on bigquery google api python. i 200 ok no 'inserterrors' key in response bigquery: {u'kind': u'bigquery#tabledatainsertallresponse'} if query table there 2 rows, despite me having inserted several additional records little while ago (20 minutes+). i can't see errors anywhere - can advise me on how debug issue? i found solution here: https://stackoverflow.com/a/19145783/1607103 i resolved issue experiencing creating new dataset , new tables within it. working , data visible seconds after adding it. @ stage in project table structures changing frequently, seems cause of issue. ensure modified tables have different names now. i extremely concerned bigquery experiencing issues no visibility. doesn't fill me confidence there no errors , there no indication (that aware of) going wrong.

.htaccess - htaccess rewriterule issue - file name in url -

i have following problem. in htaccess want make rewrite rule. my url: http://www.domain.com/pool/slovakia/senec/aquapark-senec/ but when enter url, browser redirect to: http://www.domain.com/pool_detail.php/?title_url=pool&pool_country_url=slovakia&pool_city_url=senec&pool_url=aquapark-senec htaccess: rewriterule ^(pool)/([a-za-z0-9-]+)/([a-za-z0-9-]+)/([a-za-z0-9-]+)/?$ pool_detail.php?title_url=$1&pool_country_url=$2&pool_city_url=$3&pool_url=$4 [qsa] i don't understand why happening, because use same row in htaccess accomodation , works good: rewriterule ^(accomodation)/([a-za-z0-9-]+)/([a-za-z0-9-]+)/([a-za-z0-9-]+)/?$ accomodation_detail.php?title_url=$1&country_url=$2&city_url=$3&accomodation_url=$4 [qsa] can issue? options +followsymlinks rewriteengine on rewritecond %{http_host} ^domain.com rewriterule (.*) http://www.domain.com/$1 [r=301,l] rewritecond %{http_host} ^domain.sk rewriterule (.*) http://www...

ruby on rails - Options for running controller method from view -

ruby on rails 3.2: made table, model , controller. want run "new" method in controller. off top of head can think of form run method. other options there run controller methods? in particular run "new" method when viewing view files. thank you well, can add new action link, use form, , call action using ajax. other alternative other violate mvc.

rust - unique vector patterns are no longer supported -

i realize rust in flux, i'm trying learn anyway. i'm trying understand how adapt following example, works 0.9, similar works 0.10: fn main() { let argv = std::os::args(); let (first, last) = match argv { [_, first_arg, .., last_arg] => (first_arg, last_arg), _ => fail!("error: @ least 2 arguments expected.") }; println!("the first argument {:s}, \ , last argument {:s}.", first, last); } when build 0.10, following error: error: couldn't read test.rc: no such file or directory (no such file or directory) orflongpmacx8:rust pohl_longsine$ rustc test.rs test.rs:9:9: 9:37 error: unique vector patterns no longer supported test.rs:9 [_, first_arg, .., last_arg] => (first_arg, last_arg), ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due previous error my question: still possible use pattern matching on argv, different syntax, or using match statement on argv no longe...

mysql - Link SQL query result in PHP -

i have sql query witch search students name sql database shows results want link each result http url www.tlss.edu.pk/result.php?r=1 if sr_=1 sql query <?php include 'form.html'; $r1=$_get["r"]; $n1=$_get["n"]; // create connection $con=mysqli_connect("localhost","chumspai_tlss","tls121","chumspai_tlsresult"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } echo $n1; $result = mysqli_query($con,"select * nursery_blue_ students_names '%$n1%'"); while($row = mysqli_fetch_array($result)) { echo '<pre>'; print_r ($row['sr_']. '.'. $row['students_names']); echo '</pre>'; } ?> add link in loop , if have condition add condition show link while($row = mysqli_fetch_array($result)) { echo "<a href='http://www.tlss.ed...

ios - Revert to previous controller after xx amount of seconds -

i have simple app little code. in viewcontroller have done no code, have added navigation bar contains next button modal videocontroller. achieve after next button pushed in viewcontroller, allow user view videocontroller 5 seconds , automatically return previous viewcontroller. here code have added in videocontroller.m #import "videocontroller.h" @interface videocontroller () @end @implementation videocontroller - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization } return self; } - (void)viewdidload { [super viewdidload]; //code added [self performselector:@selector(goback) withobject:nil afterdelay:5.0]; } //code added -(void)goback{ [self.navigationcontroller popviewcontrolleranimated:yes]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } \ @end i not rec...

html - Maximum number of allowable, no max_file_uploads in php.ini -

i have php lets user upload maximum of 20 files. when submit pictures getting following error in error_log => php warning: maximum number of allowable file uploads has been exceeded in unknown on line 0 when created phpinfo file under max_file_uploads have 20 under local value , master value 'configuration php core'. when open php.ini file cannot find max_file_uploads , when insert 'max_file_uploads = 50' value in php info file (above) remains same i.e. 20. what doing wrong please? update i on shared host... tried doing ini_set('max_file_uploads', 50); didn't work. the host told me cannot restart server 'on shared hosting, there no way reset/restart server effect hundreds of different accounts'

installing visual studio 2013 ultimate beside visual studio 2010 ultimate -

i have installed visual studio 2010 ultimate edition years. my operating system windows 7 x64 sp1. i want install (visual studio 2013 ultimate edition + update1) beside visual studio 2010 ultimate edition. found links conflict between vs2010 , vs2012 did not mentioned conflict between vs2010 , vs2013. please if found conflicts. thanks alot.

c++ - What is wrong with my binary search algorithm? -

i have written binary search following. when try find 10, it's not showing me result. missing?? // binarysearch.cpp : defines entry point console application. // #include "stdafx.h" #include <iostream> using namespace std; void binarysearch(int arr[],int value); int * insertionshot(int arr[]); int _tmain(int argc, _tchar* argv[]) { int arr[10] = {1,2,3,10,5,9,6,8,7,4}; int value; cin >> value ; static int *ptr;// = new int[10]; ptr = insertionshot(arr); binarysearch(ptr,value); return 0; } int * insertionshot(int arr[]) { int ar[10]; for(int =0;i < 10; i++) { ar[i] = arr[i]; } int arrlength = sizeof(ar)/sizeof(ar[0]); for(int = 1; <= arrlength -1 ;a++) { int b = a; while(b > 0 && ar[b] < ar[b-1]) { int temp; temp = ar[b-1]; ar[b-1] = ar[b]; ar[b] = temp; b--; } } return ar; } void binarysearch( int a[],int value) { int min,max,middle; min = 0; int ar[10]; for(int =0;i...

How to merge numerical cell and char cell of binary values into 1 cell in matlab -

i have matlab cell of 7395x28 numerical values , have character cell of 7395x8 in there binary values. want binary values cell merged numerical value cell without change. for example let numerical cell , binary cell b merged them this c=[a,b] this gives me error saying cannot merge character cell numerical values cell. please me how solve the output should merged cell , last column of cell should consist of binary values. please help. code a1 = num2cell(randi(5,2,3)) %%// cell array of numerical values a2 = {'0' '1' '1'; '0' '1' '0' } %%// cell array of characters binary numbers out = num2cell(cell2mat(a1)*10+cell2mat(a2)-'0') output a1 = [4] [3] [5] [2] [4] [5] a2 = '0' '1' '1' '0' '1' '0' out = [40] [31] [51] [20] [41] [50] edit 1: code a={1,2,3; 2,3,4; 4,5,6; 7,8,9;...

C : Segmentation Fault when move main function to new file -

i implement custom memory allocator. main code inside file memory.c create main function in file test function. works fine. when move testing code file (calling main.c , run it. meet segmentation fault. int main (int argc, char *argv []) { allocator_init(); char* ptr = (char*) allocate(4096); // csutom function. on `memory.c` strcpy(ptr, "this test one");// segmentation fault here printf("print: %s\n", ptr); deallocate(ptr); } here main code : volatile memory memory; /* allocated memory memory variable assign /dev/zero memory */ void allocator_init() { fd = open("/dev/zero", o_rdwr); if(fd == -1) { perror("file open failed"); exit(0); } // page size can different on different platform. customize again optimize page_size = getpagesize(); // fd = open("zeroes", o_rdwr); if(fd == -1) { perror("file open failed"); exit(0); } // ...

javascript - Can't use divs from success function in AJAX -

i don't know why won't work me. }).success(function(data){ if(data.status == 'success'){ // $("#useravatar").empty(); for(i = 0;i < data.id.length; i++){ $("#useravatar").prepend('<div id="av'+data.id[i]+'" class="avatar">'+data.avatar[i]+'</div>'); var dropdiv = $('#av'+data.id[i]); // code here dont work. no error. tried alert(data.id[i]); , fine. dropdiv.css({ left: 130, top: -190, opacity: 0, display: 'inline' }).animate({ left: 5, top: 10, opacity: 1 }, 7000, 'easeoutbounce'); } } }); if use code alone: var dropdiv = $('#useravatar'); dropdiv.css({ left: 130, top: -190, opacity: 0, display: 'inline' }).animate({ left: 5, ...

javascript - How to remove an event out of content script scope? -

i'm trying unbind event specific element , upon research, found this . useful. in itself. didn't know that. but: is there way make work in browser/chrome extension? i'm talking content scripts. the reason why doesn't work way it's described there website has attached event in question own script using different jquery object 1 in extension's includes/ folder. , can try search event via jquery._data(el, 'click'); my jquery object, not 1 of website events apparently stored. i'm glad figured that out after hours of fiddling around. or maybe possible access website's jquery object itself? edit: what i'm trying achieve works in theory … it's complicated. original script uses plugin event , keeps reinstalling .on('mouseleave',… . anyway, got you, pdoherty926: var $el = $('div.slideshow'); $('h2', $el).click(function(){ console.log('ouch!'); }); // test event var $slides = $('.slides...

caching - SSL caches javascript file even with dynamic version query string -

this happens under https when make change javascript file, , update version number below original file still cached on reload. im not doing kind of fancy caching this, , seems work fine under http, https , iframes dont work well. using asp.net , iis7, thoughts on how make sure file updated when make change cause causes problems on client side browser. http://example.com/example.js?v=485

php - Execute an adittional script before access a location in apache -

i want run script before locations specified in <location> ca accessed : <location "/add-content"> # run /var/www/abc/custom-script.php first # continue load actual page </location> i have many websites having url in server, can't done in application level. can in apache? you'll want set handler : <location "/add-content"> # run /var/www/abc/custom-script.php first # continue load actual page action pre-script /var/www/abc/custom-script.php sethandler pre-script </location>

assigning NULL to a struct pointer gives error and meaning of segmentation fault -

i have simple code of c,c++, runs fine: struct node{ int x; struct node* next; }; int main(int argc, char *argv[]) { int a,b,c; struct node *root, *node1, *node2, *leaf; root = malloc( sizeof(struct node) ); //root = null; root->next = 0; root->x = 12; system("pause"); return 0; } now if assign root = null or 0, instead of malloc, gives me error- "an access violation (segmentation fault) raised in program" while in next line assign 0 next pointer. please explain in forum read segmentation fault occurs when try access secured memory space, while operating system defines page fault when required data not found in memory. related ? (sf of c, c++ , sf of operating system) if set root = null; , that, , not generate segmentation fault. the segfault happens on next line, when try dereference null pointer. if comment out 2 lines below it, observe no segfault.

Want to create a Grid View in asp.net c# with CRUD operations. Please give me INSERT, UPDATE, DELETE queries -

select * book_master full outer join publication_master b on a.p_id=b.p_id above given statement query viewing tables following tables (that included in query), 1.) book_master b_id (primary key) [identity column] b_title b_author b_price b_quantity p_id (foreign key, link table publication_master) 2.) publication_master p_id (primary key, linked p_id of book_master) [identity column] publication p_contact p_email p_id in book_master foreign key , in publication_master primary key. b_id , p_id identity columns (hence autogenerated) please give me insert, update , delete queries put in grid view configuration wizard make grid view crud-ready. newbie programming , have complete project of inventory management system of books. check this. refer fig 7 & 8 especially. http://www.asp.net/web-forms/tutorials/data-access/accessing-the-database-directly-from-an-aspnet-page/inserting-updating-and-deleting-data-with-the-sqldatasource-cs but if using joins &...

Issue in deploying REST Web Service in eclipse -

i writing rest web service using jax-rs in eclipse tomcat server . referring following tutorial write web service : http://www.vogella.com/tutorials/rest/article.html when run project following error: apr 7, 2014 12:01:53 org.apache.catalina.core.aprlifecyclelistener init info: apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: c:\program files\java\jre6\bin;c:\windows\sun\java\bin;c:\windows\system32;c:\windows;c:\program files (x86)\intel\icls client\;c:\program files\intel\icls client\;c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program files\intel\intel(r) management engine components\dal;c:\program files\intel\intel(r) management engine components\ipt;c:\program files (x86)\intel\intel(r) management engine components\dal;c:\program files (x86)\intel\intel(r) management engine components\ipt;c:\maven\bin;c:\program files\java\jdk1.6.0_41\bin;e...

python - Creating an autospec'd mock with a name value -

i'm trying use mock.create_autospec create autospecc'd mock name kwarg. however, typeerror exception whenever set name kwarg. here's example: >>> import mock >>> def a(): ... print "blah" ... >>> a() blah >>> q = mock.create_autospec(a) >>> q <function @ 0x7f184ceb1938> >>> q() <magicmock name='mock()' id='139742347069904'> mock() isn't descriptive name magicmock object, try set value name : >>> q = mock.create_autospec(a, name="a") traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/lib/python2.7/site-packages/mock.py", line 2186, in create_autospec name=_name, **_kwargs) typeerror: type object got multiple values keyword argument 'name' why happen? when try make regular magicmock , things go fine: >>> q = mock.magicmock(name="a") >>...

Multi-search, single search bar HTML -

as title states, i'm trying incorporate many searches 1 search bar. more specifically, google , amazon. have setup radio option set site search when 1 selected. code have: <form method="get" action="http://www.google.com/search"> <div align="center" style="font-size:75%"> <input type="text" name="q" size="25" maxlength="255" value="" /> <input type="submit" value="google or amazon search" /></br> <input type="radio" name="sitesearch" value="" />the web <input type="radio" name="sitesearch" value="yoursite.com" checked />this site </div> </form> i have form amazon, i'm unsure how code 1 search bar. <form action="http://amazon.com/s/ref=nb_sb_noss" method="get" target="_blank...

android - Delay in Click Events in PhoneGap with JQuery Plugin -

i using phonegap 3.4.0 jquery plugin android project. touch events not working properly, click events facing 300ms click delay. seems issue? how fixed? code sample: $(element).click(function(){ //my function }); 300ms delay normal thing in mobile webview, it's because of waiting possibility of performing double tap, there way bypass fastclick library.

unity3d - Unity Facebook apprequest works but no notification shown -

how make mobile game send request shown notification in candy crush saga game. i went through app requests successful, no notification shown can't find solution. don't know put in canvas url. game developed in unity3d. the canvas apps means- apps displayed inside facebook.com. i think having mobile app not canvas app, notification api , still in beta not supports notification in mobile. acc doc- currently, apps on facebook.com can use app notifications. notifications surfaced on desktop version of facebook.com so instead of notifications api, can use different kind of requests - whichever more significant in case.

how to get value from java script function to perl -

i want value of check box selected , pass query deleting value database. java script code function deleterows(){ istable = document.getelementbyid('datatbl'); nboxes = document.getelementsbyname('delbox'); (i=nboxes.length-1; i>=0; i--) { if (nboxes[i].checked === true) { var =nboxes[i].value; alert("do want delete row?"+a); istable.deleterow(i+1); } } } i need var a value in perl can pass delete query , delete selected row. html code <table id='datatbl' border='1' > <tr> <td><input type=checkbox name='delbox' value=@data></td> <td bgcolor=#0099ff>$pid</td> <td bgcolor=#99ccff>$project_name</td> <td bgcolor=#3399ff> $variant_no</td> <td bgcolor=#99ccff> $variant_name</td> <td bgcolor=#3399ff>$vehicle_class</td> <td bgcolor=#99ccff> $vc_no</td> </table> <input type=button value="delete rows" onclic...

ms office - Where does Outlook save my message? -

this isn't coding question question happens when outlook interacting word (office 2010). though may able save me blowing brains out in frustration. i have document in word. click on save & send, , outlook message pane document attached. type message , realise need change attached file 'save' outlook message (click on blue disk icon in toolbar) , return word. in outlook saved message not in drafts folder. has outlook put it? can't find in files explain oddity. although have saved it, email has vanished. can explain has been put? tia your email should in draft folder. issue draft folder arranged according sent date in default. search word in email in draft folder , find email there. vy

ios - Custom Storyboard Segue -

Image
i have custom storyboard segue animation not coming out way want to. instead of "wiping" in on view controller, want "push" away current view controller new 1 next it. (not push segue, more the effect seen in photos app when swipe through photos). ideas? thanks. - (void)perform { uiviewcontroller *currentviewcontroller = self.sourceviewcontroller; uiviewcontroller *newviewcontroller = self.destinationviewcontroller; [currentviewcontroller.view addsubview:newviewcontroller.view]; newviewcontroller.view.transform = cgaffinetransformmakescale(0.05, 0.05); cgpoint originalcenter = newviewcontroller.view.center; newviewcontroller.view.center = self.originatingpoint; [uiview animatewithduration:1.9 delay:0.0 options:uiviewanimationoptioncurveeaseinout animations:^{ newviewcontroller.view.transform = cgaffinetransformmakescale(1.0, 100.0); newviewcontroller....

google cloud messaging - BigQuery and GCM -

i'm trying create android app extracts information table in bigquery. in order this, have have implement google cloud messaging? if so, have have gcm server? there way, app can authenticate directly bigquery , fire query? if want make calls bigquery, shouldn't need google cloud messaging (i'm not sure is). can either use bigquery java client (info here ) or can make raw http requests bigquery (you'll need use oauth2 authorization). you might consider using appengine app proxy requests bigquery. can make auth easier, don't need bigquery credentials in android app.

Parsing in C# using JSON.Net (very confusing!) -

i want parse following json: {"0":{"igloo_id":"0","name":"igloo removal","cost":"0"},"1":{"igloo_id":"1","name":"basic igloo","cost":"1500"},"2":{"igloo_id":"2","name":"candy igloo","cost":"1500"},"3":{"igloo_id":"3","name":"deluxe blue igloo","cost":"4000"},"4":{"igloo_id":"4","name":"big candy igloo","cost":"4000"},"5":{"igloo_id":"5","name":"secret stone igloo","cost":"2000"},"6":{"igloo_id":"6","name":"snow igloo","cost":"1000"},"8":{"igloo_id":"8","name":...

postgresql - Implementing a java bean into a jsp servlet -

i trying connect jsp servlets posgress database , using java bean class playing role of middle man. experiencing difficulties making registration form store user information database. appreciate if kindly me out. thanks lot in advance. jsp servlet: <%@page contenttype="text/html" pageencoding="utf-8"%> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>register here</title> </head> <body> <form method="post" action="registration.jsp"> <center> <table border="1" width="30%" cellpadding="5"> <thead> <tr> <th colspan="2">enter information here</th> </tr> </thead> <tbody> <tr> <td>first nam...

Conditional validation using abide in rails? -

i have 2 fields , need check @ least 1 field has value rather validating both. example need either phone number field or email field filled. how can using foundation abide? please me thanks in advance! so don't want implement backend validation, on client? stumbled on validate.js . able add custom validators easily.

javascript - nodejs - Error: spawn ENOENT while adjusting image size using module gm -

i trying create thumbnail image have saved. using module gm adjust size of image. var gm = require ('gm'); var fs = require('fs'); var savedphoto = "./testphoto.jpeg"; var testdir = "./testoutput.jpeg"; gm(savedphoto) .resize(100, 100) .noprofile() .write(testdir, function (err) { console.error (err); }); when run error spawn enoent . code: 'enoent', errno: 'enoent', syscall: 'spawn. how fix problem? replace: var gm = require('gm'); for var gm = require('gm').subclass({ imagemagick: true });

postgresql - CREATE DATABASE inside transaction -

according postgresql docs; create database cannot executed inside transaction block. is there technical reason this? when try it, error: error: create database cannot run inside transaction block this comes src/backend/access/transam/xact.c (line 3023 on sources, varies version), in preventtransactionchain(...) . the comment there explains that: this routine called statements must not run inside transaction block, typically because have non-rollback-able side effects or internal commits. for create database it's called src/backend/tcop/utility.c in standard_processutility under case t_createdbstmt , unfortunately there isn't informative comment says why create database isn't safe run in transaction. looking @ sources, can see 1 thing forces checkpoint. overall, though, don't see screams out "we can't transactionally". it's more "we haven't implemented functionality transactionally".

javascript - Setting button title in HTML to a non-formatted text -

i have simple html page <body> <button type="button" id="button1" onclick="foo()">result!</button> <script type="text/javascript"> function foo() { var button = document.getelementbyid("button1"); } </script> </body> i want change button title on click. title might include html tags , want presented (without formatting). i've tried way suggested in this post , works great regular text. unfortunately formats html tags , doesn't present non-formatted text: <body> <button type="button" id="button1" onclick="foo()">result!</button> <script type="text/javascript"> function foo() { var button = document.getelementbyid("button1"); button.innerhtml = "<strong>my text</strong>" } </script> </body> to clear, want titl...

python - Referencing Rows in Instance Variable -

apologies if answered elsewhere, cannot find (or maybe understand) appears trying do... i have large-ish file approx. 60000 rows , 136 columns. want extract 20 columns , have created instance variable store data. data gets parsed , cut according entries in several of columns , moved new copies of instance variable maintain consistency. @ moment doing each column in instance , copy whole row @ time, cannot find way of referencing row in instance variable. examples of doing , below. if either point me in right direction or suggest better method of doing same thing (instead of using instance variable), grateful. instance variable: class instance_object: ###------------------------------------------------------------------ ### __init__ function create object ### ### stores interesting parameters data ###------------------------------------------------------------------ def __init__(self): self.a = [] self.b = [] self.c = [] # etc current main...