64 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for logicslab

Dear Friends, I have a string with structure $selectedTime = "2017-02-10 07:00,2017-02-10 08:00,2017-02-11 09:00"; I need to convert it as   {"2017-02-10":[{"start":"07:00"},{"start":"08:00"}],"2017-02-11":[{"start":"09:00"}]} any idea ? please advise asap Thanks Anes

Member Avatar for logicslab
0
648
Member Avatar for nitin1

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; } // …

Member Avatar for AssertNull
0
3K
Member Avatar for Gl753

My code has me stumped, My method is right...I think but the output begs to differ. Basically this code is supposed to convert seconds to minutes but the output is somewhat off..here's what I have don so far. String input = JOptionPane.showInputDialog(null, "Enter a value for seconds (positive whole number): …

Member Avatar for oussama_1
0
291
Member Avatar for Excizted

Hello, I hope someone is more knowledgeable in Java than me while still knowing PHP! The following Java code makes a hash from a string, and I need a PHP equivalent that makes the exact same hashes. Simply md5() does not do the trick, and I looked at some PHP …

Member Avatar for Excizted
0
1K
Member Avatar for sana.f.qureshi_1

Hello again good people, i have done some coding on lexical analyzer phase of compiler but it is giving me some error that i am unable to understand.. Fair Warning: Code is a little longer. Here is the code: # include <iostream> # include <fstream> # include <string.h> # include …

Member Avatar for VertexF3
0
1K
Member Avatar for nouth

my [previous question](http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/477450/convert-str-to-var) about this dealt with global vars but unfortunatley the `window` of opportunitys doesn't work with this next example because it alerts 4 times instead of only 1 test("a","b","c"); function test(var0,var1,var2,var3) { for(var i=0; i<4; i++) { if(window["var"+i]===undefined) {alert("test");} } } this may not be very clear so …

Member Avatar for felgall
0
345
Member Avatar for nouth

this is my attempt var test=["a","b","c"]; var var0="a"; for(var i=0; i<1; i++) { test.splice(test.indexOf(test[window["var"+i.toString()]]),1); } alert(test); it alerts "a,b" but I want it to alert "b,c" ref:http://stackoverflow.com/questions/5613834/convert-string-to-variable-name-in-javascript

Member Avatar for nouth
0
421
Member Avatar for Ezekiel_1

//I am writing a program that converts from one unit like mm to another e.g cm. The program should prompt invalid unit when something other than mm, cm, m or km is entered as the unit to be converted from or unit to be converted to. The problem is how …

Member Avatar for Ezekiel_1
0
9K
Member Avatar for droid2014

Hi - I am having an issue and can't seem to get my head around it. I am trying to calculate GBP from EUR - which should be easy but for some reason my returned value is always a few GBP more than it should be, yet I do the …

Member Avatar for droid2014
0
223
Member Avatar for skran

Hi all! I have a user interface where I want to filter a datagridview.. I 've achieved to create filters but I 've failed to filter tha data by date.. I have a sql db and the column of date is of datetime type. When I try to filter the …

Member Avatar for eldarzeynal
0
1K
Member Avatar for Sci3nc3F1cti0n

Hey guys, this is my solution to a simple problem and I was looking for some feedback on my code. Please post any criticism you may have about it. //Test project for string to binary conversion// #include <iostream> #include <string> using namespace std; void binConvert(string ConvertMe){ int ArraySize = ConvertMe.length(); …

Member Avatar for tinstaafl
0
771
Member Avatar for mesbahuk

