Search Results

Search found 8673 results on 347 pages for 'kvm switch'.

Page 157/347 | < Previous Page | 153 154 155 156 157 158 159 160 161 162 163 164  | Next Page >

  • Error using iif in ms access query

    - by naveen
    I am trying to fire this query in MS Access SELECT file_number, IIF(invoice_type='Spent on Coding',SUM(CINT(invoice_amount)), 0) as CodingExpense FROM invoice GROUP BY file_number I am getting this error Error in list of function arguments: '=' not recognized. Unable to parse query text. I tried replacing IIF with SWITCH to no avail. What's wrong with my query and how to correct this?

    Read the article

  • Problem with C function of type char pointer, can someone explain?

    - by JJ
    Find the errors from following C function : char* f(int i) { int i; char buffer[20]; switch ( i ) { 1: strcpy( buffer, "string1"); 2: strcpy( buffer, "string2"); 3: strcpy( buffer, "string3"); default: strcpy(buffer, "defaultstring"); } return buffer; } this is c funtion not C++, I think it has to do with type conversion my compiler give warning that declaration of int i shadows a parameter.

    Read the article

  • Sending tweets using Android

    - by Saranya.R
    I want to send a tweet from Android.I have executed the following code.But I am not bale to send any tweets.Avtually the button I created is not working.Can anybody tel me wats the prob? This is my code.. package samplecode.sampleapp.sampletwidgitpublicintent; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.os.Bundle; public class TwidgitPublicIntent extends Activity implements OnClickListener { private static final int TWIDGIT_REQUEST_CODE = 2564; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ((Button)findViewById(R.id.tweet_button)).setOnClickListener(this); ((Button)findViewById(R.id.mention_button)).setOnClickListener(this); ((Button)findViewById(R.id.retweet_button)).setOnClickListener(this); ((Button)findViewById(R.id.message_button)).setOnClickListener(this); } public void onClick(View v) { switch(v.getId()) { case R.id.tweet_button: // Standard tweet Intent tIntent = new Intent("com.disretrospect.twidgit.TWEET"); tIntent.putExtra("com.disretrospect.twidgit.extras.MESSAGE", "_message_in_here_"); try { this.startActivityForResult(tIntent, TWIDGIT_REQUEST_CODE); } catch (ActivityNotFoundException e) { // If Twidgit is not installed } break; case R.id.mention_button: // Mention Intent mIntent = new Intent("com.disretrospect.twidgit.MENTION"); mIntent.putExtra("com.disretrospect.twidgit.extras.TO", "_username_to_xmention_"); mIntent.putExtra("com.disretrospect.twidgit.extras.MESSAGE", "_message_in_here_"); try { this.startActivityForResult(mIntent, TWIDGIT_REQUEST_CODE); } catch (ActivityNotFoundException e) { // If Twidgit is not installed } break; case R.id.retweet_button: // Retweet a tweet Intent rtIntent = new Intent("com.disretrospect.twidgit.RETWEET"); rtIntent.putExtra("com.disretrospect.twidgit.extras.MESSAGE", "_message_in_here_"); rtIntent.putExtra("com.disretrospect.twidgit.extras.VIA", "_original_author_of_tweet_name_"); try { this.startActivityForResult(rtIntent, TWIDGIT_REQUEST_CODE); } catch (ActivityNotFoundException e) { // If Twidgit is not installed } break; case R.id.message_button: // Send DM Intent dmIntent = new Intent("com.disretrospect.twidgit.DIRECT_MESSAGE"); dmIntent.putExtra("com.disretrospect.twidgit.extras.TO", "_username_to_send_dm_to_"); dmIntent.putExtra("com.disretrospect.twidgit.extras.MESSAGE", "_message_in_here_"); try { this.startActivityForResult(dmIntent, TWIDGIT_REQUEST_CODE); } catch (ActivityNotFoundException e) { // If Twidgit is not installed } break; } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // Check result code if(resultCode == Activity.RESULT_OK) { // Check requestCode switch(requestCode) { case TWIDGIT_REQUEST_CODE: // Handle successful return break; } } else if(resultCode == Activity.RESULT_CANCELED){ // Handle canceled activity } } }

    Read the article

  • Detect pointer arithmetics because of LARGEADDRESSAWARE

    - by Suma
    I would like to switch my application to LARGEADDRESSAWARE. One of issues to watch for is pointer arithmetic, as pointer difference can no longer be represented as signed 32b. Is there some way how to find automatically all instances of pointer subtraction in a large C++ project? If not, is there some "least effort" manual or semi-automatic method how to achieve this?

    Read the article

  • How to store multiple scroll positions for scrolling div element depending on active View in MultiView (asp.net webform

    - by Spence
    confusing title but the best way I can put it. Basically I am currently using a single div with overflow:auto that contains different GridViews. The GridViews are swapped by using a MultiView with each indiviudal view containing a single GridView. I would like to be able to store the scroll position of each view so that I can set the div's scroll position depending on the view that will be switched to. Here is how my page is set up. <div id="scrollingDiv" style="height:100%; overflow:auto;"> <div id="gridWrap"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline"> <ContentTemplate> <asp:MultiView ID="MultiView1" runat="server"> <asp:View ID="view1" runat="server"> <asp:GridView ID="gridView1" runat="server"> </asp:GridView> </asp:View> <asp:View ID="view2" runat="server"> <asp:GridView ID="gridView2" runat="server"> </asp:GridView> </asp:View> </asp:Multiview> </ContentTemplate> </asp:UpdatePanel> </div> </div> So scrollingDiv will contain all the Views and will scroll for each one of the GridViews. To switch between views I have a drop down connected to an protected void DropDownList_SelectedIndexChanged(object sender, EventArgs e) { switch (DownList.SelectedItem.Value) { case "view1": MultiView1.SetActiveView(view1); break; case "view2": MultiView1.SetActiveView(view2); break; } } I have been looking around and can't quite find something specific to my case. I would like to be able to use just the one overflow div but would understand if I had to make a separate overflow div for each view. Any help would be great, Thanks.

    Read the article

  • 301 redirects in .htaccess on apache

    - by WhitechapelTom
    I guess this should be straightforward but my host got me to switch server from zeus to apache following which the .htaccess file with existing individual 301 redirects failed to work causing an internal server error, so have commented them out for the time being. Could someone explain how to set these up to work in their new apache context? Have no apache experience Example redirect: Redirect 301 /pages/exhibitions/thegreatindoors.html http://www.klassnik.com/pages/thegreatindoors.html Read a lot about mod rewrites etc but not sure what to write. Thanks

    Read the article

  • Have you actually convinced anybody to Scala?

    - by Lukasz Lew
    I had limited success myself. I was able to hype a few persons about Scala. But in fact none of them made a meaningful effort to try to switch (usually from Java). I would like to read both success and failure stories here. Both long tries and short ones. My goal is to find ways of presenting Scala to another person, friend, co-worker (not an audience) that will make them want to use this great language.

    Read the article

  • Notepad++ replacement

    - by bah
    Hi, I've been using notepad++ for a while now, but i noticed it doesn't have code snippets (i found quicktext plugin, but it doesn't work anymore), so i'd like to switch editor and my requirements would be: Fast startup. Code snippets. Ability to use themes. File tree view (or plugin, which does that). What are you using? Thank you all for suggestions!

    Read the article

  • Special functions in Matlab

    - by favala
    I'm trying to get a picture like the following: http://upload.wikimedia.org/wikipedia/en/e/e6/Airy-3d.svg What am I doing wrong? [x,y]=meshgrid(-1:.1:1,-1:.1:1); surf(x,y,(2*besselj(1,2*pi*sqrt(x.^2+ y.^2)/sqrt(x.^2+ y.^2)).^2) Also... kind of a side note, but if I used ndgrid instead of meshgrid here my x's and y's would switch right?

    Read the article

  • Finding subtitute pluggin (After Switching from Notepad++ to Netbeans 6.8)

    - by justjoe
    i would like to ask about some Notepad++ feature that i couldn't find in netbeans. And this feature is somehow really helpful. It's called 'function list' created by Jens Lorenz. this feature will list all of declared function in a PHP files. So, is there any subtitute plugin that i can use to smooth my migration from Notepad++ to Netbeans ? the main reason i switch is for svn, Phpdoc-support, and easiness maintaining medium-size web project.

    Read the article

  • Overfocus in GridView

    - by chuck258
    I'm trying to implement a GridView that Focuses the next Item and "Overscrolls at the End of a List. E.g. 1 2 3 4 5 6 7 8 9 I want to scroll 1 2 3 4 5 6 ... just by pressing the right Key. Right now I can only Scroll 1 2 3 and then it stops and I have to scroll with the down Key. I already tried to set the focusViews in code (In the getView() method of my ArrayList Adapter, that fills the GridView) view.setId(position); view.setNextFocusLeftId(position-1); view.setNextFocusRightId(position+1); But that doesn't work. I found the boolean *Scroll(int direction) Methods on grepcode But theese are Package Local and I can't overwrite them. Any suggestions on how to solve this. Can I use another View and get the same Layout as a Gridview? I also set a OnFocusChangeListener to see what happens with no reaction. Edit: I just added this to my MainActivity, but now it seems to onKeyDown only get called when the GridView doesn't handle the KeyEvent (If the Last Item in a row is selected). @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: if (focusedView > 0) { mContainer.setSelection(--focusedView); Log.v("TEST", focusedView+""); } return true; case KeyEvent.KEYCODE_DPAD_RIGHT: if (focusedView < mAdapter.getCount() - 1) { mContainer.setSelection(++focusedView); Log.v("TEST", focusedView+""); } return true; } return super.onKeyDown(keyCode, event); } Edit 2: This is so f***ing stupid but works so damn fine :D @Override public boolean onKeyDown(int keyCode, KeyEvent event) { switch (keyCode) { case KeyEvent.KEYCODE_DPAD_LEFT: mContainer.onKeyDown(KeyEvent.KEYCODE_DPAD_UP, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_UP)); mContainer.onKeyDown(KeyEvent.KEYCODE_DPAD_RIGHT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_RIGHT)); mContainer.onKeyDown(KeyEvent.KEYCODE_DPAD_RIGHT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_RIGHT)); return true; case KeyEvent.KEYCODE_DPAD_RIGHT: mContainer.onKeyDown(KeyEvent.KEYCODE_DPAD_DOWN, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_DOWN)); mContainer.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT)); mContainer.onKeyDown(KeyEvent.KEYCODE_DPAD_LEFT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DPAD_LEFT)); return true; } return super.onKeyDown(keyCode, event); } I really don't want to post this as Answer, and I really don't want to have to use this Code because it is such a stupid workaround ;TLDR: Help still needed

    Read the article

  • How to call a set of variables functions based on class on a group of elements

    - by user1547007
    I have the following html code: <i class="small ele class1"></i> <i class="medium ele class1"></i> <i class="large ele class1"></i> <div class="clear"></div> <i class="small ele class2"></i> <i class="medium ele class2"></i> <i class="large ele class2"></i> <div class="clear"></div> <i class="small ele class3"></i> <i class="medium ele class3"></i> <i class="large ele class3"></i> <div class="clear"></div> <i class="small ele class4"></i> <i class="medium ele class4"></i> <i class="large ele class4"></i>? And my javascript looks like so: var resize = function(face, s) { var bb = face.getBBox(); console.log(bb); var w = bb.width; var h = bb.height; var max = w; if (h > max) { max = h; } var scale = s / max; var ox = -bb.x+((max-w)/2); var oy = -bb.y+((max-h)/2); console.log(s+' '+h+' '+bb.y); face.attr({ "transform": "s" + scale + "," + scale + ",0,0" + "t" + ox + "," + oy }); } $('.ele').each(function() { var s = $(this).innerWidth(); var paper = Raphael($(this)[0], s, s); var face = $(this).hasClass("class1") ? class1Generator(paper) : class4Generator(paper); /*switch (true) { case $(this).hasClass('class1'): class1Generator(paper); break; case $(this).hasClass('class2'): class2Generator(paper) break; case $(this).hasClass('class3'): class3Generator(paper) break; case $(this).hasClass('class4'): class4Generator(paper) break; }*/ resize(face, s); }); my question is, how could I make this line of code more scalable? I tried using a switch but The script below is calling two functions if one of the elements has a class, but what If i have 10 classes? I don't think is the best solution I created a jsFiddle http://jsfiddle.net/7uUgz/6/ //var face = $(this).hasClass("awesome") ? awesomeGenerator(paper) : awfulGenerator(paper);

    Read the article

  • timing control for parallel processes

    - by omrihsan
    how can i control two processes to run alternately in separate terminal windows. for example i run the code for each on separate terminal windows at 11:59 and both of them wait for the time to be 12:00. at this moment process one starts execution and process two waits for say 10 seconds. then they switch, process two executes and process one waits. in this way they take turns until the process is complete.

    Read the article

  • Alias for a C++ template?

    - by porgarmingduod
    typedef boost::interprocess::managed_shared_memory::segment_manager segment_manager_t; // Works fine, segment_manager is a class typedef boost::interprocess::adaptive_pool allocator_t; // Can't do this, adaptive_pool is a template The idea is that if I want to switch between boost interprocess' several different options for shared memory and allocators, I just modify the typedefs. Unfortunately the allocators are templates, so I can't typedef the allocator I want to use. Is there a way to achieve an alias to a template in C++? (Except for the obvious #define ALLOCATOR_T boost::interprocess::adaptive_pool)

    Read the article

  • Django: auto minifying css/js files before release

    - by Dzida
    Hi, I have following case: I want to use uncompressed js/css files during development (to debug js for example) but on production I want to switch automatically to minified versions of that files. some simple solution is to put in your template: <script src="some_js.{% if not debug %}min.{% endif %}js".... but this require manully providing that such file exist and to do minifaction manullay after original file change. How do you accomplish this in your projects? Is there any tool for this?

    Read the article

  • I try to hook a character from javascript keydown event

    - by user523978
    I would like to hook a character typed in an input text field and type '1' in the field in case 'a' was pressed. Here is the code: <html> function translate_code(charCode) { switch (charCode) { case 65: // return '1' ; case 97: return '9'; } } function noEnglish(event) { if (event.charCode) { var charCode = event.charCode; } else { var charCode = event.keyCode; } if (65

    Read the article

  • How do you search the text of changelist descriptions in Perforce?

    - by raven
    On occasion, I find myself wanting to search the text of changelist descriptions in Perforce. There doesn't appear to be a way to do this in P4V. I can do it by redirecting the output of the changes command to a file... p4 changes -l > p4changes.txt ...(the -l switch tells it to dump the full text of the changelist descriptions) and then searching the file, but this is rather cumbersome. Has anyone found a better way?

    Read the article

  • QTreeView incorrectly displays the SpinBox if item is checkable and when using QWindowsStyle

    - by Sharraz
    Hello, I'm having a problem with a QTreeView in my program: The SpinBox used to edit the double value of a checkable item is displayed incorrectly when using the Windows style. Only the up and down buttons of the SpinBox can be seen, but not any value. The following example code is able to reproduce the problem: #include <QtGui> class Model : public QAbstractItemModel { public: Model() : checked(false), number(0) {} Qt::ItemFlags flags(const QModelIndex & index) const { return Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable; } QVariant data(const QModelIndex &index, int role) const { switch (role) { case Qt::DisplayRole: case Qt::EditRole: return QVariant(number); case Qt::CheckStateRole: return QVariant(checked ? Qt::Checked : Qt::Unchecked); } return QVariant(); } QVariant headerData(int section, Qt::Orientation orientation, int role) const { return QVariant(); } int rowCount(const QModelIndex &parent) const { return parent.isValid() ? 0 : 1; } int columnCount(const QModelIndex &parent) const { return parent.isValid() ? 0 : 1; } bool setData(const QModelIndex &index, const QVariant &value, int role) { switch (role) { case Qt::EditRole: number = value.toDouble(); emit dataChanged(index, index); return true; case Qt::CheckStateRole: checked = value.toInt(); emit dataChanged(index, index); return true; } return false; } QModelIndex index(int row, int column, const QModelIndex &parent) const { if (!row && !column && !parent.isValid()) return createIndex(0, 0); return QModelIndex(); } QModelIndex parent(const QModelIndex &child) const { return QModelIndex(); } private: bool checked; double number; }; int main(int argc, char *argv[]) { QApplication app(argc, argv); QApplication::setStyle(new QWindowsStyle()); QTreeView tree; tree.setModel(new Model()); tree.show(); return app.exec(); } The problems seems to have something to do with the checkbox. If Qt::ItemIsUserCheckable is removed, the SpinBox will be displayed correctly. If the number is replaced by a longer one like 0.01, it can be seen partially. Any idea how this problem can be solved? Do I use the checkbox correctly? Greets, Sharraz

    Read the article

  • Convert dependencies to point to View instead of Table

    - by jwarzech
    I currently have a SQL Server 2008 database in which I am planning to separate out some tables to other databases. I want to be able to replace all references to the separated tables from the original database using views. Is there a better way (other than manually changing all FK and SProc references) to switch all the dependencies to reference the view instead of the table?

    Read the article

  • I can't get ExternalInterface.addCallback to work - trying to call an AS3 function from a js button

    - by Guillaume Riesen
    I'm trying to use ExternalInterface.addCallback to allow js to call an as3 method. My code is as follows: AS: ExternalInterface.addCallback("sendToActionscript", callFromJavaScript); function callFromJavaScript():void{ circle_mc.gotoAndStop("finish"); } JS: Switch to square function callToActionscript() { flashController = document.getElementById("jstoactest") flashController.sendToActionscript(); } It's not working. What am I doing wrong?

    Read the article

  • How do i detect the deprecated methods in a program?

    - by manus91
    I've searched through the web and what I've found out is this: To make the compiler warn you of the details of which methods you used that were deprecated use the javac.exe -deprecation switch. Then look in the Javadoc for the deprecated methods to find out the recommended replacements. Sometimes you just have to rename. Sometimes the replacements work quite differently. But I'm not really understand how it works, can anybody help me with this?

    Read the article

  • Can I Force A ASP.Net Website to Show Time in A Specific Time Zone?

    - by KevDog
    I have a client request that all times be displayed in Pacific Time Zone, regardless of client settings. I'd like to avoid a scenario where I have to call a function for every time display and instead have a single point where I can make the switch. I'm thinking a custom culture might do the trick, but I wanted to ask before I set off down a potentially blind alley (or miss something trivially easy).

    Read the article

  • Correct to check for a command line flag in bash

    - by BCS
    In the middle of a scrip, I want to check if a given flag was passed on the command line. The following does what I want but seems ugly: if echo $* | grep -e "--flag" -q then echo ">>>> Running with flag" else echo ">>>> Running without flag" fi Is there a better way? Note: I explicitly don't want to list all the flags in a switch/getopt. (And BTW the bodies of the if just set a set of vars)

    Read the article

< Previous Page | 153 154 155 156 157 158 159 160 161 162 163 164  | Next Page >