I have been using my HOSTS file for years to dummy out ad sites by adding entries like 127.0.0.1 www.ukbanners.com A while back I installed [Unchecky](https://unchecky.com/), a program which automatically unchecks all of those software extras that some installers like to enable by default (like McAfee). Today I noticed nthat Unchecky added entries like 0.0.0.0 media.opencandy.com to the end of my HOSTS file. A google search resulted in conflicting and ambiguous information as to the use of 0.0.0.0. The most complete explanations (in geek-speak) are usually of the "it depends" variety. Can anyone explain, in non-technical terms, the difference between …

Member Avatar
Member Avatar
+0 forum 4

Hi, I am facing an issue in string to const char pointer conversion. I am doing stuff in the fun() but here i am just giving my example. Here it the code: // Helper function string fun() { string abc = "Daniweb"; // print here #1 return abc; } // main function int main() { const char * returnValue = fun().c_str(); // print here #2 string returnValue2 = fun().c_str(); // print here #3 } When I print the value in fun() function before returning it, it is printing fine. (#1) When I print the value after const char (#2), it …

Member Avatar
Member Avatar
+0 forum 13

I have a char array which need to check each and every character untill there is no more character to check, so in C usually we write as: for(i=0;my_num_Array[i]!='\0';i++) { // some code here } But when i tried the same for java it isn't working! Any idea what should I do?

Member Avatar
Member Avatar
+0 forum 13

Guys I want to insert a Null dateTime Value into SQL database connected to C# desktop application. I'm using following code. I can insert Null dateTime Value into database, but I am having problem with how to update dateTime picker value and saving it into database.. I'm posting my code below.. Please help me guys.. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace Datetimepicker { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //to load the images butadd.Image = Imageslist.Images[0]; …

Member Avatar
Member Avatar
+0 forum 4

Ok, here is what I get when I run the query. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near newmessage`int(4) unsigned NOT NULL DEFAULT `0`,`companyi' at line 4 Here is what it says is wrong. CREATE TABLE `user` ( `userid` char(50) NOT NULL default '', `password` char(12) NOT NULL default '', `lastlogin` timestamp(14) NOT NULL, `newmessage`int(4) unsigned NOT NULL DEFAULT `0`, `companyid` char(10) default NULL, `departmentid` char(10) default NULL, `status` char(50) default NULL, PRIMARY KEY (`userid`), KEY `loginuser` (`userid`,`lastlogin`) ) ENGINE=MyISAM; …

Member Avatar
Member Avatar
+0 forum 6

SQL Gurus, help !! I have a table with 3 fields, ID, Answer_5, Answer_6. Answer_5 & Answer_6 both hold a date value, but the fields are defined as string (for other reasons). In Answer_6 it is possible to have the string of 'Now'. I am trying to do a simple select as follows, changing fields on the fly to make 'Now' equal today's date: select id, answer_5, CASE when answer_6 = 'Now' THEN cast(GETDATE() as date) when answer_6 is NULL then cast('01/1990' as date) ELSE cast(answer_6 as date) END AS new_answer_6 from tDataMult I get "Conversion failed when converting date …

Member Avatar
Member Avatar
+0 forum 3

I'm writing a routine where the user can populate up to 8 textboxes with numbers. Since there is potential for these numbers to be unsorted, I want to sort these prior to saving. However it's probable that all of the textboxes will not be used. My challenge then is how to ignore the blank textboxes and not include them in the sort. In my test, I've used 4 of the 8 boxes. It sorts perfectly - except it puts the blank textboxes first. I've tried various versions of the following with no success. Are there any thoughts as to how …

Member Avatar
Member Avatar
+0 forum 14

Hi All, I'm not sure if this is a technical issue, preference or a question about best form. I have a 'users' table and a 'contacts' table. 'users' and 'contacts' have no direct relation. Both contain an email address for each record in their own table. I want to send reports to both users and contacts. I have a 'reports' table with some details of each report to be sent. To send the reports I am matching up a report_id to a user_id **or** a report_id to a contact_id. So I have the following query to create this table: create …

Member Avatar
Member Avatar
+0 forum 4

Hi, Need help on exporting data to csv from oracle database when i export ... the field which has null values (in database) appear as 'null' word in the csv output. Is there a way to avoid it? thanks

Member Avatar
Member Avatar
+0 forum 4

Salam... I have SQl Database...And i am using visual basic 2010 i have a problem with Null values.When in my database data have some null values then data not showing in my crystal report ...crystal report showing blank..I want '0' when data is null..for example my table name is (meetings with organization) and field name (Nature of meeting) which has 3 types 1 meetings 2 school visit when in these types have no meetings data not showing in crystal report.please help me ...how to show '-'/'0' in crystal report when data have null values,please send me code..and sorry for my …

Member Avatar
Member Avatar
+0 forum 4

I want to null or remove array at the end of each loop. I already tried unset() or $array=array(); but its not working foreach($array as $key=>$value){ $dates[$value][]= $key; unset($dates) } Just tell me php function to null all array

Member Avatar
Member Avatar
+0 forum 2

Hi, How to use in select statement with where condition comparing a Null value and with value? I have this Statement `Select Col1, Col2, Col3 From Table where DateDeleted` 'Here comes the problem The condition is something like if DateDeleted (which is actually a date) is Null then get records with null DateDeleted, else it should compare the DateDeleted to specified date. If this DateDeleted is less than (or earlier) than the specified date then it will show the records, else it bypass it. The idea of the select statement is to get all data with null DateDeleted and those …

Member Avatar
Member Avatar
+0 forum 7

The following code unable to insert null or blank value into table called custreg i.e. $sagentid and $sagentname. if(isset($_POST['Submit'])){ $reg_no=$_POST['reg_no']; $firstname=strtoupper(str_replace(',', '' , $_POST['firstname'])); $lastname=strtoupper(str_replace(',', '' , $_POST['lastname'])); $mobno1=$_POST['mobno1']; $mobno2=$_POST['mobno2']; $address=strtoupper($_POST['address']); $city=strtoupper($_POST['city']); $dateofjoin=$_POST['dateofjoin']; $regfee=$_POST['regfee']; $magentid=$_POST['magentid']; $sagentid=$_POST['sagentid']; $skimcity=$_POST['skimcity']; $skimyear=$_POST['skimyear']; $skimname=$_POST['skimname']; $cust_fullname = $firstname.' '.$lastname; $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT id,firstname,lastname FROM agentreg where agentid= ?"; $q = $pdo->prepare($sql); $q->execute(array($magentid)); $data = $q->fetchALL(PDO::FETCH_ASSOC); foreach($data as $row) { $magentname=$row['firstname'].' '.$row['lastname']; } $pdo = Database::connect(); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql = "SELECT id,firstname,lastname FROM agentreg where agentid= ?"; $q = $pdo->prepare($sql); $q->execute(array($sagentid)); $data = $q->fetchALL(PDO::FETCH_ASSOC); foreach($data as $row) { $sagentname=$row['firstname'].' '.$row['lastname']; } if($reg_no …

Member Avatar
Member Avatar
+0 forum 3

I created a custom 'text menu' that should print each String passed to it. This is the class: package com.github.geodox.areacalculator.menu; public class Menu { private static int index = 0; private static String[] menuItems; public void addItem(String menuItem) { menuItems = new String[index+1]; menuItems[index] = menuItem; index++; } public void printMenu() { for(String menuItem : menuItems) { System.out.println(menuItem); } } } This is what is passed. Menu menu = new Menu(); menu.addItem("rectangle"); menu.addItem("square"); menu.addItem("circle"); menu.addItem("triangle"); menu.addItem("trapezoid"); menu.addItem("parallelogram"); menu.printMenu(); However, this is what is printed: null null null null null parallelogram Any ideas on why this is happenning?

Member Avatar
Member Avatar
+0 forum 3

Hi All, I got this code from a forum & tried it on g++/Linux. In the code below i put NULL to a pointer variable but didnt get any errors. #include <iostream> using namespace std; class A { private: int _dmember; public: void func() { cout<<"Inside A!! "<<endl; cout<<_dmember; // } }; int main () { A *a=NULL; a->func(); // prints "Inside A!!!" return 1; } can someone please explain this to me ?

Member Avatar
Member Avatar
+0 forum 5

Hello all, I am stuck with a nullpointerException at line 41 and 60.Can someone please help me out.any kind of help will be appreciated. Thanks import javax.swing.*; import javax.swing.event.*; import java.awt.Color; import java.awt.*; class calenders extends JFrame { int i=0; int j=0; int k=0; JFrame jf; FlowLayout fl; JPanel jp[]; JButton jb []; JButton jb3[]; Button b[]; calenders() { jf=new JFrame ("Happy 2014 :-)"); fl=new FlowLayout(); b=new Button[12]; jp=new JPanel[12]; String days[]={"Sun", "Mon","Tue", "Wed", "Thurs", "Fri", "Sat"}; String months[]={"Jan", "Feb","March", "Apr", "May", "July", "August","september","october","november","december"}; //JButton jb1=new JButton("Previous"); //JButton jb2=new JButton("Next"); jb3=new JButton[7]; String dates[]={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20", "21","22","23","24","25","26","27","28","29","30","31"}; jb=new JButton[31]; Color colors[]={Color.blue, Color.yellow, …

Member Avatar
Member Avatar
+0 forum 8

I know I am probably over thinking this but I cannot seem to figure this out. I am trying to check if the value is null and if not to continue. /** * */ public Item getItem(String theItem) { Iterator iter = myItems.iterator(); while(iter.hasNext()) { Item anItem = (Item) iter.next(); if(anItem.getName().equals(theItem)) { return anItem; } } if(anItem == null) { continue; } return null; }

Member Avatar
Member Avatar
+0 forum 4

Hello, so I was trying few relations between tables and I noted an unexpected behaviour when using `group_concat()`. Let say I have three tables: fruits, fruitstock and fruitprices. These are the structures: create table fruits ( id tinyint unsigned not null auto_increment primary key, name varchar(50) not null, quality varchar(50) not null ) engine = myisam default charset = utf8; create table fruitstock ( id tinyint unsigned auto_increment primary key not null, fruit_id tinyint unsigned not null, quantity tinyint unsigned not null default 0 ) engine = myisam default charset = utf8; create table fruitprices ( id tinyint unsigned not …

Member Avatar
Member Avatar
+1 forum 1

Hi, I'm sorry if I had post duplicate post. I had join this 2 table (dt_dict_tbl - store dictionary, sdn5_5 - store accumulate value for reporting). Here the table structure **dt_dict_tbl** CREATE TABLE `dt_dict_tbl` ( `dtDictCode` VARCHAR (30), `dtDictDesc` VARCHAR (600), `rptCode` VARCHAR (30), `rptSubCode` VARCHAR (30), `dtCreatedDate` TIMESTAMP , `dtColumnName` VARCHAR (150), `sort` DOUBLE ); **sdn5_5** CREATE TABLE `sdn5_5` ( `idTbl` DOUBLE , `year` DOUBLE , `program` VARCHAR (30), `typeQuantity` VARCHAR (30), `Quantity` VARCHAR (300), `updateDate` TIMESTAMP ); For column program and typeQuantity, it will read info from dt_dict_tbl; So for reporting i had try below query (i just …

Member Avatar
Member Avatar
+0 forum 2

Hey everyone, I was attempting to get the lastmodified file from a folder, and to do so I used File.listFiles() method which is returning a null pointer exception even though the folder is not empty. I had this piece of code working about two days ago and I am not sure what changed since. I have looking java docs and I have realized that File.listFiles() will return a null if the arbitrary path is not found. But in this case the path does exists and as I mentioned it did work two days ago. The for loop (has comment besides …

Member Avatar
Member Avatar
+0 forum 3

For me getting same result (all the text box are null value is filled) after move the textboxes after calling request.getParameter() also... What i need to change it? Where i need to edit? # **First Jsp Page** # <%@ page import="java.sql.*" %> <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");%> <HTML> <HEAD> <TITLE>Fetching Data From a Database</TITLE> </HEAD> <BODY> <H1>Fetching Data From a Database</H1> <% Connection connection=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","password"); ResultSet resultset; Statement statement=connection.createStatement(); resultset = statement.executeQuery("SELECT * FROM testtb"); if (!resultset.next()) { out.println("Sorry, could not find the data. "); } else { %> <TABLE cellpadding="15" border="1" style="background-color: #ffffcc" align="center"> <TR> <TH>Id</TH> <TH>Task Name</TH> <TH>Description</TH> <TH>Priority</TH> <TH>Date</TH> <TH>Time</TH> <TH>Edit</TH> …

Member Avatar
Member Avatar
+0 forum 1

Hi I have a set of Checkboxes each with a Textbox next it to. I have the following code, which is meant to loop through each CheckBoxe and if checked if gets the text contained in the textbox, these are linked through the tag of the checkbox, i have used it before and it worked fine but this time i am getting the following error: Null Reference Exception was unhandled Object reference not set to an instance of an object. I have checked by simply getting get the tag and the value of the linked textbox and both are populating …

Member Avatar
Member Avatar
+0 forum 7

Hi all. I have run into a problem with inserting values into table. I have 2 tables: PUBLISHER with fields: PUBLISHER_CODE (Primary Key) and PUBLISHER_NAME. BOOK table fields: PUBLISHER_CODE (Primary Key and Foreign key to PUBLISHER table) and TITLE. The user enters bookCode and publisherName into 2 textboxes Here is the code for inserting: "INSERT INTO BOOK (TITLE) VALUES(@bookCode)"; "INSERT INTO PUBLISHER (PUBLISHER_NAME) VALUES(@publisherName)"; When running programme, the PUBLISHER table generates a new PUBLISHER_CODE (Primary Key) and publisherName inserted. Now problem is for the BOOK table the following error appears: "Cannot insert the value NULL into column 'PUBLISHER_CODE'", table BOOK …

Member Avatar
Member Avatar
+0 forum 2

When I click the login button I never get any values posted to the server. I accept a AuthViewModel but it is always null. I have tried using @html.EditorFor but have not had any luck with it. **User Controller** [HttpGet] public ActionResult Password() { UserModel user = (UserModel)Session[Constants.SessionVars.Authenticate]; //error - need a profile if (user == null) return Redirect("/User/Login"); return View(new AuthViewModel()); } [HttpPost] public ActionResult Password(AuthViewModel password) { UserModel user = (UserModel)Session[Constants.SessionVars.Authenticate]; //error - need a profile if (user == null) return Redirect("/User/Login"); if (password == null || string.IsNullOrEmpty(password.Password)) { ViewBag.Error = Constants.ErrorMessages.UserPassword_PassBlank; return View(new AuthViewModel()); } var dataContext …

Member Avatar
Member Avatar
+0 forum 6

I always getting this error in my dropdownlistfor: Value cannot be null. Parameter name: items View code: @Html.DropDownListFor(model => model.SiteId, new SelectList(ViewBag.ListSiteClass, "SiteId", "SiteName"), "", new { @onchange = "GetSiteid(this.value);" }) Controller Code: [HttpPost] public ActionResult Create(ServiceDTO ms, FormCollection form) { if (ModelState.IsValid) { int sid = ms.SiteId; ServiceDAO.Insert(sid); } else { return View(); } } In loading View: public ActionResult Create() { List<SiteDTO> LSSiteNameList = SiteDAO.GetSiteNameList(User.Identity.Name); ViewBag.ListSiteClass = LSSiteNameList; var service = new ServiceDTO(); return View(service); }

Member Avatar
Member Avatar
+0 forum 14

Writing an upgrade to my program I'd like to start using the nullptr, a cleaner replacement to NULL. My question is can I use it everywhere, for example in checking the strstr return value? if (strstr(szLong,"tag") == nullptr) Presumably will work as well as if (strstr(szLong,"tag") == NULL) ?

Member Avatar
Member Avatar
+0 forum 13

Hi I am running phpMyAdmin 5.6. I have created a table as described in a tutorial. This table is supposed to have a null value in a text field, I cannot do it, I tried everything.The examples on the web refer to older versions and I keep getting error.I even tried to do it from the command propmt using alter or update but as I said the examples do not agree with this version of phpMyAdmin.Can somebody tell me how to do it?Thanks.

Member Avatar
Member Avatar
+0 forum 4

hi. when a user request hits the ActionForm's validate method (struts)and bounces back, i'm loosing some request attributes that i had set for the page. In other words, if the user inputs some data that don't pass the validate method, the page comes back with a few request scope attributes missing. Is there a way to avoid that this happens? Thank you in advance

Member Avatar
Member Avatar
+0 forum 1

Hi guys... I have a radio button that one checked will connect to an ADO Connection. The following code being used is: private void radioButton3_CheckedChanged(object sender, EventArgs e) { //Fields Disabled until a new Account is created.// txtAccRef.Enabled = false; txtAccName.Enabled = false; txtAccAddr1.Enabled = false; txtAccAddr2.Enabled = false; txtAccTown.Enabled = false; txtAccCounty.Enabled = false; txtAccPostCode.Enabled = false; //Buttons Disabled as not needed// btnNewCashAcc.Enabled = false; btnEditCashAcc.Enabled = false; btnSaveCashAcc.Enabled = false; btnDeleteCashAcc.Enabled = false; //As Data is being pulled from Line 50 this fields have cleared.// txtAccRef.Clear(); txtAccName.Clear(); txtAccAddr1.Clear(); txtAccAddr2.Clear(); txtAccTown.Clear(); txtAccCounty.Clear(); txtAccPostCode.Clear(); //Opens the Line 50 Connection// adoConn.Open("SageLine50v19", …

Member Avatar
Member Avatar
+0 forum 4

Hi all I have an Access database Table and one of the columns has a date value the column name is closing. I would like to do an order by closing asc the null values are allways on top and I would like it to be at the bottom. I have googled for a solution and I came up with this Dim SelectQueryString As String = "SELECT * FROM " & Filter & " order by case when Closing is null then 1 else 0 end, Closing" When executing this query I get Unrecognized keyword WHEN error. thanks in advance

Member Avatar
Member Avatar
+0 forum 2

The End.