Information Technology

Report: Trump officials plan to curb Chinese access to US technology

Ars Technica - 2 hours 14 min ago

Enlarge / Donald Trump and Chinese president Xi Jinping in Beijing in November.

The Trump administration is looking to widen its trade war with China by restricting Chinese access to US technology, according to reports from the Wall Street Journal and Reuters.

"The Treasury Department is crafting rules that would block firms with at least 25 percent Chinese ownership from buying companies involved in what the White House calls 'industrially significant technology,'" the Wall Street Journal says. A separate proposal would institute beefed-up export controls preventing Chinese companies from buying these technologies from US firms.

The policies could be announced as soon as this week, the Journal says.

Read 6 remaining paragraphs | Comments

Nano Enterprise 10.4 - Manage a small business enterprise.

MacUpdate - Mac OS X - 2 hours 16 min ago

Nano Enterprise is a full-featured, intuitive management app designed exclusively for small businesses. It saves time and makes it easy to manage your business's purchase orders, sales, suppliers, warehouses, and inventory. Nano Enterprise does not require any special training or even an internet connection, so it works for everyone, everywhere!

  • See an instant snapshot of cash, inventory, and orders
  • Maintain up-to-date bank account transaction info
  • Keep track of sales, suppliers, manufacturing, and warehouses
  • Create accurate records of clients, products, vendors, and people
  • Create and filter reports for your company finances
  • View sales reports, bestsellers, margins, and more
  • Get inventory reports for product on-hand, turnover, and movement
  • Import and export data to and from your favorite spreadsheet
  • Works with a local database -- even with no internet!
  • Back up your data

Nano Enterprise includes a set of sample data to get you started. Once you are familiar with the app, clear the database and import your own info!

Version 10.4:
  • Improved search in the list of projects
  • The "Brand" column has been added to the sales and purchases specifications

  • OS X 10.10 or later

Download Now]]>

Dapper 3.37 - Transfer data from iTunes to your digital audio player.

MacUpdate - Mac OS X - 2 hours 18 min ago

Dapper makes transferring your playlists, music, and album art from iTunes to your digital audio player easy! It supports players with single or dual storage that can be seen by OS X as disk drives (FiiO, iBasso, HiFiMan, etc.).

Use a simple slider to select which artists' music will be copied to which storage device, and see in real-time what amount of storage will be used as a result.

Dapper supports a host of options:

  • Multithreaded to copy to two drives simultaneously.
  • Auto sync on DAP connection.
  • Clean up OS X files on DAP storage.
  • Reformat capitalization of filenames.
  • Warn when more than n MB of data will be changed.

Version 3.44 (3.37):

Note: The downloadable demo is version 3.37; the version available for purchase on the Mac App Store is version 3.44.

  • Bug fixes for crashes with no matching music in a playlist. Fixes for disconnecting FiiO players

  • OS X 10.8 or later

Download Now]]>

WPF XAML add button click listener on ListViewItem and show new page inside current page

Learn Programming - 2 hours 18 min ago

Hi, I am just started with WPF developement so I have this question. How can I "switch" pages on clicking ListItemViews? So I just want to show AddUser, ShowUser etc Pages in gray area when I click on corresponding ListItemViews. I have 2 days of experience with C# and WPF so sorry if this is silly question.

Here is my code and screenshoot screenshot

<Controls:MetroWindow x:Class="CManager.Navigation" xmlns="" xmlns:x="" xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:d="" xmlns:mc="" xmlns:local="clr-namespace:CManager" xmlns:materialDesign="" mc:Ignorable="d" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Title="CManager" Height="600" Width="1080" Foreground="White"> <Window.Resources> <Storyboard x:Key="MenuClose"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu"> <EasingDoubleKeyFrame KeyTime="0" Value="200"/> <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="60"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <Storyboard x:Key="MenuOpen"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu"> <EasingDoubleKeyFrame KeyTime="0" Value="60"/> <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="200"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonOpenMenu" > <BeginStoryboard Storyboard="{StaticResource MenuOpen}"/> </EventTrigger> <EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonCloseMenu" > <BeginStoryboard Storyboard="{StaticResource MenuClose}"/> </EventTrigger> </Window.Triggers> <Grid Background="LightGray"> <Grid Height="60" VerticalAlignment="Top" Background="#FF1198D6"> <TextBlock Text="CManager" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="32"></TextBlock> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Right"> <TextBlock Text="Settings" VerticalAlignment="Center" FontSize="12"></TextBlock> <materialDesign:PopupBox Margin="10" PlacementMode="BottomAndAlignRightEdges" StaysOpen="False"> <StackPanel Width="150"> <Button Content="Settings"/> <Button Content="Account"/> <Button Content="Help"/> <Separator/> <Button x:Name="ButtonPopUpLogout" Content="Logout" Click="ButtonPopUpLogout_Click"/> </StackPanel> </materialDesign:PopupBox> </StackPanel> </Grid> <Grid x:Name="GridMenu" Width="200" HorizontalAlignment="Left" Background="#FF1578BD"> <StackPanel> <Grid Height="60" Background="White"> <Button x:Name="ButtonCloseMenu" Width="60" Height="60" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Top" HorizontalAlignment="Right" Visibility="Collapsed" Click="ButtonCloseMenu_Click"> <materialDesign:PackIcon Foreground="#FF1578BD" Kind="ArrowLeft" Width="25" Height="25" /> </Button> <Button x:Name="ButtonOpenMenu" Width="60" Height="60" Background="{x:Null}" BorderBrush="{x:Null}" VerticalAlignment="Top" HorizontalAlignment="Right" Click="ButtonOpenMenu_Click"> <materialDesign:PackIcon Foreground="#FF1578BD" Kind="Menu" Width="25" Height="25"/> </Button> </Grid> <ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="White"> <ListViewItem Height="60"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="ViewDashboard" Height="25" Width="25" Margin="10" VerticalAlignment="Center"/> <TextBlock Text="Home" VerticalAlignment="Center" Margin="20 10"/> </StackPanel> </ListViewItem> <ListViewItem Height="60"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="AccountMultiple" Height="25" Width="25" Margin="10" VerticalAlignment="Center"/> <TextBlock Text="Show users" VerticalAlignment="Center" Margin="20 10"/> </StackPanel> </ListViewItem> <ListViewItem Height="60"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="AccountPlus" Height="25" Width="25" Margin="10" VerticalAlignment="Center"/> <TextBlock Text="Add users" VerticalAlignment="Center" Margin="20 10"/> </StackPanel> </ListViewItem> </ListView> </StackPanel> </Grid> </Grid> </Controls:MetroWindow> submitted by /u/S7ryd3r
[link] [comments]

New Google Classroom features make it harder to cheat

Engadget - 2 hours 21 min ago
Today, Google announced new features aimed at educators using Google Classroom. These include the ability to assign quizzes through Google Forms and "lock" them, so that students cannot navigate away from the page while the quiz is underway (potentia...

450$ laptop for Android studio and light gaming

Total budget and country of purchase: India $400-450(about 30k)

  • Do you prefer a 2 in 1 form factor, good battery life or best specifications for the money? Pick or include any that apply. Best specs for money

  • How important is weight and thinness to you? Not Very important

  • Which OS do you require? Windows, Mac, Chrome OS, Linux. Anything, I'll probably change if it has linux or dos

  • Do you have a preferred screen size? If indifferent, put N/A. N/A

  • **Are you doing any CAD/video editing/photo editing/gaming? List which programs/games you desire to run. Gaming Pes 18,fifa 18 and gta v(lowest possible) and android studio

  • If you're gaming, do you have certain games you want to play? At what settings and FPS do you want? Playable fps 30+

  • Any specific requirements such as good keyboard, reliable build quality, touch-screen, finger-print reader, optical drive or good input devices (keyboard/touchpad)? N/A

  • Leave any finishing thoughts here that you may feel are necessary and beneficial to the discussion. This laptop is primarily for Android programming and little gaming.

submitted by /u/ryverzz
[link] [comments]

Help Selecting New Laptop within Requirements

Hello and thank you in advance. I am looking for a new laptop for my wife. She is post-doc researcher and her old laptop is starting to fail. Currently she uses a 2013 Toshiba Satellite that fits all her needs but again is starting to look a little worse for the wear. I would like something new to fit these specifications:

Total budget and country of purchase:

<$600 / U.S.A

Do you prefer a 2 in 1 form factor, good battery life or best specifications for the money? Pick or include any that apply.

Best specifications for the money

How important is weight and thinness to you?


Which OS do you require? Windows, Mac, Chrome OS, Linux.


Do you have a preferred screen size? If indifferent, put N/A.

13" to 16"

Are you doing any CAD/video editing/photo editing/gaming? List which programs/games you desire to run.

Office Suite, some R code / Statistical analysis, Netflix

If you're gaming, do you have certain games you want to play? At what settings and FPS do you want?

If there gaming, its emulators and indie titles, nonissue

Any specific requirements such as good keyboard, reliable build quality, touch-screen, finger-print reader, optical drive or good input devices (keyboard/touchpad)?

SSD, Good (4+ hours) battery life, comfortable size to carry around, preferably 8GB of dual channel memory

Leave any finishing thoughts here that you may feel are necessary and beneficial to the discussion.

Storage can be less than 250 but would like to target a 250 SSD

submitted by /u/numinoidian
[link] [comments]

AT&T buying company that delivers targeted ads based on your Web browsing

Ars Technica - 2 hours 29 min ago

Enlarge / The AT&T logo is displayed at a retail store in Washington, DC, on Monday, March 21, 2011. (credit: Getty Images | Bloomberg)

AT&T is buying an advertising company that delivers personalized ads based on Internet users' Web browsing habits.

AT&T today announced "a definitive agreement to acquire AppNexus," saying that "AT&T is investing to accelerate the growth of its advertising platform and strengthen its leadership in advanced TV advertising."

AT&T's just-completed purchase of Time Warner Inc. will help it gather more information about people's video watching habits, both online  and on cable and satellite TV services. AT&T could combine this data with AppNexus in order to deliver more personalized ads based on its customers' TV watching and Web browsing histories.

Read 12 remaining paragraphs | Comments

[US] [14"] [<$200] Laptop/Chromebook for grandparents

  • Total budget and country of purchase: <$200, US

  • Do you prefer a 2 in 1 form factor, good battery life or best specifications for the money? Pick or include any that apply. Value/$ most important, then battery life a close second, 2 in 1 is irrelevant/not desired

  • How important is weight and thinness to you? Needs to be portable enough for an older person to carry it around.

  • Which OS do you require? Windows, Mac, Chrome OS, Linux. Any is fine.

  • Do you have a preferred screen size? If indifferent, put N/A. 14" is required.

  • Are you doing any CAD/video editing/photo editing/gaming? List which programs/games you desire to run. No CPU/GPU intensive programs will be run.

  • If you're gaming, do you have certain games you want to play? At what settings and FPS do you want? No gaming.

  • Any specific requirements such as good keyboard, reliable build quality, touch-screen, finger-print reader, optical drive or good input devices (keyboard/touchpad)? I would splurge on a nice display. A quality touchpad would be nice if possible but is not mandatory. An internal microphone and webcam are essential (but nearly everything has one these days).

  • Leave any finishing thoughts here that you may feel are necessary and beneficial to the discussion. I'm looking for an inexpensive but solid laptop or Chromebook that will be used exclusively for YouTube, webmail, and web browsing by my grandparents.

I was looking at this

submitted by /u/live_and_do_good
[link] [comments]

Using Auto Tools and Chrome Custom Tabs

I have a chrome custom tab that opens up with a quick settings action. In the chrome custom tab, I want a custom item under the menu items that opens up a Google docs file. How would I do this?

submitted by /u/Alanator222
[link] [comments]

A Real Time Data Compression Technique

Hack a Day - 2 hours 39 min ago

With more and more embedded systems being connected, sending state information from one machine to another has become more common. However, sending large packets of data around on the network can be bad both for bandwidth consumption and for power usage. Sure, if you are talking between two PCs connected with a gigabit LAN and powered from the wall, just shoot that 100 Kbyte packet across the network 10 times a second. But if you want to be more efficient, you may find this trick useful.

As a thought experiment, I’m going to posit a system that has a database of state information that has 1,000 items in it. It looks like an array of RECORDs:

typedef struct { short topic; int data; } RECORD;

It doesn’t really matter what the topics and the data are. It doesn’t really matter if your state information looks like this at all, really. This is just an example. Given that it is state information, we are going to make an important assumption, though. Most of the data doesn’t change frequently. What most and frequently mean could be debated, of course. But the idea is that if I’m sending data every half second or whatever, that a large amount isn’t going to change between one send and the next.


The most obvious answer is to use some type of compression. If you have the time to run a compressor on the data and then decompress it all inside your window, then that’s probably the answer — or at least part of it. The problem, of course, is that these programs take time to run. Another problem is that sometimes data doesn’t compress well and if you add the overhead of the compression, you might not get any reduction in data or it can even cause you to send more data.

I’m going to propose a very simple run-length encoding scheme for our system. It will treat the entire state array as a sequence of bytes. It will then send a bunch of packets that consist of a count and a payload. If the count is positive, then that’s how many bytes are in the payload and they are just copied to the output. If the count is negative, then the magnitude is one less than a count of the payload byte (that is, -1 is a repeat count of 2). I arbitrarily limit the repeat size to 256. A count of 0 marks an end of the state information.

As compression schemes go, this is pretty poor. My state array has 8,000 bytes in it (1,000 entries). If I use the compression algorithm on a random state array, it fails badly, taking about 10-12% more bytes to send than just sending the whole thing over.

The Fix

By now you are laughing and thinking what good is a compression algorithm that fails by 10% most of the time? But what if there was one simple thing you could do to fix it? In particular, the reason the algorithm fails is that not enough data repeats to make this compression worthwhile. Even if you use a “real” compression algorithm, they will almost always perform better if the data to compress has more repeating sequences. This is one reason why file formats that are already compressed don’t compress well — any repeating sequences were already removed.

So how do we get more repeating data? After all, the state is what it is, right? You can’t arrange for temperature and humidity and position data to all line up in repeating sequences, right? If you think of the array as fixed in time, that’s probably true. But if you start thinking about it in time, maybe not.

Remember how I said I’m assuming the state array doesn’t change much between transmissions? That’s the key. Here are the steps:

  1. Send the first state array compressed. It will probably be larger than the rest.
  2. Before sending the second state array, XOR with the previous one. Since not much changed, this will change most of the state array to zeros. Repeating zeros.
  3. Compress and send the second state array.
  4. Repeat for the third, fourth, and all subsequent arrays.

If you are used to using programs like rsync, this is the same idea. Don’t send everything, just the parts that changed. On the receive side, you simply reverse the XOR operation using the current state array. Even if you use another compression algorithm, changing your data to be mostly zeros is going to help the compressor.

There are a few caveats, though. First, unless your connection is perfect, you need a way to tell the sender you didn’t get the last state update, so it needs to send a full array again. You could also add some overhead to mark when you send a full frame (and maybe send that uncompressed). You could also make the sender periodically send a full array to aid in synchronization.

A Simulation

To test this idea, I wrote a simple simulation you can find on GitHub. Since the sender and the receiver are really the same program, I didn’t simulate doing an ack/nack type handshake nor did I make provisions for resynchronizing. You’d want to add that in real life.

I wrote the simulation to use a test driver which — in a fit of originality — I named test. However, there are two test drivers, and you can select one by setting TEST_MANUAL to 0 or 1. When set to 0, the code uses two different sets of state data that you can set in the setstate0 and setstate1 functions. This is great for trying out a specific case for debugging. To keep things simple, I only populated the first four elements, plus the 800th element and the last element of the state array. This lets me keep debugging output short while still being able to tell that things work. The first four are just handy. The one at 800 shows that expanding data doesn’t get out of sync and the last one is good for catching corner cases where you overflow the buffer.

However, I also wanted to test on a broad set of conditions, so I wrote the other test driver. It randomly makes changes to the state array over 100 iterations (no more than 20 changes per iteration).  You can supply a seed on the command line to get the same run of random values for testing.

In addition to a seed, you can prefix the seed with a caret (^) to suppress the XOR processing. If you don’t want to do the XOR, you won’t have a lot of runs in the data and your percentage will be very high — possibly more than 100%, indicating you sent more data than just sending the bytes in the regular fashion. For example, here’s a run that took almost 11% more bytes to send than normal without using the XOR.

alw@enterprise:~/tmp/state$ ./state ^143 TX/RX=8000000/8863392 (110.79) Done

With the XOR in place, the same run was at 2% meaning it was 98% smaller than the original data.

You can read the code to see how the above ideas are implemented. There are a few key data structures and functions you should know:

  • state – The current state to transmit
  • target – The current receiver state
  • tx_prev – The previous state used by the transmitter
  • rx_prev – The previous state used by the receiver (see below)
  • receive – The simulated receiver
  • xmit – The simulated physical transmitter (that is, all code that wants to transmit to the receiver calls this function)
  • transmit – Send current state to the receiver

I debated about using the rx_prev buffer. This holds the previous state so you can XOR with the current data upon reception. However, you could XOR the data in place and save the buffer. The only problem is then you couldn’t use efficient calls like memcpy. Granted, even after memcpy you have to go do the XOR if you are doing the XOR at all. So it is probably as broad as it is long. If you were implementing this in a real system, it would be something to think about.

Both test drivers use memcmp to validate that the receivers buffer is the same as the transmitter’s. The random test driver also computes the percentage of data sent which is the bytes received divided by the total bytes sent times 100.


As I mentioned, I don’t account for resynchronizing in the simulation. I also don’t do any integrity checking like a checksum or CRC. Those could be related in real code. It is easy to imagine a receiver computing a CRC, comparing it, and sending an acknowledge or a negative acknowledge. It would also be easy to imagine the transmitter sending some sort of sync header and flag to show that the contents are XOR’d or not. You could even use that mark to indicate the sent data is not compressed at all, which would allow you to send the initial reference state with no compression. That should make the algorithm even more efficient in most cases.


The randomize function changes a random number of items on each pass, up to 20 at once. For 1,000 records that is a 2% change. Unsurprisingly, then, the amount of data sent compared to the data received is about 2% as you can see in the above graph. The correlation isn’t perfect, because the data is random, but in general, the algorithm will do well until so much of the state array changes each time that the overhead kills any benefit.

Still, many projects won’t have state that changes very often and this is a great way to send only changes. This works for any sort of data structure. However, as I proposed it, you could look at which topics have changed and work out a way to send only the changed topics. Note, however, that in my example, the topics are just more data and they change too so that would be harder in that particular case. My point is that there are many ways you could approach this problem.

Sometimes it seems like there is nothing XOR can’t do. There’s lots of compression tricks out there including squozing if your data can survive it.

B&H is slashing $200 off the 13-inch MacBook Pro and MacBook Air

MacCentral - 2 hours 40 min ago

B&H Photo has been offering some of the best deals on MacBooks lately, and today it continues that trend by offering the 13-inch MacBook Air and 13-inch MacBook Pro for $200 less than their usual asking prices. I’m especially impressed with this sale because it includes the Air, which doesn’t seem to see as many discounts from major retailers.

And you should be impressed, too. Such a steep discount means you can pick up the 13-inch MacBook Air with a 1.8GHz processor, 8GB of RAM, and 128GB of storage for just $799, down from $999. If you’d like to bump that up to 256GB of storage, you can pick one up for $999, down from the usual price of $1,119.

To read this article in full, please click here

Oculus TV arrives today with a promising, though questionable, start

Engadget - 2 hours 40 min ago
Over a month ago at F8, Facebook announced Oculus TV, a new way to watch TV on a VR headset. Today, it's finally live, and there are plenty of entertainment partners on board already. You can use it to access existing video VR apps like Netflix, Hulu...

LF lightweight, large screen, everyday laptop under $500 (new or refurb, Chromebook or Windows)

Budget: $300-500

For: Everyday basics - write, internet, run some apps (spotify, netflix, messenger, chrome) at the same time. Nothing fancy, no gaming, etc.

Currently using a Acer Chromebook 15 CB5-571-C09S, I like it but the Intel Celeron Dual-Core 3205U 1.5 GHz processor can't even handle browsing, Spotify, and FB notifications at the same time without getting skippy. Plus the screen's a bit dull.

Most Important:

  1. 15.6 inch screen or close (you can suggest 14s, I need to try one out to see if I'd be comfortable with it)
  2. Lightweight (4 pounds or under, will consider 5, but 3 would be amazing)
  3. Decent screen brightness, can work in sun (I live in CA) (but maybe I could put an anti reflect protector on a glossy screen?)


  1. Recent release
  2. 2 in 1 (touchscreen, flippable screen)
  3. Good speakers (love my Acer CB 15 speakers)
  4. Student discount :)

Other Factors:

  1. Windows versus Chromebook (I'm willing to look at both, I like chromebooks, Rosetta Stone is really the only big loss for me)
  2. New versus Refurbished (Would prefer new but I know my budget is low, is it safe to buy a refurb? Any suggestions?
  3. Processor (Intel Celeron Dual-Core 3205U aint quite enough, would a small step up i.e. 4200 be enough? Not gaming, don't need a powerhouse)

Not important:

  1. Keyboard backlight - dont care, dont need
  2. Doesn’t need to be super powerful, just run a few applications at the same time without hiccuping
  3. Don’t need a ton of storage
  4. Don’t need Lightning, fancy stuff

Already considering:

  1. Acer Chromebook 15 with the Pentium N4200 processor
  2. Acer Chromebook 15 Spin (are there other improvements to the 2017 15? Screen brightness, etc?)
submitted by /u/icecreamcones99
[link] [comments]

What are ways to have fast date range query in postgresql?

Learn Programming - 2 hours 43 min ago

Say that I have the following db schema

my_primary_id (text) primary index my_date (timestamp with timezone)

is there a way to index my_date such that I can have fast date range query?

Should I put my_date into secondary index? That is a bad idea right? Since timestamp with timezone is too precise so the index table will grow super large.

Should I store a date string instead? Like 2018-06-13 and make that a secondary index?

Does string comparison work such that the following is always truelatest date > earliest date?

My query looks like the following

select * from my_table where my_date >= my_start_date and my_date < my_end_date submitted by /u/dmanog
[link] [comments]

What are some great sequels to The Elements of Computing Systems?

Many here probably know Nisan and Schocken's terrific book The Elements of Computing Systems. It guides you through the construction of a computer starting all the way at NAND-gates and ending at a compiler for a higher-level language and some operating system calls.

My question is: Are there any books or other resources that continue on from there? Operating systems are only scratched at in the book and there's many other things one could build toy versions of. There's networking, graphics, cryptography, databases, JIT's, etc...

What I'm particularly keen on is that, just as in The Elements of Computing Systems, there should be clearly specified tasks and test cases, not just a sequence of blog posts titled "I'm building a Gameboy emulator, watch me do it".

submitted by /u/SOberhoff
[link] [comments]