MaxedUpMedia – Official thread

Hello guys!

We’re a brand new affiliate network making a dent in the market. We have a good number of in-house campaigns and several direct ones showing exceptional results.

Main markets for now are UK and US but we are open to work in any geo.

https://www.maxedupmedia.com/

Sign up as a publisher here: https://account.maxxrevnet.com/sign-up/publisher
Sign up as an advertiser here: https://account.maxxrevnet.com/sign-up/advertiser

Support email:
SEMrush

If you have any questions or would like some help in setting up and getting things rolling feel free to reach out to me via Skype: silver.karutoom

 

python – Thread Art Generation that Creates Embroidery Files

I have made a thread art generator that creates thread patterns from images. Mine is a bit different as it outputs an embroidery file (It embroiders quite nice, though the settings need a lot of tweaking and the output file needs resizing) The code is quite inefficient, but that’s python for you.

from PIL import Image, ImageOps, ImageDraw, ImageEnhance
import numpy as np
from tqdm import tqdm
from skimage import feature
from skimage.morphology import dilation

from pyembroidery import *

#Variables
base_image = "heart.jpg"
thread_count = 200
nail_count = 450
min_dist = 30
contrast = 0.8
edge = 2
edge_size = 0
sizing = 5

def points_gen(r, n):
    t = np.linspace(0, 2*np.pi, n, endpoint=False)
    x = (r - 1) * np.cos(t) + r 
    y = (r - 1) * np.sin(t) + r 
    return np.c_(x.astype(int), y.astype(int))

def plotLineLow(x0, y0, x1, y1):
    dx = x1 - x0
    dy = y1 - y0
    yi = 1
    if dy < 0:
        yi = -1
        dy = -dy

    D = (2 * dy) - dx
    y = y0

    for x in range(x0, x1+1):
        yield (x, y)
        if D > 0:
            y = y + yi
            D = D + (2 * (dy - dx))
        else:
            D = D + 2*dy

def plotLineHigh(x0, y0, x1, y1):
    dx = x1 - x0
    dy = y1 - y0
    xi = 1
    if dx < 0:
        xi = -1
        dx = -dx

    D = (2 * dx) - dy
    x = x0

    for y in range(y0, y1 + 1):
        yield (x, y)
        if D > 0:
            x = x + xi
            D = D + (2 * (dx - dy))
        else:
            D = D + 2*dx

def bresenham_line(x0, y0, x1, y1):
    if abs(y1 - y0) < abs(x1 - x0):
        if x0 > x1:
            return plotLineLow(x1, y1, x0, y0)
        else:
            return plotLineLow(x0, y0, x1, y1)
    else:
        if y0 > y1:
            return plotLineHigh(x1, y1, x0, y0)
        else:
            return plotLineHigh(x0, y0, x1, y1)

def white_to_transparency(img):
    x = np.asarray(img.convert('RGBA')).copy()

    x(:, :, 3) = (255 * (x(:, :, :3) != 255).any(axis=2)).astype(np.uint8)

    return Image.fromarray(x)

def is_close(n, center, offset, length):
  lo = (center - offset) % length
  hi = (center + offset) % length
  if lo < hi:
      return lo <= n <= hi
  else:
      return n >= lo or n <= hi

def embroider(final_line):
    pattern = EmbPattern()

    pattern.add_block((line(0) for line in final_line), "black")

    write_dst(pattern, "out.dst", {"long_stitch_contingency":CONTINGENCY_LONG_STITCH_SEW_TO})

#Open Image
img = Image.open(base_image) 
img = img.resize((500, 500))
size = img.size

#Remove Trasperency
img = img.convert('RGBA')
background = Image.new('RGBA', size, (255,255,255))
img = Image.alpha_composite(background, img)

#Make B&W
img = img.convert("L")

