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

##vbScript - Some Useful String Functions Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. vbScript provides a number of functions for manipulating strings. I find that a few more simple functions would have made things a lot simpler. For example, I find myself checking to see if a string starts with a given string. What I have to code is If len(str1) < len(str2) Then StartsWith = False Else If Left(str1,len(str2)) = str2 Then StartsWith = True Else StartsWIth = False End If It would be much clearer if I could do If StartsWith(str1,str2) Then …

Member Avatar
Member Avatar
+1 forum 1

# my code in asp.net with sql server # my final task is to perform string matching and i know i use algorithm but i can use logic first i split the code in listbox .success 2nd step i match all the listbox items to sqlserver which contain 1 column ? how to match all the listbox item to database sql server ? for example in my database heading factorial in c++ when i enter query box factorial in java and then split to listbox like factorial in java that work done but how to match the listbox all items …

Member Avatar
Member Avatar
+0 forum 1

I've looked around this forum, and the rest of the internet, but my code is not working. Here is the problem: I read XML files that are in en-US culture. The decimal separator is a dot ".". Given the string "123.45", I want to convert the separator from a dot, to a comma. The current code doesn't work. [CODE] String tmp = "123.45"; System.Globalization.CultureInfo myInfo = System.Globalization.CultureInfo.CurrentUICulture; /****The above line returns my culture, es-ES where the number separator is ","***/ System.Windows.Forms.MessageBox.Show("New value: "+ Decimal.Parse(test, myInfo)); /***The above line displays the result "12345"***/ [/CODE] I have a lot of variables to …

Member Avatar
Member Avatar
+0 forum 5

