Posts

Showing posts from June, 2010

curl - How to properly debug PHP curl_setopt_array when it's returing false? -

code: <?php $this->curlhandle = curl_init(); $curl_options = $this->additionalcurloptions + array( curlopt_cookiejar => $this->cookiefile, curlopt_url => $base_url, curlopt_followlocation => true, curlopt_maxredirs => 5, curlopt_returntransfer => true, curlopt_ssl_verifypeer => false, // required make tests run on https. curlopt_ssl_verifyhost => false, // required make tests run on https. curlopt_headerfunction => array(&$this, 'curlheadercallback'), ); if (isset($this->httpauth_credentials)) { $curl_options[curlopt_userpwd] = $this->httpauth_credentials; } // curl_setopt_array() returns false if of specified options // cannot set, , stops processing further options. $result = curl_setopt_array($this->curlhandle, $this->additionalcurloptions + $curl_options); ?> i need figure out what's going wrong curl options. how debug curl_setopt_array() itself? since c

c# - How to convert a Collection to byte array -

i have observablecollection<employee> how convert byte array[]? the class employee consists of, - employeeid - dateofjoining - age - salary the service need pass collection expecting data in byte[]. efficient way convert observablecollection byte[]? or need loop through collection create byte array? you can use binary formatter serialize collection. http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatters.binary.binaryformatter.aspx var employees = new observablecollection<employee>(); using (var stream = new memorystream()) { var formatter = new binaryformatter(); formatter.serialize(stream, employees); var bytearray = new byte[stream.length]; stream.seek(0, seekorigin.begin); stream.read(bytearray, 0, (int)stream.length); // whatever want bytes now.... }

java - JPanel Not Stretching To Fill Screen -

so trying make panel stretches across entire programs with, , has 20 pixels worth of height. reason there small box panel. can tell me why isn't stretching entire width? i'm new java, sorry if code little messy/wrong. gridpane class public gridpane() { gbc = new gridbagconstraints(); gbc.anchor = gridbagconstraints.north; gbc.weighty = 1.0; horizontalgrid = new jbutton(); horizontalgrid.settext("horizontal grid"); options = new jpanel(new borderlayout()); options.setbackground(color.black); options.add(horizontalgrid); add(options, gbc); } game class public class game extends jpanel implements actionlistener{ //declarations private static final long serialversionuid = 1l; public gridpane grid = new gridpane(); //declarations end //constructor public game() { this.add(grid); } //constructor ends //main method public static void main(string[] args) { jframe frame = new jframe(); game game = new game(); frame.se

java - TCPdump parsing sequence number using regular expressions -

i creating program read packet tcpdump, , read sequence number. using regular expressions, code isn't working. public long getsequencenumber(string packet){ pattern p = pattern.compile("seq.\\d*"); matcher m = p.matcher(packet); if(m.matches()){ pattern num = pattern.compile("\\d*"); return long.getlong(num.matcher(m.group()).group()); } return -1; } the following prints -1: system.out.print(getsequencenumber("blahbdds seq 1910428391283 ldskgj")); any suggestions? thanks! what need matcher.find() , long.valueof() : public class main { public static void main(string[] args) { system.out.println(getsequencenumber("bladds seq 1910428391283 ldskgj")); } public static long getsequencenumber(string packet){ pattern p = pattern.compile("seq.(\\d*)"); matcher m = p.matcher(packet); if(m.find()){ return long.valueof(m.group(

php - Multi select html inserting multi values into database -

i'm working on category section stories submitted website. have html select going on in html , have submitting database using codeigniter functions. submitting database, there seems small problem...the select grabbing last value selected. need have values selected entered database can pull them out @ later date. this html using. <select multiple class="multi" name="wgenre"> <option value="action/adventure">action/adventure</option> <option value="angst">angst</option> <option value="crime">crime</option> </select> and have in model. $this->title = $this->input->post('wtitle'); $this->genre = $this->input->post('wgenre'); $this->db->insert('story_tbl', $this); now, believe problem database. set field enum, won't work because it's either 1 or other select

c# - Windows Phone 8 SDK - WebBrowser Control - How to refresh page from code -

how can refresh webbrowser control code behind? using windows 8 sdk & c#. you can accomplish storing recent visited url when need refresh navigate it. private void browser_navigated(object sender, navigationeventargs e) { lasturi = e.uri; } private void refresh() { browser.navigate(lasturi); }

c# - Download multiple files async and wait for all of them to finish before executing the rest of the code -

i trying download multiple files internet , await of them finish. c# console application running, no progress bar event handler should necessary. continues execute code though files have not been downloaded. 1.downloading files! 2.finished download file a 3.finished downloading files! 4.finished downloading file b 5.finished downloading file c how await till async download files finished. private void downloadmultiplefiles(list<documentobject> doclist) { foreach(var value in doclist){ try { using (webclient webclient = new webclient()) { string downloadtodirectory = @resources.defaultdirectory + value.docname; webclient.credentials = system.net.credentialcache.defaultnetworkcredentials; webclient.downloadfilecompleted += client_downloadfilecompleted; webclient.downloadfileasync(new uri(value.docurl), @downloadtodire

svg - Can't dynamically place text over the top of polygon -

i want put text on top of polygons. unfortunately text goes behind shape there similar css z index? here part of svg in html (its lot of code because im drawing map here little part of it.) although below have same coords, did place them on shape using inspector in chrome, shapes remained above text. <svg width="400" height="800" viewbox="0 0 400 800" id="svg-doc"> <rect id="central-park" class="shape" x="154" y="370"width="53" height="127" /> <a xlink:href="/zipcodes/16"> <rect id="z10024" class="shape" x="68" y="415" width="85" height="40" /> <text x="0" y="15" fill="#5df8b8">10024</text> </a> <a xlink:href="/zipcodes/17"> <rect id="z10023" class="shape" x="68"

c# - Multiple lines in a DataGridView cell -

using c# windows forms ; i have datagridview number of cells. show digits (from 1-9) in cell. digits should placed under each other in 3x3 format. i looked around, , ended rather complex custom implementation of richtextbox cell. is there way can draw custom rectangle , implement backgroundimage of cell or something? cell need redrawn several times. can't call paint event guess. note: cell must not edited user. im don't know if satisfy you, can use environment.newline create simple line break inside cell. example: string nl = environment.newline; // new line variable string data = "1 2 3" + nl + "4 5 6" + nl + "7 8 9"; added later: as adrian said in comments - need to: set wrapmode datagridviewcolumn datagridviewtristate.true make sure set height row, or set datagridview's autosizerowsmode datagridviewautosizerowsmode.allcells if don't want edit column - can set datagridview.column.readonly

html - Jquery show number within div in alert -

hi i want show number in div in alert this <script> var sec = $('#demo').html(); alert(sec); </script> <div id="demo">100</div> code show 100 number but null or undefined or 0 when use size(); , text(); , html(); , length; edit : got problem . jquery v1.7.1 , seems has problem . upgraded jquery v1.9.1 , code works fine . thank answers set this techniques set (place) number inside empty <div id="demo"></div> $('#demo').text(100); // overwrite new content $('#demo').html(100); // overwrites + can insert raw (string) html. $('#demo').append(100); // keeps content , appends element $('#demo').prepend(100); // keeps content , prepends element $('#demo')[0].textcontent = "100"; // jq/js, overwrite text content $('#demo')[0].innerhtml = "100"; // jq/js, overwrite html document.getelementbyid('demo&#

javascript - How can I make sure 'this' refers to the object literal within the object literal? -

here's simple fiddle . i want make sure this inside obj obj can call a b . i'm using obj in different function, , when put breakpoint inside b , find this window, not obj . var obj = { a: function() { return 2 }, b: function() { return 5+ this.a() }, } $('#hey').text(obj.b()); obj defined in file used many other classes, wouldn't make sense define either of methods @ site of using obj . judging @kamil's answer, looks may need pass in a parameter b . in: var user = obj.b(obj.a); var obj = { a: function() { return 2 }, b: function(func) { return 5 + func() }, } edit following works, it's messy. there more elegant way? i ended changing startingsma = this.simple_moving_average(startingsma, period, accessor) to following: startingsma = (function(startingsma, period, accessor) { return this.simple_moving_average(startingsma, period, accessor) }).apply(statistics,

linux - `for f in *; do cp "$f" "$f"_copy; done` doesn't work because "foo.png_copy". How to fix it? -

on linux, command: for f in *; cp "$f" "$f"_copy; done doesn't work expected because "_copy" string appended after file extension, becoming foo.png_copy instead of foo_copy.png . how fix it? can slice string? for f in *; prefix="${f%.*}" suffix="${f:${#prefix}}" cp "$f" "${prefix}_copy${suffix}" done this finds filename's prefix trimming suffix matching ".*". note if filename doesn't have extension, entire filename; if has more 1 period, it'll remove last 1 (e.g. file named "this.that.etc.png", it'll trimmed "this.that.etc"). finds suffix slicing filename based on length of prefix ( ${#prefix} ); works expected whether or not removed. warning: treat filename period in has having extension. example, "file_v1.0" copied "file_v1_copy.0". note: if wanted, skip defining $suffix, , use ${f:${#prefix}} inline in copy

windows 8 - Unable to launch Visual studio 2012: Could not load file or assembly -

so i've been having computer problems , had reset in windows 8 - uninstalls programs leaves files more or less intact. i've been going through , reinstalling everything, , i've found can no longer launch visual studio 2012. i've done complete reinstall , i've removed windows 8 phone sdk may have been interfering. when try launch vs2012 error message: "could not load file or assembly 'system.xaml, version=4.0.0.0, culture=neutral, publickeytoken= or 1 of it's dependencies. module expected contain assembly manifest. anyone have ideas? please try this: download cleanup tool uninstall .net framework in system. read clean tool here . download latest .net framework in here . install framework , reboot.

.net - Web login into a forum link to store the page sourcecode -

how can log in site using native methods? http://forum.soundarea.org/index.php?/forum/1121-01-2013/ my intention log in in background (i mean without openning webbrowser interface or showing page) store page sourcecode. i tried log in using this: http://myuser:mypass@forum.soundarea.blabla tried using post can't: http://forum.soundarea.org/index.php?&ips_username=myuser&ips_password=mypass http://forum.soundarea.org/index.php?app=core&module=global&section=login&ips_username=myuser&ips_password=mypass (i think used correct ids site i'm not sure) also tried using wget application can't log in url. i don't tried in .net because don't have info methods can use or else start trying because first of don't know protocol requires (http login or post php or other) i'm not expert things. please if can give me info or examples, , tell me fault. i suggest use httprequest emulate login progress,use httpresponse w

php - Install Symfony as a library -

i'm working on project use symphony build application going library other php projects. we want install symfony , manage dependencies through composer. structure we're after this: / composer.json /symfony /src /app /vendor /symfony /doctrine the vendor directory not committed source control since it's contents generated composer. symfony directory our application source directory if possible prefer have src , app directories sit directly in root next composer.json . since want/need create bundle our application (for orm entities etc.) , can't place of in vendor directory question is; a) possible? b) there resources out there set structure this? take @ default directory structure after fresh install . it's want! don't know, or devs doing, got symfony folder next composer.json everything code lives under src/ dircetory next composer.json configure lives under app/config/ directory. nothing lives in symfony f

osx mountain lion - Building Boost 1.53.0 Boost Log 2.0r862 on OSX 10.8.3 -

i working @ building boost 1.53.0 boost log 2.0r862 on mac osx 10.8.2 , installed fake root keep /usr/lib* , /opt/lib* clean. built , installed boost with ./bootstrap --prefix=/path/to/myfakerootdir and installed library with ./b2 install built , installed successfully; when running cmake on project detects library include , lib directory. yet after completes building , attempts run executable dyld: library not loaded: libboost_system.dylib referenced from: /users/brad/dev/strata/strataextract/build/debug/strataextractunittests reason: image not found some possible issues i've researched include: 1.using otool change executable manually (though seems "hacky" solution) 2.use modified portfile @ github macports overlay (though current version offered old project. 3.multiple build tutorials on boost, unfortunately referencing bjam understand no longer practice. seem remember of similar situation requiring me set relative path false, unsure how boost +

ios - Delegate not working for google plus integration -

i trying implement google plus integration,sign in working properly,the problem after sign in not entering in - (void)finishedwithauth coe follows: gppsignin *signin = [gppsignin sharedinstance]; signin.clientid = @"client_id"; signin.scopes = [nsarray arraywithobjects: kgtlauthscopepluslogin, nil]; signin.delegate = self; already declared gppsignindelegate delegate its problem checking call url, plz check redirect url in appdelegate

HtmlService generated script gadget: hyperlinks don't work -

i've created simple apps script gadget in google site, , generates output using htmlservice. in source file, there dirt simple hyperlink <a href="http://www.google.com">link</a> when click it, report in debug window: the page @ https://sites.google.com/macros/s/akfycbzw0jd06fdrbz-kkjkmdvpkma_rznboxe0ix…u6ms841tc3c&bc=transparent&f=aclonica,sans-serif&tc=%23cccccc&lc=%23336699 displayed insecure content http://google.com/. exec:1 the page @ https://sites.google.com/macros/s/akfycbzw0jd06fdrbz-kkjkmdvpkma_rznboxe0ix…u6ms841tc3c&bc=transparent&f=aclonica,sans-serif&tc=%23cccccc&lc=%23336699 displayed insecure content http://www.google.com/. exec:1 refused display 'https://www.google.com/' in frame because set 'x-frame-options' 'sameorigin'. exec:1 any ideas how solve this? what trying open google.com inside apps script gadget embedded in google site. error message suggests, x-frame-o

javascript - Kendo grid cancel causing deletion of row -

i using kendo grid , grid.and on particular situation adding data datasource of grid using grid.datasource.add() method.the following configuration of grid. var itemcodedatasource = new kendo.data.datasource({ datatype: "json", transport: { read: function(o){ o.success([]); }, create: function(o) { var item = o.data; //assign unique id , return record item.id = len; o.success(item); len++; }, destroy: function(o) { o.success(); }, update: function(o){ o.success(); } }, autosync: true, schema:

a class in a list item in jquery tabs cant be reached by CSS -

this html code : <div id="tabs"> <ul> <li><a href="#home">home</a></li> <li><a href="#gallery">gallery</a></li> <li><a href="#about">about me</a></li> <li class="gold"><a href="#book">all love</a></li> <li class="gold"><a href="#fashion">fashion corner</a></li> </ul> notice have class="gold" in last 2 li now want change color class, tried : #tabs li .gold{ color:#ccff00; } and .gold{ color:#ccff00; } but none of them working. please kindly me , explain little bit, why code not working. for information, #tabs li selector working perfectly. thanks :d get rid of space between class , corresponding element, remember hirarchy of reading codes important browser, later statments o

nosql - How CQL3 differs from CQL2 and Thrift? -

"compact storage stores entire row in single column on disk instead of storing each non-primary key column in column corresponds 1 column on disk. using compact storage prevents adding new columns not part of primary key." i can not understand above statement, true?! reference: http://www.edwardcapriolo.com/roller/edwardcapriolo/entry/legacy_tables take @ http://www.datastax.com/dev/blog/thrift-to-cql3 , explains of it.

javascript - JS to hide banner only works Firefox -

i have problem in javascript , css also. have video displayed when click on 2 ads in sequence. <script type="text/javascript"> function closead(a,background) { var e = document.getelementbyid(a); var bg = document.getelementbyid("background"); bg.style.background = background + " no-repeat"; bg.style.backgroundsize = "100% 100%"; if(e.style.visibility == ""){ e.style.display = "none"; e.innerhtml=""; } } </script> <script type="text/javascript"> function habilitar(id,id2){ var e = document.getelementbyid(id); var d = document.getelementbyid("body_logo"); if(e.style.visibility == ""){ e.style.visibility="hidden"; e.innerhtml=""; e.innerhtml d.style.visibility== ""; d.style.visibility="hidden"; d.innerhtml=""; jwplayer(&quo

plot - how to let each element in a vector be plotted in 1 second on the x axis in matlab -

i have vector x=[0 0 0 1 1 2 1 3 1 4] need plot stairs graph space between each element , 1 on x axis must 1 unit or 1 second example , when vector elements increase matlab plot more 1 element in same unit on x axis so how can adjust x axis plot each element in 1 second on x axis ?

Android MySql connection error -

this question has answer here: how fix android.os.networkonmainthreadexception? 44 answers i have load data remote mysql database app. table contains event id, event name , event details. have last data table , show in 3 text views. tried tutorial androidhive. doesn't seem work. please help. class retrieve data class geteventdetails extends asynctask<string, string, string> { @override protected void onpreexecute() { super.onpreexecute(); pdialog = new progressdialog(mainactivity.this); pdialog.setmessage("loading data servers. please wait..."); pdialog.setindeterminate(false); pdialog.setcancelable(true); pdialog.show(); } /** * getting product details in background thread * */ protected string doinbackground(strin

android - How to change textview shadow color for onclick -

is thr way change textview text shadow color simillar changing text color <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:color="@color/white" android:state_focused="true"/> <!-- focused --> <item android:color="@color/white" android:state_focused="true" android:state_pressed="true"/> <!-- focused , pressed --> <item android:color="@color/white" android:state_pressed="true" /> <!-- pressed --> <item android:color="@color/black"/> <!-- default --> create style in styles.xml <style name="myshadowstyle"> <item name="android:shadowcolor">#ff8800</item> <item name="android:shadowradius">2</item> </style> now in selector xml <selector xmlns:android="http://schemas.android.com/apk/res/android"> &l

ios - Should views hold model references? -

let's have following classes: view @interface articleview : uiview @property iboutlet uilabel *titlelabel; @property iboutlet uilabel *bodylabel; @end model @interface article : nsobject @property nsstring *title; @property nsstring *body; @end controller @interface articleviewcontroller : uiviewcontroller @property article *myarticle; @property articleview *myarticleview; - (void)displayarticle; @end @implementation - (void)displayarticle { // option 1 myarticleview.titlelabel.text = myarticle.title; myarticleview.bodylabel.text = myarticle.body; // ... or ... // option 2 myarticleview.article = myarticle; } @end option 1 pro: both view , model aren't coupled each other. con: controller needs know details of both model , view. option 2 pro: controller code light , flexible (if view or model change, controller code stays same. con: view , model coupled , therefore less reusable. in option 2, articleview have ch

Why won't APC work in PHP v5.5 on Travis-CI? -

so, i'm writing php programme uses apc it's caching mechanism. i'm using travisci continuous integration , testing on php 5.3, 5.4 , 5.5. tests apc pass v5.3 , 5.4, fail on 5.5 following message... php warning: php startup: unable load dynamic library '/home/travis/.phpenv/versions/5.5.0beta1/lib/php/extensions/no-debug-non-zts-20121212/apc.so' - /home/travis/.phpenv/versions/5.5.0beta1/lib/php/extensions/no-debug-non-zts-20121212/apc.so: cannot open shared object file: no such file or directory in unknown on line 0 warning: php startup: unable load dynamic library '/home/travis/.phpenv/versions/5.5.0beta1/lib/php/extensions/no-debug-non-zts-20121212/apc.so' - /home/travis/.phpenv/versions/5.5.0beta1/lib/php/extensions/no-debug-non-zts-20121212/apc.so: cannot open shared object file: no such file or directory in unknown on line 0 my .travis.yml file looks this ## yaml template. --- language: php php: - "5.5" - "5.4" - &

android - Couldn't read row 1, col -1 from CursorWindow -

i have following error message in application: 05-13 09:05:53.218: e/androidruntime(5339): fatal exception: main 05-13 09:05:53.218: e/androidruntime(5339): java.lang.runtimeexception: unable start activity componentinfo{com.example.unserekinder/com.example.unserekinder.ereignisse}: java.lang.illegalstateexception: couldn't read row 1, col -1 cursorwindow. make sure cursor initialized correctly before accessing data it. 05-13 09:05:53.218: e/androidruntime(5339): @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 05-13 09:05:53.218: e/androidruntime(5339): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 05-13 09:05:53.218: e/androidruntime(5339): @ android.app.activitythread.access$600(activitythread.java:141) 05-13 09:05:53.218: e/androidruntime(5339): @ android.app.activitythread$h.handlemessage(activitythread.java:1234) 05-13 09:05:53.218: e/androidruntime(5339): @ android.os.handler.dispatchmessage

entity framework - How would EF find Down() migration on deployment of previous version? -

we have site uses code first migrations , @ moment deployment partly manual, in scripts applied hand after new site folder in place on server. i want move using web deploy , getting application_start apply migrations automatically, concerned when rolling per-migration site version. mental logic tells me old version not have appropriate down migration available undo more recent migration. am correct or missing something? martyn how generating contents of up/down methods in migration code? if you're using add-migration, down() method should contain need roll corresponding up() call. if you've manually changed contents of up() method (or if automatic process has changed it), you'll have ensure down() method updated reflect contents of up() method, ensure proper downgrades, if have modify down() method yourself. hope helps? if can clarify further, try answer in more detail.

javascript - neither success nor error is working in jquery ajax -

i beginner jquery ajax. below ajax code working fine when using async: false , due problems in firefox removed after referring link (i facing same issue). not working. not showing errors. here code: try { _ajaxcall = $.ajax({ url: url, type: "post", data: "drqlfragment=" + text, //async : false, cache: false, headers: { accept: "application/json", contenttype: "application/x-www-form-urlencoded" }, contenttype: "application/x-www-form-urlencoded", //processdata : true, success: function (data, textstatus, jqxhr) { var resdata = data.suggestions; (var = 0; < resdata.length; i++) { sugdata.push(resdata[i].keyword); } }, error: function (response) { //error here alert('hello'); } }); } catch (e) { alert(e); }

javascript - AngularJS: Render own module more than once -

i've been exploring angularjs few days now, , thought of creating datepicker. bumpted onto few things aren't clear me yet. @ first, code wrote datepicker: angular.module('datepicker', []).directive('mydatepicker', function() { return { scope: { clickcallback: '&', options: '=' }, restrict: 'e', templateurl: 'datepicker.php', link: function($scope, $element, $attr) { $scope.day = 0; $scope.month = 0; $scope.year = 0; $scope.years = []; $scope.days = []; $scope.months = getstandardmonths(); $scope.init = function() { (var = 1; <= 31; i++) $scope.days.push({ value: i, text: (i < 10) ? "0" + : }); $scope.days.unshift({ value: 0, text: "--" });

Jquery ajax result not working on chrome -

i have problem jquery ajax on chrome. ajax echo result this: 1||result goes here here ajax script: $("#load_cards").click(function() { $("#load_cards").fadeout('fast'); var form_data = { query: 'cardpack', page: page, pack: pack }; $.ajax({ type: "post", url: 'ajax.php', data: form_data, success: function(response) { response_d = response.split("||"); response_message = parseint(response_d[0]); response_html = response_d[1]; if (response_message == 1) { hist = $("#card_pack_list").html(); $("#card_pack_list").html(hist+response_html); page = page+1; } else { } $("#load_cards&q

wpf - Prevent windows from opening -

hi ask strange question. testing wpf application. my current object under test wf application spontaneously opens informational dialogs. dialogs modal , can open every time. pretty disturbing automated test running on application. whenever tester accesses visual tree , try access gui (like invoking buttons etc.) can happen such dialog window opens, blocking gui modality , making test fail. one idea solve prevent dialogs opening. can not change behaviour of application under test directly can subscribe window events (like initialized, loaded, rendered, etc.). use 1 of events prevent windows opening , modally blocking gui. i tried using loaded event since last event before window displayed calling close() on corresponding window causes crashes. tried hide()... prevents window getting visible gui still blocked invisible dialog. does have idea how prevent wpf window/dialog opening or @ least modally blocking gui? if use dialogservice dialogs can mock testing

iphone - How to switch between NSObject Class to ViewController -

i'm having class 1 extends nsobject , second view controller. what problem want go nsobject view controller loads xib file of view controller . i have used traditional, no success far. suppose nsobject magentologin.m , want go viewcontroller, how can achieve this? myappdelegate *appdelegate = (myappdelegate *)[[uiapplication sharedapplication] delegate]; [appdelegate.navigationcontroller presentviewcontroller:mynewviewcontroller animated:yes completion:nil]; try hope help

jquery - Background Color animation doesn't display on <tr> -

i have weird problem, try make animation on tr , doesn't execute on specific page. i use twice, worked on page , didn't on second, script same (parent change because of dom structure) $("#ajax button.delete").on("click", function(){ var name = this.name, value= this.value; var parent = $(this).parent().parent().parent(); $.ajax({ type: 'get', url: 'deletecategory.php', data: 'delete=' + $(this).val(), beforesend: function() { $('td', parent).animate({"background-color":'#fb6c6c'}, 300); }, success: function() { parent.remove(); } }); }); in script parent variable tr tag. and tr tag filled : <tr> <td><span id="tcat{$data->cid}">{$data->name}</span> <div class="btn-group pull-right">

javascript - Passing function response (callback) as variable to another function -

see below. i'm trying pass function(response) variable used in progress bar function. that's idea anyways. how call data = response var = data in case? $(document).ready(function () { $.ajaxsetup({ cache: false }); var data = 0; setinterval(function () { $('#divtorefresh').load('usercounter.php', function (response) { data = response; }); }, 100); window.onload = function () { var animator = new function () { var parent = document.getelementbyid('container'); var element = document.getelementbyid('test'); var target = document.getelementbyid('message'); this.move = function () { var = data; var width = 0; var timer = window.settimeout(function () { += 1; element.style.width = width + + 'px&

Running remote mysqldump over SSH all in python -

hi im trying write python script ssh remote server , execute mysqldump. method far establish portforwarding run backup script had written. suspect issue in portforwarding backup script pretty straightforward. here portforwarding: import getpass import os import socket import select import socketserver import sys import paramiko username = 'myusername' remote_server = 'remote.servername' remote_port = 3306 local_server = '127.0.0.1' local_port = 3307 ssh_port = 22 password = none keyfile = 'hosting.pem' g_verbose = true class forwardserver (socketserver.threadingtcpserver): daemon_threads = true allow_reuse_address = true class handler (socketserver.baserequesthandler): def handle(self): try: chan = self.ssh_transport.open_channel('direct-tcpip', (self.chain_host, self.chain_port), self.request.getpeer

r - Selective suppressWarnings() that filters by regular expression -

in attempt generate code runs without warnings , hence can run options(warn=2) , looking implementation of suppresswarnings routine filter warnings match given (vector of) regular expressions. warnings beyond control, famous unrecognized record type 7, subtype 18 encountered in system file when reading spss files, , want selectively suppress these without affecting possible other warnings. is there implementation of functionality? suppress warnings withcallinghandlers , invokerestart , using "mufflewarning" restart mentioned on ?warning withcallinghandlers({ x <- 0 warning("unrecognized record 123") x <- x + 1 warning("another warning") x + 1 }, warning = function(w) { if (startswith(conditionmessage(w), "unrecognized record")) invokerestart("mufflewarning") }) this has output [1] 2 warning message: in withcallinghandlers({ : warning (use trycatch if instead stop on war

Google+ HTTP API returns less activities than supposed to -

i've been using google plus http api several weeks , i'm experiencing strange issue. when try retrieve public activities community: https://plus.google.com/communities/115653528125420367824 , 4 results, no more. i've tried increasing maxresult parameter of request doesn't change anything... and when use nextpagetoken retrieve missing activities, "items" field of response empty. you can try google apis explorer here: https://developers.google.com/apis-explorer/#p/plus/v1/plus.activities.list?userid=115653528125420367824&collection=public see 4 activites returned , next page of result empty. this strange , happened recently, used work fine. maybe caused fact content of activities of community contains stringified json object. think? the activities methods supported retrieving posts users , google+ pages. not supported use communities , should not expected work correctly. there no guarantee behavior while might have worked or works in c

html - Table td border visible and invisible same row -

Image
i have 2 tables data, in table under want calculate amount of 3 columns. these 3 td have border while 4 on left , 1 on right don't have border. looks fine this, had add pixels size of td on left (4px) not want. any advice on how this? code html <table id="tbl_urijou_goukei" class="goukei"> <tr> <td width="240"></td> <td width="55"></td> <td width="34"></td> **<!-- 30 + 4 px align 商品合計 td -->** <td align="right" width="80">商品合計:</td> <td align="right" class="sum" width="80">...</td> <td align="right" class="sum" width="80">...</td> <td align="right" class="sum" width="80">...</td>