[Solved] Why echo dont show my string?

A function cannot be public unless it is part of a class. Remove that keyword and it works. Although I shall add that your code is a bit confusing. You will either want to have a function that prints something or a function that returns something and is assigned to a variable. You’re doing a … Read more

[Solved] How do I refresh tkinter window totally in python with a refresh button [closed]

The simplest way is to implement the entire window as a subclass of a tk Frame, and then destroy and recreate it. Your code might look something like this: import Tkinter as tk class Example(tk.Frame): def __init__(self, parent): tk.Frame.__init__(self, parent) <other code here…> class Application: def __init__(self): self.root = tk.Tk() self.frame = None refreshButton = … Read more

[Solved] Add Hidden Input onCheck

To make it hidden just replace type=”text” with type=”hidden” 🙂 JQuery: <form id=”myForm”> <input onclick=”addRemoveHiddenInput(‘testId’, ‘testName’, ‘testValue’)” type=”checkbox” id=”mc” name=”paymentMethod” value=”Mastercard”><label for=”mc”> Mastercard</label> </form> <script> function addRemoveHiddenInput(id, name, value) { if ( $(‘#’ + id).length > 0 ) { $(‘#’ + id).remove(); } else { $(‘#myForm’).append(‘<input type=”text” name=”‘ + name + ‘” value=”‘ + value … Read more

[Solved] How to replace comma with space in text file using VBA [closed]

This should do the trick: Sub foo() Dim objFSO Const ForReading = 1 Const ForWriting = 2 Dim objTS ‘define a TextStream object Dim strContents As String Dim fileSpec As String fileSpec = “C:\Test.txt” ‘change the path to whatever yours ought to be Set objFSO = CreateObject(“Scripting.FileSystemObject”) Set objTS = objFSO.OpenTextFile(fileSpec, ForReading) Do While Not … Read more

[Solved] “Rotating” tables in Lua?

function transpose(m) local rotated = {} for c, m_1_c in ipairs(m[1]) do local col = {m_1_c} for r = 2, #m do col[r] = m[r][c] end table.insert(rotated, col) end return rotated end function rotate_CCW_90(m) local rotated = {} for c, m_1_c in ipairs(m[1]) do local col = {m_1_c} for r = 2, #m do col[r] … Read more

[Solved] file handling I/O c++ error

You have p as some pointer. Who is going to allocate the memory that pointer points to? In C it is almost always the responsibility of the caller to allocate any buffers before the call. If you don’t want to, then use a std::string instead. solved file handling I/O c++ error

[Solved] strftime(“%A”) output is string. but assigning variable is expecting Int [closed]

There’s two issues. First, to get the day of the month, you should use %d, not %A with strftime(). date = time.strftime(“%d”); Second, this returns the day as a string, not as an integer, but datetime.date() requires its arguments to be integers, so you need to convert it with int(date) date = int(time.strftime(“%d”)) But there’s … Read more

[Solved] Ajax Doesn’t work in Chrome,Firefox, & Opera

I recommend to use jQuery or other framework, that will be always aware of all the browsers specific stuff. If you prefer to use native code, you will need some extra code. First, dont rely just in ActiveXObject(“Microsoft.XMLHTTP”); and XMLHttpRequest that probably wont be always available. instead of that, use: function GetXmlHttpObject(){ var xmlHttp=null; try … Read more