[Solved] Retrieving URL from MySQL database

You need to give your anchor tag’s href property some value. <a href=”https://stackoverflow.com/questions/35997885/<?php echo $results[“Website’] ?>”><?php echo $results[ ‘Website’]?></a> As it is now, the href property is empty, which some browsers will interpret as pointing to your current page. This is what’s causing your page to reload. 1 solved Retrieving URL from MySQL database

[Solved] sum up an array of integers in C# [closed]

It isn’t clear what you want… If you want to sum some numbers so that the sum stops summing when it reaches 1002 you can: List<int> list = new List<int> { 4, 900, 500, 498, 4 }; var lst = list.Skip(2).Take(3); int sum = 0; foreach (int num in lst) { int sum2 = sum … Read more

[Solved] Calculate gradient of data in R (or other) [closed]

As Gregor points out, you need a more fine-grained representation of your time variable if you want to look at how temperature changes by time. There are two solutions. The best option is if your data are ordered in the order they were recorded (so the first row was the first measurement, second row second … Read more

[Solved] Use method from other class like native methods?

Okay several possibilities: Instantiate A: A a=new A(); a.xyz(); (you do not want this) Heredity: public class B extends A {…} and public class A extends ZZZZZ{…} so you can still extend ZZZZZ; Interface: public interface A{…} public class B extends ZZZZZ implements A{…} Static Method: public class A{ public static void xyz() { System.out.println(“hello”); … Read more

[Solved] select yesterday date in where condition

SELECT * FROM yourTable WHERE (FilteredPhoneCall.createdon >= dateadd(day,datediff(day,1,GETDATE()),0) AND FilteredPhoneCall.createdon < dateadd(day,datediff(day,0,GETDATE()),0)) OR (FilteredPhoneCall.modifiedon >= dateadd(day,datediff(day,1,GETDATE()),0) AND FilteredPhoneCall.modifiedon < dateadd(day,datediff(day,0,GETDATE()),0)) solved select yesterday date in where condition

[Solved] Please tell whats the error… why it’s not compiling?

Use this printf(“%s” , word); instead of printf(“%s” , *word); Because the *word will be the value at word[0] which is a character. The printf however is looking for an array of chars, thus causing it to segfault. strings are just arrays of characters terminating with ‘\0’. 1 solved Please tell whats the error… why … Read more

[Solved] C++ no equal sign but compiles without assigning value

If ERR_NOT_OK is defined as -41, then your ret_value ERR_NOT_OK; is substituted with ret_value -41; which is a valid expression statement, even though it is effectively a no-op. What was originally intended as unary – gets interpreted as binary – in this context. This is why it is a good idea to define it as … Read more

[Solved] Filter Name with Starting Letter

it’s not C#, it’s SQL. in SQL you can use like clause. ex: select * from tblcustomer where CustomerName like ‘A%’ it will display customer name start with letter A EDIT DECLARE @CustomerName varchar(200) = NULL SELECT TOP 100 * FROM tblCustomer WHERE CustomerName like CASE WHEN @CustomerName IS NULL THEN ‘%’ ELSE @CustomerName + … Read more

[Solved] Make calculations in csv with php

I would maybe do it more simple. If you didn’t know how many columns you could do the extra loops to get column names, but it does not look necessary. $output = “datetime, value1, value2\n”; // Column names while ($row = mysql_fetch_array($sql)) { $output .='”‘ . $row[0] . ‘” ,’; $output .='”‘ . $row[1] . … Read more

[Solved] Understanding some code from my homework

Basically, that code does this: 1) Initializes temp array with 100 positions (all set to 0); 2) Iterates over data array and increments the value relative to the index of the data array value it’s processing. Take this example: int[] data = {23,11,10,23,5}; temp[data[0]] += 1 temp[23] += 1 temp[23] = temp[23] + 1 = … Read more

[Solved] AES encryption on file over 1GB

You are reading the entire file at the start of the method: byte[] bytesToBeEncrypted = File.ReadAllBytes(file); This is causing the OutOfMemoryException. Here’s an idea of how you’d do this: static void EncryptFile(string file, string password) { byte[] passwordBytes = Encoding.UTF8.GetBytes(password); byte[] salt = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }; … Read more

[Solved] Creating simple view engine using JavaScript [duplicate]

I found the below to be proper way: var templater = function(html){ return function(data){ for(var x in data){ var re = “{{\\s?” + x + “\\s?}}”; html = html.replace(new RegExp(re, “ig”), data[x]); } return html; }; }; var template = new templater(“<p>hey there {{ codeName }}</p>”); var div = document.createElement(“div”); div.innerHTML = template({ codeName: “JavaScript … Read more