I have a Java code block like following: Vector<NameAddress> route = dialog.getRoute(); for ( Enumeration<NameAddress> e = route.elements(); e.hasMoreElements(); ) { // some more to copy route to another Vector<> } I am trying to convert it in C# and here is my code: List<NameAddress> route = dialog.getRoute(); for ( …

Member Avatar for C#Jaap
0
298
Member Avatar for mesbahuk

In my *Java to C#* Conversion Project, at one point I came to use java's `startsWith(string prefix, int toffset)` method. I used a substring to solve it for C#. Java Code Snippet: String str1 = "one over the coocoo's head"; String str2 = "someone"; System.out.println(str1.startsWith(str2, 4)); C# does not have …

Member Avatar for JoeProgrammer
0
397
Member Avatar for mesbahuk

For my **Java to C#** conversion project, I need to use something equivalent to Java's `Calender` class. I have some codes like: Calender cal = Calender.getInstance(); long time = Calendar.getInstance().getTime().getTime(); long time2 = System.currentTimeMillis(); which returns some random values at different times. I have come to know C-sharp's `DateTime` is …

Member Avatar for ddanbe
0
977
Member Avatar for LeNenne

Hi folks I wonder if this code can bee converted to VB6 or there are a simular code. Lenny Dim strMSG As String > strMSG = "This Demo Has Expired" & vbCrLf & "Please Contact Me to Obtain > the Full Version" > > If DCount("[autonumberID]", "app.path/phonetel.mdb") > 20 Or …

Member Avatar for bonzo2008
0
197
Member Avatar for mesbahuk

I have a Java code block like following: public TcpConnection(TcpSocket socket, long alive_time, ITcpConnectionListener listener) { init(socket,alive_time,listener); start(); } For the conversion in C#, When I try to replace the `start()` method with `System.Threading.ThreadStart()`, it gives an error. How can I start a thread in C#?

Member Avatar for ddanbe
0
279
Member Avatar for mesbahuk

I'm currently working in a java to c# conversion project. In one part I got this Java code snippet. public CustomType someMethod(Message msg) throws IOException { byte[] data = msg.toString().getBytes(); } to my understanding, data contains the byte representation of the string *msg.toString()* But when I try to write it …

Member Avatar for mesbahuk
0
262
Member Avatar for mesbahuk

In java this is how a DerivedClass can implement it's BaseClass's constructor. public DerivedClass extends BaseClass { //some properties public DerivedClass(param) { super(param); } } I have learnt C-Sharp's *base()* does the similar thing, but when I replace *super(param)* with *base(param)*, it does not gives what I'm expecting. How can …

Member Avatar for Ketsuekiame
0
265
Member Avatar for mesbahuk

I have been working on a conversion project for last few days where I need to convert a Java library to C#. At one point I came to java's certain feature called [Exceptions Thrown by a Method](http://docs.oracle.com/javase/tutorial/essential/exceptions/declaring.html). Here is a little glimpse of it: public boolean isRequest() throws NullPointerException { …

Member Avatar for Ketsuekiame
0
303
Member Avatar for mesbahuk

In the conversion process of a java to c# project, i have come to java's ***indexOf()*** function in ***string.java*** class, which takes in two integers (int ch, int fromIndex) and return some integer value for a char (i'm guessing its an ASCII value). I need to know if there is …

Member Avatar for mesbahuk
0
653
Member Avatar for mesbahuk

I am currently converting a Java library to C# .Net, please help me to find if there are C# equivalents of the following java specifics: * RuntimeException() * IllegalStateException() * StringBuffer Any resource on Java to C# conversion will be very helpful. Thanks in advance.

Member Avatar for mesbahuk
0
268
Member Avatar for SLMQC

I am new to VB and working on a homework assignment that I’ve seen posted in years past. The threads were aged a year or more so I’m starting a new discussion. I am writing a program that allows me to enter sales for 5 stores and display a bar …

Member Avatar for tinstaafl
0
330
Member Avatar for DaveyMoyes

Hi everyone - I am helping to build a website for a good friend of mine & we are adding into the website an easy to read conversion rate. The only problem we have at the moment is the value is being displayed incorrectly. for instance - If the website …

Member Avatar for DaveyMoyes
0
154
Member Avatar for de Source

hi i have an string array in which i have combinations of 0's and 1's like on index 0 i have "01", on index 1 i have "11", on index 2 i have "00", on index 3 i have"10" etc is their any possibilty that i can take these values …

Member Avatar for ddanbe
0
211
Member Avatar for Hazuan Nazri

hello, i need some help here, i already bind my database coloumn 'NAMA' to my combobox 'cbNAMA', and now i want to show data from my database on textbox by selecting the row using cbNAMA but i got this error "System.InvalidCastExeception: Conversion from type 'DBNULL' to type 'String' is not …

Member Avatar for G_Waddell
0
1K
Member Avatar for somjit{}

i was watching [this video](http://www.youtube.com/watch?v=jTSvthW34GU&list=EC9D558D49CA734A02&index=2&feature=plpp_video) about type conversion and what the compiler does while converting from small byte formats to large byte formats(and vice versa) etc etc, and tried to write a code for it... but seems that function calls in my code are getting completely bypassed... once again, here …

Member Avatar for somjit{}
0
401
Member Avatar for Yarra

Hi I programmed a tower defence game through java as a simple java application. I was wondering what steps do I have to take to convert it into a fully functional java applet to be uploaded onto the internet.

Member Avatar for Justinvzepeda
0
287
Member Avatar for trishtren

Hey, I was hoping someone can help me convert a piece of php code, im not really sure where to start pack( 'v', $test ); The pack php function above takes in an integer and converts it to an unsigned long. V - unsigned long (always 32 bit, little endian …

Member Avatar for keith.pastorek
0
1K
Member Avatar for abhishek_ag

Hi Guys, I have written the below program to convert binary to octal, it is giving me erroneous results. On entering 1111 as the input number I should get 17 as the output, whereas I am getting 16707000337 as the output. Kindly help me out, below is my program: /*program …

Member Avatar for abhishek_ag
0
262
Member Avatar for Sunciti

The End.