#edge magic
edges = feature.canny(np.array(img), sigma=edge)
for _ in range(edge_size): edges = dilation(edges)
edges = white_to_transparency((ImageOps.invert(Image.fromarray((edges * 255).astype(np.uint8)).convert("L"))))

#Make RGBA
img = img.convert('RGBA')

#Add edge
img = Image.alpha_composite(img, edges)

#Make B&W Again
img = img.convert("L")

#Circle Crop
mask = Image.new('L', size, 255)
draw = ImageDraw.Draw(mask)
draw.ellipse((0, 0) + size, fill=1)
img = ImageOps.fit(img, mask.size, centering=(0.5, 0.5))
img.paste(0, mask=mask)

#Contraster
enhancer = ImageEnhance.Contrast(img)
img = enhancer.enhance(contrast)
img.show()

points = points_gen(img.size(0) / 2, nail_count)
base_point = 0
final_line = ()

img = np.asarray(img).copy()
for _ in tqdm(range(thread_count), desc="Calculating Threads"):
    #get avg lumin
    vals = dict()
    max_num = len(points)
    lines = ( (i, bresenham_line(*points(base_point), *point))
            for i, point in enumerate(points) 
            if not is_close(i, base_point, min_dist, max_num))

    for i, line in lines:
        values = (img(value(1))(value(0)) for value in line)
        vals(sum(values)/len(values)) = i

    line = vals(min(vals.keys()))

    final_line.append((tuple(points(base_point)), tuple(points(line))))

    for pixel in bresenham_line(*points(base_point), *points(line)):
        img(pixel(1))(pixel(0)) = 255

    base_point = line

final_line = (((i * sizing for i in x) for x in line) for line in final_line)
size = size(0)*sizing
output = Image.new('L', (size, size), 255)
out_draw = ImageDraw.Draw(output)

for line in final_line:
    out_draw.line((*line(0), *line(1)), 0)

output.show()
output.save("out.jpg")

embroider(final_line)

I would show the embroidered piece, but it’s of a family member and quite high in detail.

c# – Simple MemoryCache implementation for thread safe caching

After much prompting from this post I wanted to build a simple, in-memory, thread-safe cache.

The only caveat (as far as I was originally concerned) was the need for two different absolute expiration times for cached objects – those being based on a property of the item being cached (IsFailureItem). This is for a .NET Framework 4.6.1 solution.

I am primarily interested in anything which makes this either thread-unsafe, leak memory or simply bad practice. I know the class itself could be generically typed, but that is a decision for the future.

public class CacheItem
{
    public IEnumerable<DataItem> Response { get; set; }
    public bool IsFailureItem { get; set; }
}

public class CacheHelper
{
    public static CacheHelper Cache { get; set; }
    private static IMemoryCache InMemoryCache { get; set; }

    static CacheHelper()
    {
        Cache = new CacheHelper();
        InMemoryCache = new MemoryCache(new MemoryCacheOptions { });
    }

    private CacheHelper() { }

    public CacheItem this(string key)
    {
        get => InMemoryCache.Get<CacheItem>(key);
        set => InMemoryCache.Set<CacheItem>(key, value, value.IsFailureItem ? FailureCacheEntryOption : SuccessCacheEntryOption );
    }

    private static MemoryCacheEntryOptions FailureCacheEntryOption => new MemoryCacheEntryOptions()
    { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(EnvironmentHelper.CacheFailureSecondsToLive) };

    private static MemoryCacheEntryOptions SuccessCacheEntryOption => new MemoryCacheEntryOptions()
    { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(EnvironmentHelper.CacheSuccessSecondsToLive) };
}

c# – Erro “O thread de chamada não pode acessar este objeto porque ele pertence a um thread diferente.”

Tenho uma aplicação WPF que preciso manipular um textBox. Porém ele dá o seguinte erro ao rodar a parte do código que manipulo o textBox: System.InvalidOperationException: ‘O thread de chamada não pode acessar este objeto porque ele pertence a um thread diferente.’ O erro acontece na linha “txt_transcriber.Text = e.Result.Text”.

