Posts

Showing posts from 2012

c++ log functions using template SFINAE for conditional compile -

i evaluating if possible leverage c++11 features replace logging macros without run-time additional cost. i come out demo: enum class loglevel { fatal = 0, dfatal = 1, error = 2, normal = 3, verbose = 4, debug = 5 }; constexpr loglevel log_compiled = loglevel::normal; loglevel log_runtime = loglevel::error; #ifdef ndebug constexpr loglevel log_fatal = loglevel::fatal; #else constexpr loglevel log_fatal = loglevel::dfatal; #endif template <loglevel l, typename std::enable_if<(l <= log_fatal)>::type* = nullptr> void log(std::string message) { std::cout << "fatal level: " << (int) l << " message: " << message << std::endl; exit(0); } template <loglevel l, typename std::enable_if<(l>log_fatal && l <= log_compiled)>::type* = nullptr> void log(std::string message) { if (l <= log_runtime) { std::cout << "level: " << (int

Php/Mysql: cannot print output to html selecting from table when match by ID but names works? -

so code below on website i'm revising [links pulled database now] works perfect , prints out matching row , column html. there column short names[name2, varchar] , auto incrementing integer column[id] match. function rainmaker($fname) { $connect = new pdo('mysql:host=localhost;dbname=weather;', '******', '***'); $sql = $connect->query('select `link` `satellite` `name2` = "'.$fname.'"'); while ($result = $sql->fetch()){ $urllink = $result['link'];} $linky = fulllinkedthumbnail($urllink,150); print $linky; } further down.... <td align="center"><p><?php rainmaker('ato'); ?></p></td> success! image shown on site. however, every variation of via id fails (1064 error: variable $urllink empty) or doesn't print out image link (site works, except images aren't shown). $sql = $connect->query('select `link` `sat

delphi - How to get the shell image index of an object in the shell namespace? -

i want index in system imagelist of object in shell namespace. if object file use shgetfileinfo : function getfileimageindex(const filename: string): integer; var sfi: tshfileinfo; begin shgetfileinfo(pchar(filename), file_attribute_normal, sfi, sizeof(sfi), shgfi_usefileattributes or shgfi_sysiconindex); result := sfi.iicon; end; except don't have file the thing have doesn't exist on hard-drive folder or file, e.g.: control panel homegroup network but still need index in system imagelist of icon corresponds thing. started shgetfileinfo (as supports pidls). fell apart. tried using iextracticon , fell apart: function getobjectimageindex(parentfolder: ishellfolder; const childpidl: pitemidlist): integer; //var // sfi: tshfileinfo; // extracticon: iextracticon; // iconfile: widestring; // iconindexinfile: integer; // flags: cardinal; begin { function shell namespace equivalent of getfileimageindex helper function. }

c - How can I detect if the mouse is over an item/subitem in a List View control? -

i've searched around , haven't found solution sounds reasonable me or seems relevant specific problem (even here on stack overflow). the problem simple: have of work needed custom checkboxes on cell of list view; need detect hover on/hover off draw hot images. these images set control's state image table, want change subitem state on hovers , clicks. i tried using nm_hover , after doing work things working didn't work. upon further research, seems issued if lvs_ex_trackselect on, don't want; want handle hovers, not select on hover! i looked using nm_hottrack , nm_activate , give me half answer: not know when items stop being hovered on (to cold-ify last hot item). i found codeproject project wacky things internal tooltips. don't want touch internal data structures @ all. my list view subclassed. require common controls 6. need run on xp or newer (though vista-specific option acceptable future). do have options here? thanks. since have

c - gtk_window_set_default_size doesn't work -

i have code: #define false false #define true true #include <gtk/gtk.h> int main( int argc, char *argv[]){ gtkwidget *window; gtk_init(&argc, &argv); window = gtk_window_new(gtk_window_toplevel); gtk_window_set_title(gtk_window(window), "window"); gtk_window_set_default_size(gtk_window(window), 230, 150); gtk_window_set_resizable(gtk_window(window), false); gtk_window_set_position(gtk_window(window), gtk_win_pos_center); g_signal_connect(g_object(window), "destroy", g_callback(gtk_main_quit), 0); gtk_widget_show(window); gtk_main(); return 0; } when compile code line below , run it, window ends being 1x1px gcc src/main.c -o test -wall -o2 `pkg-config --libs --cflags gtk+-3.0` if remove gtk_window_set_resizable line, starts working again. why happen? missing something? so reading this question's answer, learned gtk_window_set_default_size doesn't work, replaced gtk_w

linux - find -exec a shell function? -

is there way find execute function define in shell? example: dosomething () { echo "doing $1" } find . -exec dosomething {} \; the result of is: find: dosomething: no such file or directory is there way find 's -exec see dosomething ? since shell knows how run shell functions, have run shell run function. need mark function export export -f , otherwise subshell won't inherit them: export -f dosomething find . -exec bash -c 'dosomething "$0"' {} \;

php - how can I check which submit button is clicked -

i use laravel framework of php ... i have form 3 submit button each of them different task . how can find in controller side 1 clicked? define name each of them when print_r($_post) there nothing buttons name . how can check 1 pressed? {{form::submit('send',array('class'=>'btn btn-primary','name'=>'send'))}} {{form::submit('cancel',['class'=>'btn btn-primary','data-dismiss'=>'modal','aria- hidden'=>'true'])}} {{form::submit('save',array('class'=>'btn btn-primary','name'=>'save'))}} thanks time :) as per comment, can set same name, , different value each submit button, check value in controller: {{form::submit('send',array('class'=>'btn btn-primary','name'=>'action','value'=>'send'))}} {{form::submit('cancel',array('class

php - How to loop through a specific depth in an array? -

i'm pulling json information , i'm left huge nested array. an example schema follows: 'messages' => '0' => 'title' => 'foo' 'body' => 'bar' '1' => ... 'stories' 'foo' => 'bar' in scenario, want grab contents starting '0' , '1' , of children (title , body). 'stories' disregarded 1 depth higher 0 , 1. 0 , 1 automatically generated list , integer value dynamically go high need be, different. cheers! foreach($array['messages'] $key => $val){ if($key == 0 or $key == 1){ $new_array[] = $val; } } $new_array have relevant content. assumes you're referring messages part of array. if there other sub arrays want parse/manipulate have adjust condition in foreach loop. you can parse/manipulate $new_array needed, , ignore content don't need in $array .

c++ - VS 2013 - IntelliSense reporting false positives? -

i'm working on c++ project where, among other things, have interface few pure virtual methods. problem arises when try implement interface - intellisense doesn't seem agree derived class's method declaration. example of such method: // dll_export -> #define dll_export __declspec(dllexport) // iplayer dll_export virtual const grid& getgrid() const = 0; declaration in 1 of derived classes: // human : iplayer dll_export const grid& iplayer::getgrid() const; the error keeps nagging me - "intellisense: declaration must correspond pure virtual member function in indicated base class". code compiles without errors , runs fine, of "problematic" methods jobs expected during run time. worth mentioning error disappears if remove iplayer:: scope qualifier in derived class. wanted keep there readability reasons. also, not proficient in c++ there wrong example i've provided. minimized example: struct c { virtual void f() = 0; };

linux - smbclient -c with ls -l option -

i trying folder lists remote server, , not possible mount remote server local computer (because of permission issue). i used smbclient "//165.186.89.21/deptdq_141q_fota" "--user=myid" -c 'ls;' to lists of folder. , result success. but, want use ls -l above command line , when try results using line smbclient "//165.186.89.21/deptdq_141q_fota" "--user=lge\final.lee" -c 'ls -l;' it returns nt_status_no_such_file listing \-l 64000 blocks of size 16777216. 6503 blocks available ... how should use smbclient operator ls -l option? please me! smbclient ls not run native ls command, rather invokes built-in functionality. such, not support usual options native, posix-compliant ls command provide. thus, cannot this. if goal read metadata, consider trying smbclient stat [filename] subcommand instead.

amazon ec2 - Focus on text input in Google Chrome on Windows Server 2012 causes Windows Explorer to open? -

i have weird situation here. have amazon ec2 instance running windows server 2012. installed google chrome on volume. works fine 1 annoying thing. when i'm using google chrome if click on address bar or text input windows explorer pops folder path c:\program files(x86)\google\chrome\application\xx.xx.xx.xx\ (these x's seem in format of ip address). has else ran , if going on , there fix? works fine, it's annoying me window pop up. thanks

eclipse - JAVA, Batch file errors -

i have existing java project compiles , runs through eclipse. have created following .bat file run program sans eclipse: java -classpath jflashplayer.jar;bin testprogram the file saved within project folder, not within bin folder (located in same directory bin ). when try run batch, met large number of runtime errors, first being exception in thread "awt-eventqueue-0" java.lang.noclassdeffounderror: org/apache/commons/io/fileutils i'm not sure why error when compiles , runs via eclipse. have commons-io jar files linked project within eclipse libraries, , jar files located in project file (same directory batch file , bin folder). also, i'm not entirely sure -classpath jflashplayer.jar bit of batch file doing. using jflashlayer.jar library (also linked project within eclipse , in same location other jar files), not sure why appear in batch file. edited existing batch file similar project uses jflashplayer.jar files, , has worked leave part in. wh

android - How to programmatically scale an image to the size of a ImaageButton that was created dynamically -

i'm new android , trying create simple game called sos. it's close complete can not figure out how scale images put in imagebuttons. game board created during runtime, user chooses board size, 6 x 6, 7 x 7, or 8 x 8 (ie: board of 36, 49 or 64 tiles(imagebuttons)). depending on screen size/boardsize images may or may not fit in imagebuttons. decided try , scale images size of imagebutton. tried scale resource image correct size in constructor of tile(imagebutton), , store result in instance variable, runtime exception, , i'm not sure how fix it. in scaleimages method if change this.getlength(), , this.getwidth() 50 runs out error no images set in imagebutton. think need way determine size of button before try , scale image. public class tile extends imagebutton { private boolean occupied; private boolean iss; private boolean iso; int countclicks = 0; private static drawable simagescaled; private static drawable oimagescaled; private st

javascript - Do DOM tree elements with ids become global variables? -

working on idea simple htmlelement wrapper stumbled upon following internet explorer , chrome : for given htmlelement id in dom tree, possible retrieve div using id variable name. div like <div id="example">some text</div> in internet explorer 8 , chrome can do: alert(example.innerhtml); //=> 'some text' or alert(window['example'].innerhtml); //=> 'some text' so, mean every element in dom tree converted variable in global namespace? , mean 1 can use replacement getelementbyid method in these browsers? what supposed happen ‘named elements’ added apparent properties of document object. bad idea, allows element names clash real properties of document . ie made situation worse adding named elements properties of window object. doubly bad in have avoid naming elements after member of either document or window object (or other library code in project) might want use. it means these elements visible glob

powershell - Fine-tuning Get-Counter script for quicker execution -

below script process utilization of individual w3wp.exe app pools, problem each iteration takes 2 seconds there 25 app pools. can please me fine tune below script faster execution. gwmi win32_process -filter 'name="w3wp.exe"' | % { $name=$_.name $cmd = $pattern.match($_.commandline).groups[1].value $procid = $_.processid $tmp = (get-counter "\process(*)\id process").countersamples | where-object {$_.cookedvalue -eq $procid} | select -expand path $calc = [regex]::match($tmp,'\(([^\)]+)\)').groups[1].value $cooked = (get-counter "\process($calc)\% processor time").countersamples | where-object {$_.instancename -notlike '_total'} | select -expand cookedvalue $cpuper = [math]::round( ($cooked/2), 0) echo $cpuper } it looks get-counter has minimum sample time of 1 second. resulting in minimum execution time of 1 second per call. best bet counters front , counters interested in

mysql - how to set a multi-column unique in web2py -

in order make many many relation ship make middle table combine 2 tables ,the tables this: db.define_table('problem', field('task_id','reference task'), field('title','string',unique=true,length=255)) db.define_table('task', field('title','string',unique=true,length=255), field('course_id','reference courses')) db.define_table('belong', field('task_id','reference task'), field('problem_id','reference problem') ) db.belong.task_id.requires=is_in_db(db,'task.id','%(title)s') db.belong.problem_id.requires=is_in_db(db,'problem.id','%(title)s') i use sqlform insert belong table.i want there no duplicate task , problem. suppose there record (1,task1,problem1) already exist in belong table,then if choose task1 in sqlform,h

php - How to pass emails info stored in array to Mail::send using Gmail in Laravel 4.2 -

i want use laravel 4 send emails. list of emails , user names retrieved mysql below: [{"user_id":1,"first_name":"foo","last_name":"bar","email":"foobar@email.com"}, .. i able retrieve first name, last name , email mysql how pass mail:send function , use gmail send out emails? mail config has been set default settings , emails sent out using different sender name , email. app/config/mail.php return array( 'driver' => 'smtp', 'host' => 'smtp.gmail.com', 'port' => 465, 'from' => array('address' => 'my_gmail_username.gmail.com', 'name' => 'test email'), 'encryption' => 'ssl', 'username' => 'my_gmail_username', 'password' => 'my_gmail_password', 'sendmail' => '/usr/sbin/sendmail -bs', 'pret

Unable to compile array.writeToFile in Swift; but in ObjC its okay -

i'm going on assorted cocoa persistent-storage scenarios in swift. objective-c version compiles out incident: nsarray *ricarray = @[@"one",@"two",@"three"]; [ricarray writetofile:@"path" atomically:true]; however, swift version doesn't work. the compiler doesn't believe array has 'writetofile'. let docs = nssearchpathfordirectoriesindomains(.documentdirectory,.userdomainmask,true) array let pathtofile = docs[0].stringbyappendingstring("/myfile.txt") var shoppinglist:[string] = ["eggs", "milk"] shoppinglist.writetofile(pathtofile, atomically:true) ...swift:267:5: '[string]' not have member named 'writetofile' doing wrong? [string] swift's native array implementation, not nsarray ; swift's array not have writetofile() method. can, however, cast between two. should work: var shoppinglist:[string] = ["eggs", "milk"]

android - ListView Button does not update background properly -

i have listview , has layout utilizes imagebutton (btnadd). the problem having when press imagebutton within layout populated in listview imagebutton supposed change background grey green. this operation works properly, when there mulitple items in listview imagebutton background changes on bottom listview item , not listview's imagebutton clicked. what missing? should referencing item's position within listview? @override public view getitemview(final parseuser puser, view v, viewgroup parent) { if (v == null) { v = view.inflate(getcontext(), r.layout.search_detail, null); } super.getitemview(puser, v, parent); parseimageview todoimage = (parseimageview) v .findviewbyid(r.id.imageviewsearch); parsefile imagefile = puser.getparsefile("photo"); if (imagefile != null) { todoimage.setparsefile(imagefile); todoimage.loadinbackground(); }

android - setEmptyView() is not working for ExpandableListView -

when used setemptyview() method listview, worked. when used same method expandable listview, not working. else facing similar problem. why not working expandable listview. i wrote these 2 lines: mexpandlistview.setemptyview(emptyview); mexpandlistview.setadapter(adapter); where emptyview id of textview, should displayed if adapter empty. in advance.. please post code , check link listview / expandablelistview setemptyview() has no effect might can helpful you.

Find a book with reference number and issued date with Ruby on rails -

find book reference number , issued date. i creating books store ruby on rails, user type reference number , issued date display books only, not search function. t.integer reference t.datetime "created_at" how can possible work simple_form gem. book.where(reference: number, created_at: date).first

jquery - hide and display select tag by toggling other select tag -

i want display select option tag based on first selected option. here working demo <select id="main"> <option>all</option> <option clas="first_opt">first</option> <option class="second_opt">second</option> <option class="third_opt">third</option> </select> <select id="sub_first" class="sub"> <option>sub 1</option> <option>sub 1</option> </select> $(".sub").hide(); $("#main").change(function() { var val = $(this).val(); $(".sub").hide(); if( val ) { $("#sub_" + val).show(); } }) but dont think perfect coding because example, if value of main select option contains 2 or more 1 letter such "first opt" code doesnt work anymore. think better if can class value of main option instead. couldn't make works. please help ` your code working because of haven'

c# - Windows Phone 8.1 App on App Store Issue -

i have created windows phone 8.1 application, have created wcf service , called wcf service pc ip in app, have not hosted wcf service publicly on azure or etc, if upload app on windows phone store, run on device , on network? first app, don't know how deal with? so, please guide me using pc ip not recommended. first check, if can call wcf outside organization. pc ip change (dynamic ip). depends on isp, on don't have control. best thing host somewhere.

java - Syntax error on tokens, AnnotationName expected instead - error on query -

Image
i have received syntax error on tokens, annotationname expected instead occured on following line: query.findinbackground(new findcallback<parseuser>() { i have been trying troubleshoot since while, still having difficulties. below complete code public class fragment1 extends fragment { public interface constants { string log = "com.dooba.beta"; } private string currentuserid; private arrayadapter<string> namesarrayadapter; private arraylist<string> names; private arraylist<images> alprofilepicture; private listview userslistview; private button logoutbutton; string usergender = parseuser.getcurrentuser().getstring("gender"); string activityname = parseuser.getcurrentuser().getstring("activityname"); number maxdistance = parseuser.getcurrentuser().getnumber("maximum_distance"); string userlookinggender = parseuser.getcurrentuser().getstring("

how to display a edittext when radiobutton is clicked in android -

i have program computes perimeter, circumference, area of different shapes like, square, circle, rectangle , soon. enabling radiobutton display edittext write measurements. check below code don't use is, reference inyourxml.xml <radiogroup android:id="@+id/groupradio" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="@dimen/app_big_margin" android:layout_marginright="@dimen/app_normal_margin" android:gravity="center" android:minheight="30dp" android:orientation="horizontal" > <radiobutton android:id="@+id/circumferenceradio" android:layout_width="0dp" android:layout_height="fill_parent" android:layout_weight="1" android:background="@drawable/tab_selector_background" android:button="@null&quo

How can I generate hash codes with Scala -

i want generate non cryptographic hash code string in scala 2.11 i looked online , found class called murmurhash3 when try use unhelpful class murmurhash3 in package hashing cannot accessed in package scala.util.hashing why not able access package? there alternative? the class murmurhash3 private private[hashing] class murmurhash3 what need, companion object murmurhash3. don't try instantiate it. use it's methods, in static class util.hashing.murmurhash3.stringhash("")

Append html tag to table header Jquery -

i have kind of tr structure, need juqey add image beside link here structure have <tr> <th class="k-header" data-role="sortable"><a href="#" class="k-link">one</a></th> <th class="k-header" data-role="sortable"><a href="#" class="k-link">two</a></th> <th class="k-header" data-role="sortable"><a href="#" class="k-link">three</a></th> <th class="k-header" data-role="sortable"><a href="#" class="k-link">four</a></th> <th class="k-header" data-role="sortable"><a href="#" class="k-link">five</a></th> <th class="k-header" data-role="sortable"><a href="#" class="k-link">six</a></th> <

web services - The C# code generated by WebService missing in previous WebService version -

Image
recently encountered webservice problem while maintaining legacy project. project uses webservice. screen shot. you can see there no actual c# code generated webservcie. but when created cosole project , trying add webservice. can see genenrated code named reference.cs, , content below why previous 1 doesn't have cs file generated webservice? please view: microsoft legacy disco definition discomap way reference ref classes are, at: c:\windows\microsoft.net\framework\v2.0.50727\temporary asp.net files but that's legacy code. modern day .net have reference.cs created wsdl.exe

extjs - Horizontal Scroll bar to the Toolbar of the Tab Panel -

i have tabpanel addning dynamically tabs. when number of tabs increase become small . can have scrollbar toolbar of tab panel ? tab panel code : var centerpanel = new ext.tabpanel({ region: 'center', deferredrender: false, activetab: 0, autoscroll: true, items: [ <if starturl != ""> { title: "${startname}", html: "<iframe src='${starturl}' width='100%' height='100%' id='frame_${startname}' frameborder=0 name='name'/>" } </if> ] }); try set "mintabwidth" property of new tabs. default value 30 (px). set "autoscroll" of tabpanel true.

java - Driver for jdbc not found (only on servlet) -

i have problem connecting mysql databse servlet. here connection code private static void connecttodatabase(){ try{ static connection conn = null; static string url = "jdbc:mysql://localhost/database?userinfo"; conn = drivermanager.getconnection(url); class.forname("com.mysql.jdbc.driver"); system.out.println("connected"); } catch(classnotfoundexception wyjatek) { system.out.println("problem ze sterownikiem"); } catch(sqlexception wyjatek) { system.out.println("sqlexception: " + wyjatek.getmessage()); system.out.println("sqlstate: " + wyjatek.getsqlstate()); system.out.println("vendorerror: " + wyjatek.geterrorcode()); } } and doget protected void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { printwriter out = response.getwriter(); string param = request.

sql - Atomic string replacement in PHP -

in our web application, have class emulates prepared statements correct escaping of sql parameters. now, better use pdo , app old , refactoring quite long, time being wanted fix bug found. consider piece of code uses our classes: $s = q()->statement("select * dual 1 = :a , 2 = :b , 3 = :c"); $s->bindvalue('c', ':b'); $s->bindvalue('b', ':a'); $s->bindvalue('a', ':c'); var_dump($s->prepared); the first line creates statement, values bound, dump prepared statement. the result of following: select * dual 1 = ':c' , 2 = '':c'' , 3 = ''':c''' and happens because parameters substituted 1 @ time last first. i tried doing replacement in single function call, using str_replace() array parameters, no avail. so know if there way make operation somehow "atomic" if placeholder value valid placeholder not replaced. edit: here method of class re

android - Getting issues with ImageView invalidate in ListView -

i have customised list view in have taken imageview , textviews roeitems. in adapter each rowitem download image server , in handler update imageview downloaded image , invalidate imageview. below code handler - handler handler = new handler() { @override public void handlemessage(message msg) { imageview imgfileicon = (imageview) msg.obj; imgfileicon.setimagedrawable("my image path"); imgfileicon.invalidate(); } }; after doing imageview gets updated each row item, when scroll down list , come top images of imageview gets replaced each other. means imageview randomly changes images. not getting behaviour happening first time. can tell me if has faced same problem solution. thanks in advance.

jdbc - insert prepared statement in database with parameters -

in code i'm using prepared statement insert 7 parameters : connection.preparestatement(inserttablesql); preparedstatement.setstring(1,"31/07/12"); preparedstatement.setint(2, 1); preparedstatement.setint(3, 2); preparedstatement.setint(4, 3); preparedstatement.setint(5, 4); preparedstatement.setint(6, 4); preparedstatement.setfloat(7, 6); preparedstatement.executeupdate(); it work way , row inserted, whenever try bind parameter variable such as: int = 1; preparedstatement.setint(6, i); it doesnt work during execution, thread endlessly waiting without error , no row inserted. if row existed still exception unique constraint. doing wrong here? thanks.

java - Setting build path has encountered a Pproblem - A resource exists with a different case -

i have java project build path related folder deleted. want edit references while saving got following error - setting build path has encountered problem - resource exists different case , changes rejected. whats wrong ? thanks. close project, re-open , try again if doesn't work: close eclipse, re-open , try again if doesn't work: close project, manually edit .classpath file, re-open project

ms access - How to have at most n number of duplicates in a field -

Image
my question unique assume. wants rid of duplicates, me on other hand, want allow specified number of duplicates appear. i'm creating database reserving dates blood donation campaigns. my database consists of date of campaign, name of organizer, contact info & venue. additionally every campaign unique id number. catch is, can accommodate 5 campaigns per day, is: date column should allowed have @ 5 duplicates any ideas on how can achieved? if entering information directly table within access 2010 can add following before change data macro table: for more information on data macros see create data macro

javascript - window.opener doesn't work in firefox and chrome but in IE -

i have problem window.opener function (js): i created 3 simple pages simulate problem: test.php: <html> <head> </head> <body> <input type="button" onclick="window.open('first_page_in_popup.php', 'popup', 'width=470,height=500');"> <input type="text" id="content" name="content" > </body> </html> first_page_in_popup.php: <html> <head> <script type="text/javascript" > window.opener.document.getelementbyid('content').value= "test first page in popup"; window.open('second_page_in_popup.php', 'popup'); </script> </head> <body> </body> </html> second_page_in_popup.php: <html> <head> <script type="text/javascript" > window.o

vba - Apply formula to last cell in column -

i know question has been asked before question different, want search column last cell in column data in (which can do) want apply formula cell 4 columns on right. know can introduce formula cell doing following: dim formul variant formul -"=b25 * h25" activesheet.range("e" & rows.count).end(xlup).offset(, 4).resize(1).value = formula but problem begins, want below, instead of setting formula because multiplication of cells changing when more information being added sheet. formul -"=activesheet.range("e" & rows.count).end(xlup).offset(, 3).value * activesheet.range("e" & rows.count).end(xlup).offset(, -3).value" activesheet.range("e" & rows.count).end(xlup).offset(, 4).resize(1).value = formul i need way stated above because if change information on sheet wil updat automatically. you can use: activesheet.range("e" & rows.count).end(xlup).offset(, 4).formular1c1 = &qu

asp.net - C# Universal OleDb connection to Excel -

i have asp-mvc aplication allows user upload excel file. i'm supporting *.xls files (excel 97-2003) , *.xlsx files (excel 2007+). once file uploaded, program opens oledb connection excel file using 1 of available drivers: microsoft.ace.oledb.12.0 newest excel file formats. microsoft.jet.oledb.4.0 older excel file formats. what have @ moment of writing post if block of code checks mime-type of excel file opened , chooses correct driver opening oledb connection. can't support both file formats @ same time. if execute asp app in 64bit-mode , error: the 'microsoft.jet.oledb.4.0' provider not registered on local machine. if execute asp app in 32bit-mode , error: the 'microsoft.ace.oledb.12.0' provider not registered on local machine. if there universal microsoft oledb provider able connect versions of excel files? update: i'm running on 64bit version of windows server 2008 sp1 .net framework 4

How to store Gmail messages in Google Drive without using double storage space -

if have google account total amount of space available (for free) has been fixed 15 gb (at time being). how divide space between gmail , google drive (and other applications) you. i store gmail messages (received) on google drive , able see them in gmail without using double amount of storage. possible? i'm using google apps script. if store messages in native format (google document), size of document not account in storage quota. that's best option think. you can find more info in this doc google . in particular, here says google document , quota usage : items don't count toward storage limit google docs, sheets, slides, presentations, drawings, etc. files others have shared you

c++ - Pointer indirection issue -

this program produces 0 1 1 output against expected output 0 1 2. can explain why increment operator doesn't work prefix? #include <stdio.h> int main(void) { int i; int *ptr = (int *) malloc(5 * sizeof(int)); (i=0; i<5; i++) *(ptr + i) = i; printf("%d ", (*ptr)++); printf("%d ", *ptr); printf("%d ", *++ptr); return 0; } assume int *p = ptr : printf("%d ", (*ptr)++); // print ptr[0] increment ptr[0] ==> 0 printf("%d ", *ptr); // print ptr[0] ==> 1 printf("%d ", *++ptr); // increment ptr print p[1] ==> 1