![new1.PNG](/attachments/small/4/439e046d2f82534dc014d4649dea2f82.PNG "align-right") ![New.PNG](/attachments/small/4/df936d9cb59970cb9d9624ec2372f01f.PNG "align-right") ![new2.PNG](/attachments/small/4/e4dd164233946b7d726c703c6f7d470f.PNG "align-right") ![new3.PNG](/attachments/small/4/d479a91081ef39aa870d6eb0a3ca5006.PNG "align-right") Good Day, I would like some assistance, I have 12 checkboxes that when you click the value get stored into the database, then unchecked it get removed. Then now I needed a Checkbox/Uncheck All checkbox that when clicked the values get store, then unclick get removed. <b> <span> Check/Uncheck All </span> <input type="checkbox" id="checkall" /> </b>    <script type="text/javascript"> function Select(status) { $("#checkboxes input").each(function () { // Set the checked status of each to match the // checked status of the check all checkbox: $(this).prop("checked", status); }); } $(document).ready(function () { //Set …

Member Avatar
Member Avatar
+0 forum 6

This short Python code gets the local time from the PC as a formatted string using time.strftime('%H:%M:%S'). The time string is displayed in a label using a larger font. A recursive function checks the time five times per second, and updates the time string, if it has changed. Five times per second may sound like overkill, but keeps the display from acting spasmodic.

Member Avatar
Member Avatar
+2 forum 12

Hi! I have encountered a small issue when attempting to create getters and setters in C#. I've been following along a course in unity and tried to replicate what the tutor had written in his C# scripts. As far as I can tell, everything is spot on and I can't seem to find what's causing the error -- Visual Studio suggests adding semi-colons after the 'get' and 'set' keywords, but I don't think that's correct course of action. Here is a snippet of the code that causes the error. Perhaps someone could explain to me what I'm doing wrong and …

Member Avatar
Member Avatar
+0 forum 3

I am trying to make a windows form application using Visual Basic 2017. I want to display messaged using a label and a Next Button and a Back Button. Every time the Next Button is click I want the message to update and change to whatever you put in your code already. I was think about using If Else statement but somehow i can not get the message to uupdate passed the first display. Thank you. The algorithm will follow like a flowchart because there will also be a Yes/No Button which can also change the displayed messages on the …

Member Avatar
Member Avatar
+0 forum 1

numbers = [2,3,1,5,7,8,9,5,4,6] print(numbers) tool_1 = int(input()) tool_2 = int(input()) x = numbers.index (tool_1) y = numbers.index (tool_2) numbers[x] = (tool_2) numbers[y] = (tool_1) print(numbers) So I want this code to run until the numbers list is in this exact order 1,2,3,4,5,6,7,8,9 Is there a Do until loop or someway I can do this?

Member Avatar
Member Avatar
+0 forum 2

AcedCast5 what is This??

Member Avatar
Member Avatar
-2 forum 1

Hi guys, This is my first post and basically i require some help editing my current code to help display number of students with a mark of 40 or above specifically. And also i am having difficulty generating a average i thought i done it but it remained constant a 4.0 with every test. This work is on going so i will be constantly updating the page each time i run into more troubles. Thanks guys below is a copy of my code and how far i got... package histogram1; import java.util.Scanner; public class Histogram1 public static void main(String[] args) …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, so i have currently made a small antivirus project (just for me) but i want to make it cool with signiture definitions ect. Basically what ive got so far is my program reads a text file with loads of sha256 hashes to see if the file that enterd the computer has the same sha256 if it reads all text from the text file and the sha256 matches then its removed. If not then well nothing happens ofcourse. But i want to make it cooler, so can anyone walk me through how to make a database (i can add …

Member Avatar
Member Avatar
+0 forum 1

Hello Everyone

Member Avatar
-1 forum 0

command name can be APP_COMMAND_NAME as const Friend Module Program Private CurrentString As String = String.Empty Public Const APP_RUNNING As String = "Running" Public Const APP_TITLE As String = "Console" Public State_Output As String Public State_List As List(Of String) = New List(Of String) Private commandlist_ As Dictionary(Of String, Action) Private State As String = String.Empty Public APP_USER As String Event Command_Run() Sub Main() APP_USER = String.Empty Program.State_Output = "App is " & State.ToString & CStr(Program.APP_RUNNING) 'Program.State_List = New List(Of String) Console.Title = APP_TITLE AddHandler Command_Run, AddressOf RunCommand Program.commandlist_ = New Dictionary(Of String, Action) Program.commandlist_.Add("Notepad", New Action(AddressOf Notepad)) Console.Write(">>") 'Program.CurrentString = …

Member Avatar
Member Avatar
+0 forum 1

My program find the amount of specific word such as "whale" and "thee", but ignore "thee,", "whale....", and so on. How can I contain them? #include<stdio.h> #include<string.h> #include<ctype.h> int main(){ FILE *md,*out; char CHA[255]; char cha[255]; cha[255]=tolower(CHA[255]); char thee[]="thee"; char chapter[]="chapter"; char whale[]="whale"; char meet[]="meet"; int th=0; int ch=0; int wh=0; int me=0; md=fopen("moby_dick.txt","r"); out=fopen("output.txt","w"); if(md==NULL){ printf("Empty text"); return 1; } while(feof(md)==0){ fscanf (md,"%s",&cha); if(strcmp(cha,thee)==0 ){ th++; } if(strcmp(cha,chapter)==0){ ch++; } if(strcmp(cha,whale)==0){ wh++; } if(strcmp(cha,meet)==0){ me++; } } printf("%d\n",th); printf("%d\n",ch); printf("%d\n",wh); printf("%d\n",me); fprintf(out,"%d\n",th); fprintf(out,"%d\n",ch); fprintf(out,"%d\n",wh); fprintf(out,"%d\n",me); fclose(md); fclose(out); }

Member Avatar
Member Avatar
+0 forum 3

G'day everyone! I'm fairly new to C++, so bear with me if this is painfully obvious. I'm trying to get a user to guess a string, which is just a vector containing random capital letters. That random letters part works great, however I can't figure out how to get my program to actually compare user input to the generated string in question. I decided to try a very simple program that would do only this and customize it to fit my main program, but I hit a bit of a bump. I need my program to print out that the …

Member Avatar
Member Avatar
+0 forum 4

# **OLD** # [URL=http://s127.photobucket.com/user/yoda3ddd/media/codemap_zps4115ff7e.jpg.html][IMG]http://i127.photobucket.com/albums/p158/yoda3ddd/codemap_zps4115ff7e.jpg[/IMG][/URL] The Data Namespace Core Friend Module Func Public OkButton As Button Public CancelButton As Button Public ProgBar As ProgressBar Private Sub ProgressLoop() Do Func.ProgBar.PerformStep() Threading.Thread.Sleep(1) Loop End Sub #Region "Constants" Public Const DataRoot As String = "C:\AFormData\" Public Const IMG_PATH As String = "C:\AFormData\img" Public Const LoadImage As String = "C:\AFormData\img\codemap_zps4115ff7e.jpg" Public Const LINE_TERMINATOR As String = ">>" Public Const LoadImageX As Integer = 0 Public Const LoadImageY As Integer = 0 Public Const LoadBarFailedMessage As String = "Loading Bar Denied" Public Const ResizeMessage As String = "Current Form Resizing" Public Const NoCommandMsg As String = …

Member Avatar
Member Avatar
+0 forum 6

Hi, I have written a code for Roman Numeral basic mathematical operation in C++. How to do unit testing for it/ How to write unit testing program for it? Here is the code: #include <iostream> #include <string> using namespace std; //Function to convert decimal number to roman string decimal_to_Roman(int number) { string roman = ""; while (number > 0) { if (number >= 1000) { roman += "M"; number -= 1000; } else if (number >= 500) { roman += "D"; number -= 500; } else if (number >= 100) { roman += "C"; number -= 100; } else if …

Member Avatar
Member Avatar
+0 forum 4

I wonder how to handle exception in `ResponsesEntity`. When it receive wrong url, it supposes to go to the `catch` block and display the `log`. But I keep getting error message in console. The `try-catch` not working as it not display log message. @GetMapping("abc/{Id}") public ResponseEntity info(@PathVariable("Id") String id) { HttpEntity httpEntity = new HttpEntity(buildHttpHeaders()); String theUrl = url + "/revenue_harvest/transactions/" +id; ResponseEntity<TDto> responseEntity = restTemplate.exchange(theUrl, HttpMethod.GET, httpEntity, TDto.class); TDto tdto = responseEntity.getBody(); Tran tran = new Tran(); try { tran.setDate(new Date()); tran.saveAndFlush(tran); // save to database }catch(Exception e) { log.info("Log: "+e); } return responseEntity; } Error org.springframework.web.client.HttpClientErrorException: 404 Not …

Member Avatar
Member Avatar
+0 forum 3

I have a JSON file, and I need to convert some of the entries into anchor tags. I think a regular expression is the way to go, but I'm terrible with them. I need to convert: "id":"1","template_name", into: "<a href='getTemplate?1'>template_name</a>", The text "id" is hard-coded, present in every instance where I need this conversion to happen. The "1" and the "template_name" are variable, changing record by record.

Member Avatar
Member Avatar
+0 forum 1

im trying to make a loop that asks a command from stdin and checks if it's valid or not, and the command for example will be in this format : Command then seperated with any amount of spaces then a Letter then comma then a double a comma and a double example : command A,24.3,7.8 doesnt matter how many spaces there are so it may be : command A, 24.3,7.8 and thought i'd use strtok but not sure how does it work... and to use strtok to recieve a pointer which would be the end of each word, so the …

Member Avatar
Member Avatar
+0 forum 4

Hello, this is John McPherson, writing code for the U.S. Department of Labor. I am working on developing a new Benefit Finanacila Model for the state of Oregon, and I am having a problem with the printing of large numbers that are converted to strings. It works most of the time, but occasionally the least significant digits are dropped. Below is a sample fo the bad output: COMBINED QUARTERLY OUTPUT INSED TOTAL TAXABLE CONTRIBUTIONS BENEFITS ENDING TF INTEREST UNEMP WAGES WAGES BALANCE RATE (000) (000) 2016-1 2.56 16,334,284 14,112,227 149,661,400 133,579,377 2,813,499,313 15,770,753 2016-2 1.95 17,010,421 11,302,061 227,955,435 111,617,704 2,945,720,62 …

Member Avatar
Member Avatar
+0 forum 4

Good day, I have to make a data scraper and after I take the informations I have to get them in a CSV file.This is the original request:For the final java academy test you have to create a small crawler. What do I mean by "crawler"? A crawler it is a small java program that scans everything from a website. It is similar to what google is doing when it is indexing the whole world wide web. So here are the details. Your crawler must crawl all the products found in the website www.reifen.com When you enter this website the …

Member Avatar
Member Avatar
+0 forum 1

how to update Jtable by editing its cell with netbean. someone help please

Member Avatar
Member Avatar
+0 forum 1

Hi, I am trying to write a simple script that reads a file for two time stamps and then finds the delta. However, I can't get passed converting the time strings to datetime objects. I haven't done any coding since college and I everything I've read says this code should work. I am getting nowhere. I am sure there are much more efficient ways to do this but right now I just want it to work. I removed some of the code not related to the problem to make it less confusing. from datetime import datetime # Open file f …

Member Avatar
Member Avatar
+0 forum 10

I work in windows form 2015 when i need to read qr code i connect scanner to computer as USB then open my windows form and put cursor in specific text box as textbox4 and it read success so that How to recieve data reading from scanner to textbox4 only and split data if textbox 4 is hidden ? private void textBox4_KeyDown(object sender, KeyEventArgs e) { string[] lines = textBox4.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); if (lines.Length > 4) { textBox1.Text = lines[1].Substring(lines[1].IndexOf(":") + 1); textBox2.Text = lines[2].Substring(lines[2].IndexOf(":") + 1); textBox3.Text = lines[3].Substring(lines[3].IndexOf(":") + 1); textBox5.Text = lines[4].Substring(lines[4].IndexOf(":") + 1); …

Member Avatar
Member Avatar
+0 forum 1

Hello, I am working on a new screen for a program used by the U.S. Department of Labor. I am getting a signal SEGV (access to address exceeded protections) when I try to excute the command snprintf(rowh[1] + 30, 4, "%4d", baseyr + 1);. The string I am trying to copy into is declared char *rowh[] = {"Percent average annual wage from prior year =>","Maximum taxable wage base for YYYY =>","Percent average annual wage from second prior year =>"}; The snprintf statement is attempting to overwrite the YYYY in the second string declared in the rowh array. The base year …

Member Avatar
Member Avatar
+0 forum 1

how do i make a code that willfind the distance wether or not your speed is a float or an integer. please help i get no assistance in my class as techer is awful

Member Avatar
Member Avatar
+0 forum 2

Friend Module Program Public Declare Function SetConsoleTitle Lib "kernel32" Alias "SetConsoleTitleA" (ByVal lpConsoleTitle As String) As Long Declare Function ShellExecuteA Lib "shell32.dll" ( _ ByVal hWnd As IntPtr, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Integer) As IntPtr Dim run As String = "Run" Dim opstring As String Private Const OK As Integer = 0 Private Const Errenous As Integer = 1 Sub Main() InitConsole() While run = "Run" Console.Write(">>") GetLine() End While End Sub Sub InitConsole() SetConsoleTitle("Digital Console") opstring = String.Empty Console.WriteLine("Initialized") …

Member Avatar
Member Avatar
+0 forum 5

Hi All, I have to implement string class and write a program to perform string manipulation in Mystring class. input: "he is going to school" output Case 1: (n=1) He school to going is Case 2: (n=2) He is school to going Case 3:(n=5) No changes Case 4 n<=0 school to going is He. int main() { char str[100]= ""; int n; //Take input str and n from console MyString obj (str); obj.manipulate(n);//Actual logic obj.display();// This will print output return 0; } can anybody throw some light on approach to for case 1 and case 2.

Member Avatar
Member Avatar
+0 forum 13

The End.