namespace solucao_desktop
{
public partial class TranscriberWindow : Window
{
    public TranscriberWindow()
    {
        InitializeComponent();
    }
    public void transcribrer()
    {
        txt_transcriber.Foreground = Brushes.White;
        var speechConfig = SpeechConfig.FromSubscription("16c50d2a281d4e9cb0834d4ee3a5d9", "brazilsouth");
        speechConfig.SpeechRecognitionLanguage = "pt-BR";
        
        using var audioConfig = AudioConfig.FromDefaultMicrophoneInput();
        using var recognizer = new SpeechRecognizer(speechConfig, audioConfig);
        var stopRecognition = new TaskCompletionSource<int>();

        recognizer.Recognizing += (s, e) =>  //Enquanto estiver captando algum áudio
        {
            txt_transcriber.Text = e.Result.Text;
        };

        recognizer.StartContinuousRecognitionAsync();

        Task.WaitAny(new() { stopRecognition.Task });
    }
}

windows – How do I see java thread names in Process Explorer?

I have named a thread in my program as “Input Acceptor”.

userInputThread = new Thread("Input acceptor") {
    public void run(){
        while(true)
           //dosomething
    }
};

If I run the program and check Process Explorer, I do not know where to look for it.
I went to java.exe -> Threads tab, but I don’t know where to find the thread called “Input acceptor” that I just ran.

Where is this thread? Am I looking in the right process for it?

I just want to debug my program by looking at its running threads. How should I do this in Process Explorer? Or is ProcessExplorer unable to show the name of it? If so, is there any other tool i can use to look at running java threads along with their assigned thread names?

mac – GDB Hangs after “New Thread” on macOS

I have built GDB from source on macOS 12.0 and codesigned it. However, every time I try to debug a program, I get this:

(gdb) b main
Breakpoint 1 at 0x10000324f: file main.cpp, line 50.
(gdb) run
Starting program: /Users/(path redacted)/a.out 
(New Thread 0x2a03 of process 2389)

and then GDB hangs. I have been compiling C++ programs with g++. Here are some things I have tried:

  1. Compile with -g option.
  2. Compile with -ggdb option.
  3. Compile with -ggdb3 option.
  4. Run with sudo
  5. Kill and re-run gdb repeatedly.
  6. Try different binaries.
  7. Disable SIP
  8. Add more breakpoints.

I do not get taskgated / Mach Port errors; only the New Thread message.

I realize that this is a near-duplicate of this, but I didn’t see a working answer on that question.

For reference, here are my versions:

$ g++ --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin21.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ gdb --version
GNU gdb (GDB) 10.2

Looking for Content Writers – Check Thread for More Details

Hi,

I'm looking for content writers (Indian's Only) who can write about Data Recovery. Looking for 800 words article.

Please DM me your sample works as well as your pricing details.

Thank you.

Selling – My Official Domain Selling Thread. Some Domains Aged From 2001. Make Me an Offer | Forum Promotion

The easiest method of transfer is known as a Push and is within the same registrar. Those types of transfers are within the same domain registrar but are instant and are instantly transferred. I prefer this method to get you the domain fast but if the specific domain needs to be transferred outside of it, it’s possible but takes 5-7 days to receive. Some are eligible and some are not for outbound transfers. Just ask and I will let you know.

Payment method is paypal only. As I am now buying and reselling domains, list will stay updated as new ones are obtained. This could also be a good reselling opportunity.

I have decided not to price any of the domains. Just simply make me an offer. Make me an offer and I will let you know if I’m interested.

Domains currently for sale:

Domain: TheGeneralForums.com
Expiry Date: June 23rd, 2022
Registrar: Namecheap

Domain: GeneralForumz.com
Expiry Date: June 18th, 2022
Registrar: NameCheap

Domain: WebmasterChats.com
Expiry Date: July 3rd, 2022
Registrar: NameCheap
Extra Info: Domain Aged from 2001

