Posts

c++ - calling static function from constructor of same class -

can call static function constructor of same class. class a{ static void fun(); a() {fun();} }; it giving error while linking code. using visual studio c++, 2010. yes can - long provide function definition static function well.

jquery - JQqery ajax call with parameter not working -

i made jquery ajax call calling static page method . working fine wihtout parameter. if put parameter not call page method. have below code. javascript $.ajax({ type: 'post', url: 'itemmaster.aspx/uploadfile', contenttype: 'application/json; charset=utf-8', data: {'path':'mydata'}, datatype: 'json', success: function (msg) { alert(msg.d); } }); page method [webmethod] public static string uploadfile(string path) { return "success"; } is there datatype mismatching happened?. warm google time without success. please help.. your data object needs json string. try var datatosend = json.stringify({'path':'mydata'}); $.ajax({ type: 'post', url: 'itemmaster.aspx/uploadfile', contenttype: 'application/json; charset=utf-8', data: datatosend, dataty...

sql server - Is this SQL line saying previous day or the next day? -

we have old sql script looks data previous day. in our table have dateplaced column, want able records time ran til previous day. help. where datediff(day,[dateplaced],getdate()) = 1 ugh, don't way. applying function column means index relatively useless. data yesterday (or range, matter), try: declare @today date = sysdatetime(); ... dateplaced >= dateadd(day, -1, @today) , dateplaced < @today; if on old version sql server 2005, instead: declare @today datetime; set @today = datediff(day, 0, getdate()); ... dateplaced >= dateadd(day, -1, @today) , dateplaced < @today;

git - GitHub "Failed connect to github" No Error -

Image
i'm pretty new git, i've been using gitbash commits, pushing , pulling week or 2 now. working fine, day or 2 ago when started getting error everytime tried interact remote repositories. fatal: unable access '....': failed connect github.com:443; no error i've done googling , come across similar stackoverflow posts , articles. that, i've tried number of things, including testing ssh connection across different ports (22 , 443). looks port 443 (for https connections) blocked, while port 22 seems open. from understand of this, looks me might need change port git using 443 22. i've tried changing ~/.git/config file , i've tried git remote set-url command try this, no joy. any information on original error or on how change git port appreciated. any reason why use git via http? i'd suggest using ssh instead. git clone git@github.com:greenvalley/githubsandbox.git

javascript - Jquery mobile ''pagebeforeshow' not executing after pressing back -

i have implemented logic inside $(document).on('pagebeforeshow', '#mainpage', function(){ } but doesnt load when user eitehr presses key go specific page containg js or when calling history.back(-1); return false; to manually go previous page. it gets executed if refresh or directly go page using href<> any sugestions? cheers since you're using multi-files template, need fetch previous url history document.referrer . demo $('.selector').on('click', function (e) { e.preventdefault(); var page = document.referrer; $.mobile.changepage(page, { transition: 'flip', reloadpage: true, // optional, force page reload. reverse: true }); });

javascript - JS - Can't send php to js variable -

this question has answer here: pass php array javascript function [duplicate] 4 answers i'm working on gchart organization. in php able , echo text db. here have problem on how pass text db js. in here, have text db ( $data[nama] , $data[parnama] ), want use in js=> ['$data[nama]', '$data[parnama]', null], how can that? big help. update <?php $host="localhost"; $user="root"; $pass=""; $dbnama="skripsi"; mysql_connect($host, $user, $pass) or die ("database tidak dapat di akses"); mysql_select_db($dbnama); $query="select * tblarya"; $hasil=mysql_query($query); if($hasil === false) { die(mysql_error()); } while ($data=mysql_fetch_array($hasil)){ echo "<l...

c# - Dynamically adding columns to DataGridView as it gets expanded -

i'm working on ms office add-in has datagridview 5 columns. possible have many columns shown can fit sidebar, user re-sizes add-in sidebar add more or take away columns there becomes room them? u can use resize event of datagridview , add , remove (or set visibilty) of rows unwanted. i guess columns have given size , not sized automatically. in case u can: int columnstoshow = (int)(datagridview.size.width / columnwidth); now add enough rows match wanted number / remove rows or set visibility