Hi all, I need to read a text file (I've attached it, you can take a look), and then store all the numbers in it into a 2D array. After which, I need to parse it. I need urgent help here! ):

Member Avatar
Member Avatar
-2 forum 49

Question from codility test Write a function: class Solution { public int solution(int[] A); } that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. Given A = [1, 2, 3], the function should return 4. Given A = [−1, −3], the function should return 1. Write an efficient algorithm for the following assumptions: > > N is an integer within the range [1..100,000]; > each element of array A is an …

Member Avatar
Member Avatar
+0 forum 8

Moderators: Please dont delete this post as it is featured A part of an assignment I have due. The assignment states - A program that prints out lines of asterisks, based on the values determined by the user input. The program first asks for the minimum number of asterisks, the maximum number of asterisks, and the interval. It then prints lines of asterisks, starting with a line with the minimum number of asterisks, and ending with a line with the maximum number of asterisks. The increment of the numbers of asterisks is specified by the interval value. At the end …

Member Avatar
Member Avatar
+0 forum 6

I was so amazed at how easy it was to embed google maps into a vb app I decided to post a quick example to help anyone get started. This is a simple example. Google's api has all kinds of things to help customize your map. You can find out anything you need to know from here: [url]http://code.google.com/apis/maps/documentation/javascript/reference.html[/url] You will need to: Create a new windows forms app. Add a class named GoogleControl and paste the GoogleControl code into it. Add a new html doc to the project and name it GoogleMap.htm and set its Build action to CopyIfNewer Copy …

Member Avatar
Member Avatar
+4 forum 46

Hi, How can I pass a c# string to C++ side of the app? Right now, I have all handling in Const char * format . When I pass c# string, c++ working fine when using Platform::String . But there is no good way of converting Platform::String to const char *. Any inputs from your side? Any help will be appreciated. Thanks.

Member Avatar
Member Avatar
+0 forum 9

Hi, Front end Vb6, back end.. access... connection.. ODADB... can someone please help me with the code for login and password.

Member Avatar
Member Avatar
-6 forum 15

I have class with main method like: public class Main { public static void main(String[] args) { long timeCheck; long periodOfTime; ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(2); long initialDelay = 0; // the time from now to delay execution long period = 1; // the period between successive executions scheduler.scheduleAtFixedRate(new FeedReader(img, url, title, price), initialDelay, period, TimeUnit.DAYS); ... ... } } and another class with some code: public class FeedReader implements Runnable { private String img; private String url; private String title; private String price; public FeedReader(String img, String url, String title, String price) { this.img = img; this.url = url; this.title …

Member Avatar
Member Avatar
+0 forum 8

vb.net 2010 Windows Pro 7 ## Create a Video Library with an Embedded Windows Media Player ## I have close to 400 video clips in my home movie library. In order to quickly locate any given video I have added certain words into the file names. Even so, locating specific files is clumsy from the Explorer window and playing a clip requires starting an external application and flipping back and forth between Explorer and the media player. That's why I decided to embed the media player directly in the application. Given a choice, I would have preferred to embed [vlc …

Member Avatar
Member Avatar
+1 forum 8

You know the Pareto Principle? The 80/20 rule? That 80% of the work gets done by 20% of the people? Or 80% of the money belongs to 20% of the people? And so on? Well it is 'recursive' inasmuch as it can be applied again to the 20% first recognised. i.e. if 20% do 80% of the work then 20% of the 20% do 80% of they work THEY do. And so on. While I can get my head around recursion generally and can fully comprehend the standard recursive algorithm for calculating factorial - I'm not smart enough to put …

Member Avatar
Member Avatar
+1 forum 1

Below is my code for adding parameters in my vb .net code for prepared statements of npgsql. Dim xConn As NpgsqlConnection = ConnectDB() Dim xCmd As NpgsqlCommand = xConn.CreateCommand() xCmd.CommandText = "UPDATE " & xTable & " SET previous_tot_adj = @prev_adj ,tot_adj = @tot_adj WHERE version = " & _version & " AND monthly_mq_id = @Index" For Each Index In _Results.Keys If Not IsNothing(_Results.Item(Index)) Then xCmd.Parameters.AddWithValue("prev_adj", NpgsqlTypes.NpgsqlDbType.Double, _Results.Item(Index)) xCmd.Parameters.AddWithValue("tot_adj", NpgsqlTypes.NpgsqlDbType.Double, _Results.Item(Index)) xCmd.Parameters.AddWithValue("Index", NpgsqlTypes.NpgsqlDbType.Bigint, Index) End If Next xCmd.Prepare() xCmd.ExecuteNonQuery() After executing this code i get this kind of error . > A first chance exception of type 'Npgsql.NpgsqlException' occurred in …

Member Avatar
Member Avatar
+0 forum 2

I am trying to display this SQL query in a table. String query = "SELECT COUNT(`appointmentId`),EXTRACT(MONTH FROM `start`) FROM `appointment` WHERE YEAR(start) = '" + year + "' GROUP BY EXTRACT(MONTH FROM `start`)"; Unfortunately I cannot alter the database. I am trying to list the total appointments per month on a table or perhaps a TextArea. Any ideas please? Thanks!

Member Avatar
Member Avatar
+0 forum 2

Yes, you've been told it's dead, gone and to move off this old beast of a system from 1998 but here you are, tasked with fixing an old legacy app so let me share that I've been there and how I got around some of the issues. These are: 1. Install issues on Windows 10. 2. A workaround to code that seemed fine but failed. 3. What may never work again. # Installing VB6 # Installing Visual Studio 6.0 from 1998 is a challenge. Be sure to have your media ready and if need be, print out the instructions so …

Member Avatar
Member Avatar
+1 forum 3

I am becoming confused with visual studio v. Vb.net. I am findings hundreds of pieces of code tells me how to connect. Snippets elsewhere that tell me how to access data in the database I connected to. I am not finding snippets/examples that walk one thru connecting, adding, deleting etc. for that style of database access. I am running into this everywhere. When I try to patch a sample connection with another sample that works with the data, I get trouble really quick. Like I’m trying to put a Ford tire on a Schwin bicycle and I can’t find the …

Member Avatar
Member Avatar
+0 forum 2

All, For the life of me I cannot get this program to compile. The error message "error: non-static variable this cannot be referenced from a static context" occurs on lines 23 and 24. Here is the entire program: [CODE]public class ThreadTest { public static int x = 0; public class Counter implements Runnable { private int i; private int temp; public void run() { for (i=0; i<10; i++) { temp = x + 1; x = temp; } } //End run() } //End class Counter public static void main (String[] args){ Counter myCounter1 = new Counter(); Counter myCounter2 = new …

Member Avatar
Member Avatar
+0 forum 9

This is a tutorial, not a program. [b]Step 1[/B] First, create a file for your website, and name it "admin.html". [b]Step 2[/b] Now on it, say, "You must log in to view admin, blah,blah,blah. Click here to launch our client." [b]Step 3[/b] Link "Click here" with the C++ .exe file we will create later. [b]Step 4[/b] Now, create a new file with a bunch of random letters, then ".html". Make the file name AT LEAST 100 characters long. All your admin stuff will go here. [b]Step 5[/b] Now Start a C++ program, and type the following: [code=c] #include <iostream> #include …

Member Avatar
Member Avatar
-5 forum 10

Hi Guys, I ussually dont post anything here often, just get everything off of everyone elses questions, but I'm having a strange problem that im scratching my head over, I have a JTable where I can Add and remove rows... This is just for testing purposes, I'm about to make a ingrediants program. The thing is whenever I change one of the Comboboxes they all seem to change.. its really wierd, Could Someone run this and help me out, this is probably a stupid mistake? See my Code Below, My Main package doughtracker; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; /** * * …

Member Avatar
Member Avatar
+0 forum 13

how can i limit a user to enter 10 digit no like telephone no in textbox without using regular expressions?????

Member Avatar
Member Avatar
+0 forum 16

Hey guys, I have a little bit confused on below code and output **Main ** public class Main { public static void main(String[] args) { ClassA classA = new ClassA(); System.out.println("====== Before ====="); classA.checking(); System.out.println("===== After ====="); classA.checking(); } } ** Class A** public class ClassA { boolean b = true; public String checking() { System.out.println("B value is " + b); if (b = true) { System.out.println("B is true"); b = false; } else { System.out.println("B is false"); } return null; } } ** Output** ====== Before ===== B value is true B is true ===== After ===== B value …

Member Avatar
Member Avatar
+0 forum 4

I started working on a windows forms authentication project, which uses nhibernate, and has some management pages for managing user settings, such as resetting user password. This forms based authentication uses session state in order to save the user's authentication information. I will be using a special authentication attribute in order to determine whether the user has access to the application. Since the authentication method is it's own mosaic of object relational mapping code, attributes, repositories, and asp.net mvc pages, I was thinking I could run this application as it's own project on a web server, and I could use …

Member Avatar
Member Avatar
+0 forum 4

This is surprisingly difficult. Consider it a snippet. Deletes all tables from a sql server schema. Useful for those times on your dev machine where you need to tear down all the cruft that has built up on your server due to refactoring of object relationally mapped tables. --Author: Cameron Block DECLARE @SCHEMA VARCHAR(50) = 'cblock'; DECLARE @LOOP_PREDICATE INT = 1; WHILE (@LOOP_PREDICATE > 0) BEGIN DECLARE CUR_PARENTS CURSOR FOR select referenced_object_id "REF_ID", T.name "TABLE", S.name "SCHEMA" from sys.foreign_keys FK JOIN SYS.TABLES T ON T.object_id = FK.referenced_object_id JOIN sys.schemas s ON t.[schema_id] = s.[schema_id] JOIN INFORMATION_SCHEMA.TABLES I ON i.TABLE_NAME = …

Member Avatar
Member Avatar
+1 forum 2

When this news came across I only had to think of MSFT's prior acquisitions to think this may not end well. As the song goes " Should I Stay or Should I Go"?

Member Avatar
Member Avatar
+1 forum 7

For the past several years I have been feeling quite embarrassed about my coding abilities. I've been self studying most nights trying to catch up to my peers but I feel like I have a moving target. I feel like my years of work experience does not reflect my coding ability at all. This post will go over my programming history, then how I am currently studying to improve my technical skills, then finally what I think my weaknesses are as a developer. What I am trying to get out of this post is how I can improve as a …

Member Avatar
Member Avatar
+7 forum 8

hello sir how can I get my system short date format in a label in vb. net. I try this code : Label1.Text = System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern() but show wrong data. all time show "M/d/yyyy" format. I change it(to "dd/MM/yyyy") manually and by coding result is same("M/d/yyyy") please help me..... For Change the Format: Microsoft.Win32.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\International", "sShortDate", "dd/MM/yyyy")

Member Avatar
Member Avatar
+1 forum 3

Hi! My name is Jung and I'm new to VBNET I have already tried many ways to write codes for "btnSearch" but seems like nothing works.. I really need help for this as the deadline is around the corner :'( Below are my codes for Search button.. ![btnsearch.PNG](/attachments/large/4/76be068c625e23d9a57e969a97509bee.PNG "align-center")

Member Avatar
Member Avatar
+0 forum 2

#include<stdio.h> int main() { int x=5; int y=50; do{ x = x + 10; }while (x <y); printf("%d\t%d", x,y); } I wonder why i compile is 55 50 why not 15 50???

Member Avatar
Member Avatar
+0 forum 1

Hi, I am currently working on a VB form for a college assignment. I am trying to add quantities from a ListBox and then display the result in a TextBox for a pizza delivery order by using a button. So far, the Listbox shows: pizza type Quantity pizza price Total pizza price The Total pizza price is the value that I want to add together and then show in a TextBox as an Order Price. This is my form and Code for the button: ![form1.PNG](/attachments/small/4/3da7c8769c68d4284e57a3e1644c9627.PNG "align-left") ![form.PNG](/attachments/small/4/a41c26183938bc03cb984f467c5bb361.PNG "align-left") ![form1_buttoncode.PNG](/attachments/small/4/710dcd869220381dab6204948dc6f362.PNG "allign right") The code is a work in progress and as …

Member Avatar
Member Avatar
+0 forum 5

Hello everyone, I am having trouble with my program its solving expressions and when I compile it I get a "Illegal start of expresson" line in my output. I am using Jgrasp as my softwear. May I ask to reveiw my code and see on what I did wrong? I am asking for learning purposes. Thank You. import java.util.ArrayList; import java.util.Scanner; import static java.lang.Integer.*; import static java.lang.System.*; public class ExpressionSolver { int answer; String expString; ArrayList<String> exp; public ExpressionSolver(String s) { setExpression(s); } public void setExpression(String s) { expString = s; exp = new ArrayList<String>(); for(String temp: s.split(" ")) { …

Member Avatar
Member Avatar
+1 forum 25

How can I show the database in a single mode (windows or SQL authentications mode) please help me..... How can I Show the database in a single mode (windows or SQL authentications mode) please help me. I create a project VB.NET 2010 and SQL server 2008r2 , When I login sa account show the database it is all right. But problem is when I connect windows authentication mode same database show on there, and it is fully accessible. I want to when I login sa account show the database, not show when login in windows authentication mode.

Member Avatar
Member Avatar
+0 forum 1

I need some help building a bootstrap Angular UI modal. This is what I have so far, but I am pretty sure it is wrong. Any assistance would be good. This actually appears to be doing mostly bootstrap stuff. It was originally jquery, but I figured out the hard way that jquery does not mix with Angular Js well. <div id="excelModal" modal="excelModal" close="cancel()" hidden> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" hidden>&times;</button> <h4 class="modal-title">Excel Upload</h4> </div> <div class="modal-body"> <p>Please upload an excel file that contains the data you are wishing to include in the report parameters.</p> </div> …

Member Avatar
Member Avatar
+0 forum 1

Ok I have a workbook that have 5 worksheets for a 5 year span. On each of the worksheets are there is a list of countries that make up the combobox (which works perfectly). On my userform I have a frame on the userform that represent each worksheet. **My problem is that I can't get the textboxes to populate based on the combobox selection. If that country is on three of the sheets I need for it to populate according to the year.** This code works perfectly with the exception of populating my label boxes with line one starting with …

Member Avatar
Member Avatar
+0 forum 6

The End.