Domain: Webmaster-Chat.com
Expiry Date: July 3rd, 2022
Registrar: NameCheap
Extra Info: Domain Aged from 2001

Domain: WebmasterGab.com
Expiry Date: July 3rd, 2022
Registrar: NameCheap
Extra Info: Domain Aged from 2006

Domain: WebmasterChatter.com
Expiry Date: July 3rd, 2022
Registrar: NameCheap
Extra Info: Domain Aged from 2006

Domain: Gun-Forum.com
Expiry Date: June 18th, 2022
Registrar: NameCheap

Domain: LegionForums.com
Expiry Date: June 18th, 2022
Registrar: NameCheap

Domain: WarzoneForums.com
Expiry Date: June 18th, 2022
Registrar: NameCheap

Domain: VapesForum.com
Expiry Date: June 18th, 2022
Registrar: NameCheap

Domain: a-hk.com
Expiry Date: June 18th, 2022
Registrar: NameCheap

Domain: EmpiresGaming.com
Status: SOLD

Domain: HikingType.com
Expiry Date: June 18th, 2022
Registrar: Godaddy

Domain: CanYourCompany.com
Expiry Date: Feb 26, 2022
Registrar: NameCheap

Domain: TheXboxCloud.com
Expiry Date: Feb 11, 2022
Registrar: 1and1 (ionos.com)

Domain: PanGlobalEnergy.com
Expiry Date: Feb 11, 2022
Registrar: NameCheap

Domain: EAGenerals.com
Expiry Date: Mar 3, 2022
Registrar: NameCheap
Extra Info: Domain aged from year 2003

Domain: 3dGameServer.com
Expiry Date: Mar 3, 2022
Registrar: NameCheap
Extra Info: Domain aged from year 2000

Domain: BigDataSpeaks.com
Expiry Date: Jan 13, 2022
Registrar: Godaddy

Domain: TheLadsGaming.com
Status: SOLD

Domain: TravelStoryGroup.com
Expiry Date: Feb 11, 2022
Registrar: NameCheap

Domain: Night-Web.biz
Expiry Date: Feb 11, 2022
Registrar: NameCheap

I am getting Exception error: Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 100001

Please check my code.
i am giving codechef longChallenge and i facing problem here , whenever run the code it show “RunTimeError” ->

Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 100001
at Codechef.main(Main.java:71)

class preDefine 
{
    public static final int mod = 1000000007;
}


class Codechef
{
    
    static int pow(int baseVal , int basePow) 
    {
  //power calculation !
    }
    
    static int palindrome(int num)
    {
        // palindrome num finding
    }
    
    
    public static void main (String() args) throws java.lang.Exception
    {
        Scanner sc = new Scanner(System.in);
        int test = sc.nextInt();
        
        int() arr = new int(100001);
        Arrays.fill(arr, 0);
        int() preFixArr = new int(100001);
        Arrays.fill(preFixArr, 0);
        
        for(int i = 1; i <= 100001; i++)
        {
            arr(i) = palindrome(i); **here is error**
            preFixArr(i) = preFixArr(i-1) + arr(i);
        }
        
        while(test-->0) 
        {
            
            
           int L = sc.nextInt();
           int R = sc.nextInt();
            
            int sumOfPreFixArr = preFixArr(R) - preFixArr(L);
            
            System.out.println(pow(arr(L), sumOfPreFixArr));
            
            
        }
        
    }
}

plase review my code !!

page speed – Reduce the impact of third-party code Third-party code blocked the main thread for 3,390 ms: Google/Doubleclick Ads

Using Google PageSpeed Insights, I see a recommendation:

Reduce the impact of third-party code. Third-party code blocked the main thread for 3,390 ms: Google/Doubleclick Ads

How would I go about reducing the impact of Google/Doubleclick Ads?

Could I save the script locally?

Help appreciated.