Search Results

Search found 3798 results on 152 pages for 'col zero'.

Page 2/152 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Gateway IP Returns to Zero

    - by Robert Smith
    When you set a static IP under Ubuntu 12.04.1, you must supply the desired machine IP and the gateway IP, all using the Network Manager. When I first entered them and rebooted, everything worked great. On the second boot, however, Firefox could find no Web page. Upon checking, I discovered that the gateway IP had returned to zero. Now, no matter how often I resupply it, it returns to zero immediately after NM "saves" it: that is, appears as zero when redisplayed. The only way I can get to the Internet is to restore DHCP operation. I need to use static IP for access to my home network. Would appreciate any suggestion. --Robert Smith

    Read the article

  • Should integer divide by zero halt execution?

    - by Pyrolistical
    I know that modern languages handle integer divide by zero as an error just like the hardware does, but what if we could design a whole new language? Ignoring existing hardware, what should a programming language does when an integer divide by zero occurs? Should it return a NaN of type integer? Or should it mirror IEEE 754 float and return +/- Infinity? Or is the existing design choice correct, and an error should be thrown? Is there a language that handles integer divide by zero nicely? EDIT When I said ignore existing hardware, I mean don't assume integer is represented as 32 bits, it can be represented in anyway you can to imagine.

    Read the article

  • have list of emails to be deleted from sheet A col D [on hold]

    - by Peta
    Thank you for your comments guys & now that CharlieRB has suggested "Match entire cell contents" I'll give it a better go. No I do not expect people to do my work for me & I'm sorry if it came over that way - just didn't know where to start. Would love some help please, I've limited VBA & function knowledge & I'm not sure where to start. If someone can point me in the right direction it would be appreciated. I have a list of email addresses on sheet "B" col A (but I could put them on sheet A if it would make it easier / faster) that I want deleted from sheet "A" col D (may be 2 or more occurences of the same email). I can't just record a find & delete macro and edit because for example [email protected] will also pick up [email protected] which I may not want deleted. thanks very much Peta

    Read the article

  • Bizarre WHERE col = NULL behavior

    - by Kenneth
    This is a problem one of our developers brought to me. He stumbled across an old stored procedure which used 'WHERE col = NULL' several times. When the stored procedure is executed it returns data. If the query inside the stored procedure is executed manually it will not return data unless the 'WHERE col = NULL' references are changed to 'WHERE col IS NULL'. Can anyone explain this behavior?

    Read the article

  • Enum types, FlagAttribute & Zero value

    - by nmgomes
    We all know about Enums types and use them every single day. What is not that often used is to decorate the Enum type with the FlagsAttribute. When an Enum type has the FlagsAttribute we can assign multiple values to it and thus combine multiple information into a single enum. The enum values should be a power of two so that a bit set is achieved. Here is a typical Enum type: public enum OperationMode { /// <summary> /// No operation mode /// </summary> None = 0, /// <summary> /// Standard operation mode /// </summary> Standard = 1, /// <summary> /// Accept bubble requests mode /// </summary> Parent = 2 } In such scenario no values combination are possible. In the following scenario a default operation mode exists and combination is used: [Flags] public enum OperationMode { /// <summary> /// Asynchronous operation mode /// </summary> Async = 0, /// <summary> /// Synchronous operation mode /// </summary> Sync = 1, /// <summary> /// Accept bubble requests mode /// </summary> Parent = 2 } Now, it’s possible to do statements like: [DefaultValue(OperationMode.Async)] [TypeConverter(typeof(EnumConverter))] public OperationMode Mode { get; set; } /// <summary> /// Gets a value indicating whether this instance supports request from childrens. /// </summary> public bool IsParent { get { return (this.Mode & OperationMode.Parent) == OperationMode.Parent; } } or switch (this.Mode) { case OperationMode.Sync | OperationMode.Parent: Console.WriteLine("Sync,Parent"); break;[…]  But there is something that you should never forget: Zero is the absorber element for the bitwise AND operation. So, checking for OperationMode.Async (the Zero value) mode just like the OperationMode.Parent mode makes no sense since it will always be true: (this.Mode & 0x0) == 0x0 Instead, inverse logic should be used: OperationMode.Async = !OperationMode.Sync public bool IsAsync { get { return (this.Mode & ContentManagerOperationMode.Sync) != ContentManagerOperationMode.Sync; } } or public bool IsAsync { get { return (int)this.Mode == 0; } } Final Note: Benefits Allow multiple values combination The above samples snippets were taken from an ASP.NET control and enabled the following markup usage: <my:Control runat="server" Mode="Sync,Parent"> Drawback Zero value is the absorber element for the bitwise AND operation Be very carefully when evaluating the Zero value, either evaluate the enum value as an integer or use inverse logic.

    Read the article

  • What's wrong with my destructor?

    - by Ahmed Sharara
    // Sparse Array Assignment.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> using namespace std; struct node{ int row; int col; int value; node* next_in_row; node* next_in_col; }; class MultiLinkedListSparseArray { private: char *logfile; node** rowPtr; node** colPtr; // used in constructor node* find_node(node* out); node* ins_node(node* ins,int col); node* in_node(node* ins,node* z); node* get(node* in,int row,int col); bool exist(node* so,int row,int col); node* dummy; int rowd,cold; //add anything you need public: MultiLinkedListSparseArray(int rows, int cols); ~MultiLinkedListSparseArray(); void setCell(int row, int col, int value); int getCell(int row, int col); void display(); void log(char *s); void dump(); }; MultiLinkedListSparseArray::MultiLinkedListSparseArray(int rows,int cols){ rowPtr=new node* [rows+1]; colPtr=new node* [cols+1]; for(int n=0;n<=rows;n++) rowPtr[n]=NULL; for(int i=0;i<=cols;i++) colPtr[i]=NULL; rowd=rows;cold=cols; } MultiLinkedListSparseArray::~MultiLinkedListSparseArray(){ cout<<"array is deleted"<<endl; for(int i=rowd;i>=0;i--){ for(int j=cold;j>=0;j--){ if(exist(rowPtr[i],i,j)) delete get(rowPtr[i],i,j); } } // it stops in the last loop & doesnt show the done word cout<<"done"<<endl; delete [] rowPtr; delete [] colPtr; delete dummy; } void MultiLinkedListSparseArray::log(char *s){ logfile=s; } void MultiLinkedListSparseArray::setCell(int row,int col,int value){ if(exist(rowPtr[row],row,col)){ (*get(rowPtr[row],row,col)).value=value; } else{ if(rowPtr[row]==NULL){ rowPtr[row]=new node; (*rowPtr[row]).value=value; (*rowPtr[row]).row=row; (*rowPtr[row]).col=col; (*rowPtr[row]).next_in_row=NULL; (*rowPtr[row]).next_in_col=NULL; } else if((*find_node(rowPtr[row])).col<col){ node* out; out=find_node(rowPtr[row]); (*out).next_in_row=new node; (*((*out).next_in_row)).col=col; (*((*out).next_in_row)).row=row; (*((*out).next_in_row)).value=value; (*((*out).next_in_row)).next_in_row=NULL; } else if((*find_node(rowPtr[row])).col>col){ node* ins; ins=in_node(rowPtr[row],ins_node(rowPtr[row],col)); node* g=(*ins).next_in_row; (*ins).next_in_row=new node; (*((*ins).next_in_row)).col=col; (*(*ins).next_in_row).row=row; (*(*ins).next_in_row).value=value; (*(*ins).next_in_row).next_in_row=g; } } } int MultiLinkedListSparseArray::getCell(int row,int col){ return (*get(rowPtr[row],row,col)).value; } void MultiLinkedListSparseArray::display(){ for(int i=1;i<=5;i++){ for(int j=1;j<=5;j++){ if(exist(rowPtr[i],i,j)) cout<<(*get(rowPtr[i],i,j)).value<<" "; else cout<<"0"<<" "; } cout<<endl; } } node* MultiLinkedListSparseArray::find_node(node* out) { while((*out).next_in_row!=NULL) out=(*out).next_in_row; return out; } node* MultiLinkedListSparseArray::ins_node(node* ins,int col){ while(!((*ins).col>col)) ins=(*ins).next_in_row; return ins; } node* MultiLinkedListSparseArray::in_node(node* ins,node* z){ while((*ins).next_in_row!=z) ins=(*ins).next_in_col; return ins; } node* MultiLinkedListSparseArray::get(node* in,int row,int col){ dummy=new node; dummy->value=0; while((*in).col!=col){ if((*in).next_in_row==NULL){ return dummy; } in=(*in).next_in_row; } return in; } bool MultiLinkedListSparseArray::exist(node* so,int row,int col){ if(so==NULL) return false; else{ while((*so).col!=col){ if((*so).next_in_row==NULL) return false; else so=(*so).next_in_row; } return true; } }

    Read the article

  • Negamax implementation doesn't appear to work with tic-tac-toe

    - by George Jiglau
    I've implemented Negamax as it can be found on wikipedia, which includes alpha/beta pruning. However, it seems to favor a losing move, which should be an invalid result. The game is Tic-Tac-Toe, I've abstracted most of the game play so it should be rather easy to spot an error within the algorithm. Here is the code, nextMove, negamax or evaluate are probably the functions that contain the fault: #include <list> #include <climits> #include <iostream> //#define DEBUG 1 using namespace std; struct Move { int row, col; Move(int row, int col) : row(row), col(col) { } Move(const Move& m) { row = m.row; col = m.col; } }; struct Board { char player; char opponent; char board[3][3]; Board() { } void read(istream& stream) { stream >> player; opponent = player == 'X' ? 'O' : 'X'; for(int row = 0; row < 3; row++) { for(int col = 0; col < 3; col++) { char playa; stream >> playa; board[row][col] = playa == '_' ? 0 : playa == player ? 1 : -1; } } } void print(ostream& stream) { for(int row = 0; row < 3; row++) { for(int col = 0; col < 3; col++) { switch(board[row][col]) { case -1: stream << opponent; break; case 0: stream << '_'; break; case 1: stream << player; break; } } stream << endl; } } void do_move(const Move& move, int player) { board[move.row][move.col] = player; } void undo_move(const Move& move) { board[move.row][move.col] = 0; } bool isWon() { if (board[0][0] != 0) { if (board[0][0] == board[0][1] && board[0][1] == board[0][2]) return true; if (board[0][0] == board[1][0] && board[1][0] == board[2][0]) return true; } if (board[2][2] != 0) { if (board[2][0] == board[2][1] && board[2][1] == board[2][2]) return true; if (board[0][2] == board[1][2] && board[1][2] == board[2][2]) return true; } if (board[1][1] != 0) { if (board[0][1] == board[1][1] && board[1][1] == board[2][1]) return true; if (board[1][0] == board[1][1] && board[1][1] == board[1][2]) return true; if (board[0][0] == board[1][1] && board[1][1] == board[2][2]) return true; if (board[0][2] == board [1][1] && board[1][1] == board[2][0]) return true; } return false; } list<Move> getMoves() { list<Move> moveList; for(int row = 0; row < 3; row++) for(int col = 0; col < 3; col++) if (board[row][col] == 0) moveList.push_back(Move(row, col)); return moveList; } }; ostream& operator<< (ostream& stream, Board& board) { board.print(stream); return stream; } istream& operator>> (istream& stream, Board& board) { board.read(stream); return stream; } int evaluate(Board& board) { int score = board.isWon() ? 100 : 0; for(int row = 0; row < 3; row++) for(int col = 0; col < 3; col++) if (board.board[row][col] == 0) score += 1; return score; } int negamax(Board& board, int depth, int player, int alpha, int beta) { if (board.isWon() || depth <= 0) { #if DEBUG > 1 cout << "Found winner board at depth " << depth << endl; cout << board << endl; #endif return player * evaluate(board); } list<Move> allMoves = board.getMoves(); if (allMoves.size() == 0) return player * evaluate(board); for(list<Move>::iterator it = allMoves.begin(); it != allMoves.end(); it++) { board.do_move(*it, -player); int val = -negamax(board, depth - 1, -player, -beta, -alpha); board.undo_move(*it); if (val >= beta) return val; if (val > alpha) alpha = val; } return alpha; } void nextMove(Board& board) { list<Move> allMoves = board.getMoves(); Move* bestMove = NULL; int bestScore = INT_MIN; for(list<Move>::iterator it = allMoves.begin(); it != allMoves.end(); it++) { board.do_move(*it, 1); int score = -negamax(board, 100, 1, INT_MIN + 1, INT_MAX); board.undo_move(*it); #if DEBUG cout << it->row << ' ' << it->col << " = " << score << endl; #endif if (score > bestScore) { bestMove = &*it; bestScore = score; } } if (!bestMove) return; cout << bestMove->row << ' ' << bestMove->col << endl; #if DEBUG board.do_move(*bestMove, 1); cout << board; #endif } int main() { Board board; cin >> board; #if DEBUG cout << "Starting board:" << endl; cout << board; #endif nextMove(board); return 0; } Giving this input: O X__ ___ ___ The algorithm chooses to place a piece at 0, 1, causing a guaranteed loss, do to this trap(nothing can be done to win or end in a draw): XO_ X__ ___ Perhaps it has something to do with the evaluation function? If so, how could I fix it?

    Read the article

  • Zero to Cloud : One stop shop for resources to accelerate your transformation to enterprise private cloud

    - by Anand Akela
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} During the Oracle Open World 2012 last week, Oracle introduced "Zero to Cloud" resource center to help you accelerate your transformation journey to enterprise private cloud. To help organizations deploy fully operational, enterprise-grade private cloud environment in as little as half a day, Oracle has brought key content together into this single, user-friendly resource center. Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} The resource center is launched just as the Oracle Cloud Builder Summit series moves into full swing. Designed for executives, cloud architects, and IT operations professionals, the day-long event series will eventually reach nearly 100 cities around the globe. During this event, an interactive "Zero to Cloud" session will showcase the transformational journey of a fictitious enterprise to the private cloud using the latest solutions from Oracle—including, Oracle Database, Oracle Fusion Middleware, Oracle VM and Oracle Enterprise Manager, as well as Oracle’s full range of engineered systems. The online "Zero to Cloud" resource center includes best practices from Oracle experts and early adopter customers as well as interviews with Oracle development executives responsibly for Oracle’s private cloud solutions and roadmap. It also includes a new self-assessment quiz that can help determine readiness for a successful private cloud deployment. Once you've determined organizational readiness, explore early adopter tips, demos, guides, exclusive white papers and more at the "Zero to Cloud" resource center.

    Read the article

  • Why is my simple recusive method for this game always off by 1?

    - by FrankTheTank
    I'm attempting to create a text-based version of this game: http://www.cse.nd.edu/java/SameGame.html Here is the code I have so far: #include <iostream> #include <vector> #include <ctime> class Clickomania { public: Clickomania(); std::vector<std::vector<int> > board; int move(int, int); bool isSolved(); void print(); void pushDown(); bool isValid(); }; Clickomania::Clickomania() : board(12, std::vector<int>(8,0)) { srand((unsigned)time(0)); for(int i = 0; i < 12; i++) { for(int j = 0; j < 8; j++) { int color = (rand() % 3) + 1; board[i][j] = color; } } } void Clickomania::pushDown() { for(int i = 0; i < 8; i++) { for(int j = 0; j < 12; j++) { if (board[j][i] == 0) { for(int k = j; k > 0; k--) { board[k][i] = board[k-1][i]; } board[0][i] = 0; } } } } int Clickomania::move(int row, int col) { bool match = false; int totalMatches = 0; if (row > 12 || row < 0 || col > 8 || col < 0) { return 0; } int currentColor = board[row][col]; board[row][col] = 0; if ((row + 1) < 12) { if (board[row+1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row+1, col); } } if ((row - 1) >= 0) { if (board[row-1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row-1, col); } } if ((col + 1) < 8) { if (board[row][col+1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col+1); } } if ((col - 1) >= 0) { if (board[row][col-1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col-1); } } return totalMatches; } void Clickomania::print() { for(int i = 0; i < 12; i++) { for(int j = 0; j < 8; j++) { std::cout << board[i][j]; } std::cout << "\n"; } } int main() { Clickomania game; game.print(); int row; int col; std::cout << "Enter row: "; std::cin >> row; std::cout << "Enter col: "; std::cin >> col; int numDestroyed = game.move(row,col); game.print(); std::cout << "Destroyed: " << numDestroyed << "\n"; } The method that is giving me trouble is my "move" method. This method, given a pair of coordinates, should delete all the squares at that coordinate with the same number and likewise with all the squares with the same number connected to it. If you play the link I gave above you'll see how the deletion works on a click. int Clickomania::move(int row, int col) { bool match = false; int totalMatches = 0; if (row > 12 || row < 0 || col > 8 || col < 0) { return 0; } int currentColor = board[row][col]; board[row][col] = 0; if ((row + 1) < 12) { if (board[row+1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row+1, col); } } if ((row - 1) >= 0) { if (board[row-1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row-1, col); } } if ((col + 1) < 8) { if (board[row][col+1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col+1); } } if ((col - 1) >= 0) { if (board[row][col-1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col-1); } } return totalMatches; } My move() method above works fine, as in, it will delete the appropriate "blocks" and replace them with zeros. However, the number of destroyed (value returned) is always one off (too small). I believe this is because the first call of move() isn't being counted but I don't know how to differentiate between the first call or subsequent calls in that recursive method. How can I modify my move() method so it returns the correct number of destroyed blocks?

    Read the article

  • Why is my simple recusive method's final return value always off by 1?

    - by FrankTheTank
    I'm attempting to create a text-based version of this game: http://www.cse.nd.edu/java/SameGame.html Here is the code I have so far: #include <iostream> #include <vector> #include <ctime> class Clickomania { public: Clickomania(); std::vector<std::vector<int> > board; int move(int, int); bool isSolved(); void print(); void pushDown(); bool isValid(); }; Clickomania::Clickomania() : board(12, std::vector<int>(8,0)) { srand((unsigned)time(0)); for(int i = 0; i < 12; i++) { for(int j = 0; j < 8; j++) { int color = (rand() % 3) + 1; board[i][j] = color; } } } void Clickomania::pushDown() { for(int i = 0; i < 8; i++) { for(int j = 0; j < 12; j++) { if (board[j][i] == 0) { for(int k = j; k > 0; k--) { board[k][i] = board[k-1][i]; } board[0][i] = 0; } } } } int Clickomania::move(int row, int col) { bool match = false; int totalMatches = 0; if (row > 12 || row < 0 || col > 8 || col < 0) { return 0; } int currentColor = board[row][col]; board[row][col] = 0; if ((row + 1) < 12) { if (board[row+1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row+1, col); } } if ((row - 1) >= 0) { if (board[row-1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row-1, col); } } if ((col + 1) < 8) { if (board[row][col+1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col+1); } } if ((col - 1) >= 0) { if (board[row][col-1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col-1); } } return totalMatches; } void Clickomania::print() { for(int i = 0; i < 12; i++) { for(int j = 0; j < 8; j++) { std::cout << board[i][j]; } std::cout << "\n"; } } int main() { Clickomania game; game.print(); int row; int col; std::cout << "Enter row: "; std::cin >> row; std::cout << "Enter col: "; std::cin >> col; int numDestroyed = game.move(row,col); game.print(); std::cout << "Destroyed: " << numDestroyed << "\n"; } The method that is giving me trouble is my "move" method. This method, given a pair of coordinates, should delete all the squares at that coordinate with the same number and likewise with all the squares with the same number connected to it. If you play the link I gave above you'll see how the deletion works on a click. int Clickomania::move(int row, int col) { bool match = false; int totalMatches = 0; if (row > 12 || row < 0 || col > 8 || col < 0) { return 0; } int currentColor = board[row][col]; board[row][col] = 0; if ((row + 1) < 12) { if (board[row+1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row+1, col); } } if ((row - 1) >= 0) { if (board[row-1][col] == currentColor) { match = true; totalMatches++; totalMatches += move(row-1, col); } } if ((col + 1) < 8) { if (board[row][col+1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col+1); } } if ((col - 1) >= 0) { if (board[row][col-1] == currentColor) { match = true; totalMatches++; totalMatches += move(row, col-1); } } return totalMatches; } My move() method above works fine, as in, it will delete the appropriate "blocks" and replace them with zeros. However, the number of destroyed (value returned) is always one off (too small). I believe this is because the first call of move() isn't being counted but I don't know how to differentiate between the first call or subsequent calls in that recursive method. How can I modify my move() method so it returns the correct number of destroyed blocks?

    Read the article

  • How to pad number with leading zero with C#

    - by Jalpesh P. Vadgama
    Recently I was working with a project where I was in need to format a number in such a way which can apply leading zero for particular format.  So after doing such R and D I have found a great way to apply this leading zero format. I was having need that I need to pad number in 5 digit format. So following is a table in which format I need my leading zero format. 1-> 00001 20->00020 300->00300 4000->04000 50000->5000 So in the above example you can see that 1 will become 00001 and 20 will become 00200 format so on. So to display an integer value in decimal format I have applied interger.Tostring(String) method where I have passed “Dn” as the value of the format parameter, where n represents the minimum length of the string. So if we pass 5 it will have padding up to 5 digits. So let’s create a simple console application and see how its works. Following is a code for that. using System; namespace LeadingZero { class Program { static void Main(string[] args) { int a = 1; int b = 20; int c = 300; int d = 4000; int e = 50000; Console.WriteLine(string.Format("{0}------>{1}",a,a.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", b, b.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", c, c.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", d, d.ToString("D5"))); Console.WriteLine(string.Format("{0}------>{1}", e, e.ToString("D5"))); Console.ReadKey(); } } } As you can see in the above code I have use string.Format function to display value of integer and after using integer value’s  ToString method. Now Let’s run the console application and following is the output as expected. Here you can see the integer number are converted into the exact output that we requires. That’s it you can see it’s very easy. We have written code in nice clean way and without writing any extra code or loop. Hope you liked it. Stay tuned for more.. Till than happy programming.

    Read the article

  • From Zero To Deployed Contest&ndash;Prizes Announced

    - by Robz / Fervent Coder
    Do you have what it takes to meet the challenge? We’ll make it worth it. You may have noticed at the end of my last post I threw down the community challenge to get from zero to deployed faster than me. The Challenge My time was 13:48 to be from zero to deployed. Beat my time and show it in a video response. The person with the best time by March 15th @ 11:59PM CST will receive a prize. Here are the links to the videos: #1 - http://www.youtube.com/watch?v=cZIUVfHWsbc #2 - http://www.youtube.com/watch?v=l7WluaXIya0 #3 - http://www.youtube.com/watch?v=IqPh7wbWsLc The Rules Let’s revisit those ground rules before I tell you what the prizes will be: Ground rules: .NET Application with a valid database connection Start from Zero Deployed with AppHarbor or an alternative A timer displayed in the video that runs during the entire process Video response published on YouTube or acceptable alternative Video(s) must be published by March 15th at 11:59PM CST. Either post the link here as a comment or on YouTube as a response (also by 11:59PM CST March 15th) The Prizes The prize package for the best time is:                      $50 Gift Card or equivalent – Provided by yours truly. AppHarbor $100 service credit – AppHarbor will provide a $100 credit for their services once they launch payments. Thank you to the folks at AppHarbor! ReSharper - Jetbrains will provide a FULL license of ReSharper Personal. This license is a $199 value. Thank you to the folks at Jetbrains! Telerik Ultimate Collection for .NET – Telerik will provide a license to pretty much every .NET tool they offer. This license is a $1999 value. A big thank you to the folks at Telerik!! This is a total value of $2348!!! The prize package for the person that has the most creative video(s) with a time better than mine (if there are at least 5 responses):           $20 Gift card or equivalent – Provided by this guy. AppHarbor $50 service credit – same deal as above. Thank you AppHarbor! Twilio T-Shirt - Twilio has donated a shirt and will ship your size to you (this may be subject to US residents only). This is a $25 value. Thank you to the folks at Twilio!

    Read the article

  • Adsense Page impression is showing zero

    - by user2687
    Hi, i have created a new adsense account for my blog [link removed as is loaded with ads, popups and who knows what kind of XSS] and integrated ads with my blog. But i am getting page impressions zero. i am getting daily analytic's of 300 to 400 visitor/day still page impression are coming zero only. i have verified my pub-id. i don't no what is the problem. how to contact Google adsense team regarding this. please help me out in this. -Thanks

    Read the article

  • zram trimming by writing zero pages

    - by qdot
    I'm using ZRAM as a backing block device for /tmp filesystem in the following manner: echo 8000000000 > /sys/block/zram0/disksize mkfs.ext4 -O dir_nlink,extent,extra_isize,flex_bg,^has_journal,uninit_bg -m0 \ -b 4096 -L "zram0" /dev/zram0 mount -o barrier=0,commit=240,noatime,nodev,nosuid /dev/zram0 /tmp chmod aogu+rwx /tmp It works out reasonably well for me - however, there is an issue here - when files are removed, they are not zero'ed, so the ZRAM does not remote the compressed pages. Obviously running dd if=/dev/zero of=/tmp/ZERO bs=1M count={free-space-some-rest}; rm /tmp/ZERO clears it up in the ZRAM - it gets notified of zero-pages and shrinks the store. How can I get ext4 to zero used pages on delete? Also, any other suggestions on how to optimize it?

    Read the article

  • SQL SERVER – Preserve Leading Zero While Coping to Excel from SSMS

    - by pinaldave
    Earlier I wrote two articles about how to efficiently copy data from SSMS to Excel. Since I wrote that post there are plenty of interest generated on this subject. There are a few questions I keep on getting over this subject. One of the question is how to get the leading zero preserved while copying the data from SSMS to Excel. Well it is almost the same way as my earlier post SQL SERVER – Excel Losing Decimal Values When Value Pasted from SSMS ResultSet. The key here is in EXCEL and not in SQL Server. The step here is to change the format of Excel Cell to Text from Numbers and that will preserve the value of the with leading or trailing Zeros in Excel. However, I assume this is done for display purpose only because once you convert column to Text you may find it difficult to do numeric operations over the column for example Aggregation, Average etc. If you need to do the same you should either convert the columns back to Numeric in Excel or do the process in Database and export the same value as along with it as well. However, I have seen in requirement in the real world where the user has to have a numeric value with leading Zero values in it for display purpose. Here is my suggestion, instead of manipulating numeric value in the database and converting it to character value the ideal thing to do is to store it as a numeric value only in the database. Whatever changes you want to do for display purpose should be handled at the time of the display using the format function of SQL or Application Language. Honestly, database is data layer and presentation is presentation layer – they are two different things and if possible they should not be mixed. If due to any reason you cannot follow above advise and you need is to have append leading zeros in the database only here are two of my previous articles I suggest you to refer them. I am open to learn new tricks as these articles are almost three years old. Please share your opinion and suggestions in the comments area. SQL SERVER – Pad Ride Side of Number with 0 – Fixed Width Number Display SQL SERVER – UDF – Pad Ride Side of Number with 0 – Fixed Width Number Display Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Function, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Excel

    Read the article

  • Google Analytics show zero for "Search Engine Optimizations" graph

    - by Saeed Neamati
    In Google Analytics new design, there is an area related to the queries and impressions related to your site. You can get there by following Traffic Sources = Search Engine Optimization = Queries. However, it now shows zero for the "Site Usage" graph, at the top section, while other areas of Google Analytics definitely show that site has visitors and has been used. No matter how much I search, I can't find the source of the problem. Does anyone know where the problem might be?

    Read the article

  • Enum types, FlagsAttribute & Zero value – Part 2

    - by nmgomes
    In my previous post I wrote about why you should pay attention when using enum value Zero. After reading that post you are probably thinking like Benjamin Roux: Why don’t you start the enum values at 0x1? Well I could, but doing that I lose the ability to have Sync and Async mutually exclusive by design. Take a look at the following enum types: [Flags] public enum OperationMode1 { Async = 0x1, Sync = 0x2, Parent = 0x4 } [Flags] public enum OperationMode2 { Async = 0x0, Sync = 0x1, Parent = 0x2 } To achieve mutually exclusion between Sync and Async values using OperationMode1 you would have to operate both values: protected void CheckMainOperarionMode(OperationMode1 mode) { switch (mode) { case (OperationMode1.Async | OperationMode1.Sync | OperationMode1.Parent): case (OperationMode1.Async | OperationMode1.Sync): throw new InvalidOperationException("Cannot be Sync and Async simultaneous"); break; case (OperationMode1.Async | OperationMode1.Parent): case (OperationMode1.Async): break; case (OperationMode1.Sync | OperationMode1.Parent): case (OperationMode1.Sync): break; default: throw new InvalidOperationException("No default mode specified"); } } but this is a by design constraint in OperationMode2. Why? Simply because 0x0 is the neutral element for the bitwise OR operation. Knowing this singularity, replacing and simplifying the previous method, you get: protected void CheckMainOperarionMode(OperationMode2 mode) { switch (mode) { case (OperationMode2.Sync | OperationMode2.Parent): case (OperationMode2.Sync): break; case (OperationMode2.Parent): default: break; } This means that: if both Sync and Async values are specified Sync value always win (Zero is the neutral element for bitwise OR operation) if no Sync value specified, the Async method is used. Here is the final method implementation: protected void CheckMainOperarionMode(OperationMode2 mode) { if (mode & OperationMode2.Sync == OperationMode2.Sync) { } else { } } All content above prove that Async value (0x0) is useless from the arithmetic perspective, but, without it we lose readability. The following IF statements are logically equals but the first is definitely more readable: if (OperationMode2.Async | OperationMode2.Parent) { } if (OperationMode2.Parent) { } Here’s another example where you can see the benefits of 0x0 value, the default value can be used explicitly. <my:Control runat="server" Mode="Async,Parent"> <my:Control runat="server" Mode="Parent">

    Read the article

  • Exim PanicLog has Non-Zero Size...?

    - by willbeeler
    I'm getting the following error from my Ubuntu server: exim paniclog /var/log/exim4/paniclog on (my server FQDN) has non-zero size, mail system might be broken. I found a solution on the web here. Basically, I just need erase the paniclog by entering the following code: sudo rm /var/log/exim4/paniclog So, I know how to get rid of the error, but I don't know how it started, and how to not let it happen again. Any explanation? Thanks in advance.

    Read the article

  • Sql statement return with zero result [closed]

    - by foodil
    I am trying to choose the row where 1)list.ispublic = 1 2)userlist.userid='aaa' AND userlist.listid=list.listid I need 1)+2) There is a row already but this statement can not get that row, is there any problem? List table: ListID ListName Creator IsRemindSub IsRemindUnSub IsPublic CreateDate LastModified Reminder 1 test2 aaa 0 0 1 2012-03-09 NULL NULL user_list table (No row): UserID ListID UserRights My test version SELECT l.*, ul.* FROM list l INNER JOIN user_list ul ON ul.ListID = l.ListID WHERE l.IsPublic = 1 AND ul.UserID = 'aaa' There is zero result. How can I fix that?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >