text
stringlengths
20
1.01M
url
stringlengths
14
1.25k
dump
stringlengths
9
15
lang
stringclasses
4 values
source
stringclasses
4 values
26 October 2009 22:58 [Source: ICIS news] HOUSTON (ICIS news)--US Olin’s third-quarter chlor-alkali business profits before taxes fell 96% to $3.9m (€2.6m) from $104.3m during the same quarter last year on falling sales, but the company said it had expected the situation to be worse. The segment’s earnings before taxes for the quarter ended 30 September “exceeded our expectations of a loss in the quarter” due to better-than-expected pricing and volumes, said president and chief executive Joseph Rupp. Even so, chlor-alkali sales dropped by 37% to $228.8m in the third quarter compared with $362.1m in the same quarter last year, the company said. Chlorine and caustic soda shipment volumes declined 20% year-over-year. Olin, which also runs the ?xml:namespace> Looking forward, the company said it expected fourth-quarter chlor-alkali earnings to be similar to the third
http://www.icis.com/Articles/2009/10/26/9258198/us-olin-chlor-alkali-q3-profits-plunge-on-sales.html
CC-MAIN-2014-10
en
refinedweb
Opened 3 years ago Closed 3 years ago #4460 closed bug (fixed) Input is not echoed when GHCi is suspended and subsequently brought to foreground. Description How to reproduce: - Start ghci. - Press Ctrl-Z to suspend it. - Type fg to bring ghci back to foreground. - Hit RET to get the prompt. - Type anything. The input is not echoed until you hit RET. Also, if I press Ctrl-D to end the GHCi session (after it was suspended and brought back to foreground), I get <stdin>: hWaitForInput: end of file I am using ghc6 package from Debian Squeeze: $ apt-cache show ghc6 Package: ghc6 Priority: optional Section: haskell Installed-Size: 378408 Maintainer: Kari Pahula <kaol@debian.org> Architecture: amd64 Version: 6.12.1-13 Replaces: ghc6-doc (= 6.12.1-8), haddock Provides: ghc, haddock, haskell-compiler, libghc6-array-dev, libghc6-array-dev-0.3.0.0-ed0c6, libghc6-base-dev, libghc6-base-dev-3.0.3.2-0092f, libghc6-base-dev-4.2.0.0-2cc27, libghc6-bin-package-db-dev, libghc6-bin-package-db-dev-0.0.0.0-4cfd2, libghc6-bytestring-dev, libghc6-bytestring-dev-0.9.1.5-125af, libghc6-cabal-dev, libghc6-cabal-dev-1.8.0.2-a7cb9, libghc6-containers-dev, libghc6-containers-dev-0.3.0.0-4a332, libghc6-directory-dev, libghc6-directory-dev-1.0.1.0-d465e, libghc6-dph-base-dev, libghc6-dph-base-dev-0.4.0-385a3, libghc6-dph-par-dev, libghc6-dph-par-dev-0.4.0-b4f33, libghc6-dph-prim-interface-dev, libghc6-dph-prim-interface-dev-0.4.0-9c8ab, libghc6-dph-prim-par-dev, libghc6-dph-prim-par-dev-0.4.0-4eccc, libghc6-dph-prim-seq-dev, libghc6-dph-prim-seq-dev-0.4.0-a2769, libghc6-dph-seq-dev, libghc6-dph-seq-dev-0.4.0-52cfd, libghc6-extensible-exceptions-dev, libghc6-extensible-exceptions-dev-0.1.1.1-95db3, libghc6-filepath-dev, libghc6-filepath-dev-1.1.0.3-3f3be, libghc6-ghc-binary-dev, libghc6-ghc-binary-dev-0.5.0.2-bb54d, libghc6-ghc-dev-6.12.1-3a757, libghc6-ghc-prim-dev, libghc6-ghc-prim-dev-0.2.0.0-9d35c, libghc6-haskell98-dev, libghc6-haskell98-dev-1.0.1.1-0fdaf, libghc6-hpc-dev, libghc6-hpc-dev-0.5.0.4-7df34, libghc6-integer-gmp-dev, libghc6-integer-gmp-dev-0.2.0.0-9a51f, libghc6-old-locale-dev, libghc6-old-locale-dev-1.0.0.2-ef43d, libghc6-old-time-dev, libghc6-old-time-dev-1.0.0.3-9efce, libghc6-pretty-dev, libghc6-pretty-dev-1.0.1.1-34534, libghc6-process-dev, libghc6-process-dev-1.0.1.2-d10eb, libghc6-random-dev, libghc6-random-dev-1.0.0.2-cf650, libghc6-rts-dev, libghc6-syb-dev, libghc6-syb-dev-0.1.0.2-3787e, libghc6-template-haskell-dev, libghc6-template-haskell-dev-2.4.0.0-bbc7c, libghc6-time-dev, libghc6-time-dev-1.1.4-1ced4, libghc6-unix-dev, libghc6-unix-dev-2.4.0.0-16adb, libghc6-utf8-string-dev, libghc6-utf8-string-dev-0.3.4-75a94 Depends: perl | perl5, gcc (>= 4:4.2), libgmp3-dev, libffi-dev, libbsd-dev, libc6-dev, libc6 (>= 2.3.4), libffi5 (>= 3.0.4), libgmp3c2, libncurses5 (>= 5.7+20100313) Suggests: ghc6-prof, ghc6-doc, haskell-doc Conflicts: ghc4 (<= 4.08.1-4), haddock Breaks: cabal-install (<< 0.8.0), ghc6-doc (<= 6.12.1-8), haskell-devscripts (<< 0.6.19) Filename: pool/main/g/ghc6/ghc6_6.12.1-13_amd64.deb Size: 68875186 MD5sum: 84e247fb7f40f06a2fcd724d735c75e8 SHA1: 25e8d8f9ad9c8a484bd6a86494397ca44431208e SHA256: 27096990dc41dfae6965ef16fa2bf12a3c2c3b7a8c9c77ead4f9b45cd422e9fe Description:. Homepage: Tag: devel::{compiler,interpreter,lang:haskell}, implemented-in::c, implemented-in::haskell, interface::commandline, interface::text-mode, role::program, scope::utility, uitoolkit::ncurses, works-with::software:source Attachments (1) Change History (8) comment:1 Changed 3 years ago by judahj Changed 3 years ago by igloo comment:2 Changed 3 years ago by igloo The attached Main.hs has the same problem. comment:3 Changed 3 years ago by igloo - Milestone set to 7.0.2 comment:4 Changed 3 years ago by igloo The hSetBuffering stdin NoBuffering in particular is the problem. After suspending and resuming the program, icanon has been turned back on. We presumably need to set it to what we think it should be when we get a SIGCONT. module Main (main) where import Control.Monad.Trans import System.Console.Haskeline import System.Cmd import System.IO main :: IO () main = do gb 1 hSetBuffering stdin NoBuffering gb 2 runInputT defaultSettings runCommands putStrLn "Leaving." runCommands :: InputT IO () runCommands = do liftIO $ gb 3 m <- getInputLine "Prompt: " case m of Nothing -> return () Just x -> do liftIO $ print x runCommands gb :: Int -> IO () gb n = do putStrLn "----------------------------" b <- hGetBuffering stdin putStrLn ("b " ++ show n ++ " " ++ show b) rawSystem "stty" ["-a"] return () comment:5 Changed 3 years ago by simonmar - Owner set to simonmar I'm on this. comment:6 Changed 3 years ago by simonmar - Status changed from new to merge Fixed: Fri Jan 7 12:40:42 GMT 2011 Simon Marlow <marlowsd@gmail.com> * catch SIGTSTP and save/restore terminal settings (#4460) As far as I can tell, it is the responsibility of the program to save and restore its own terminal settings across a suspend/foreground, the shell doesn't do it (which seems odd). So I've added a signal handler for SIGTSTP to the RTS which will save and restore the terminal settings iff we modified them with hSetBuffering or hSetEcho (we already restore them at exit time in these cases). comment:7 Changed 3 years ago by igloo - Resolution set to fixed - Status changed from merge to closed Merged. Note: See TracTickets for help on using tickets. Interestingly, Haskeline (ghci's line-reading backend) by itself does not have this problem. For example, the above steps work fine for the test program at: So this issue may be caused by something specific to ghci.
https://ghc.haskell.org/trac/ghc/ticket/4460
CC-MAIN-2014-10
en
refinedweb
Provides the interface to a generic data pool. More... #include <GenSQP_DataPool.hpp> Provides the interface to a generic data pool.. Interface function that evaluates and stores problem-specific quantities that can be reused within one (or more) SQP iteration. Teuchos::RefCountPtr<const umDVec> ex = (Teuchos::dyn_cast<GenSQP::SledgeVector>(const_cast<GenSQP::Vector&>(x))).getVector(); Implemented in GLpApp::GLpYUEpetraDataPool.
http://trilinos.sandia.gov/packages/docs/r10.4/packages/epetraext/doc/html/classGenSQP_1_1DataPool.html
CC-MAIN-2014-10
en
refinedweb
Jane Medium : By designing a simple test circuit , Verified MicroPython stay MM32F3273 Running on . It is preliminarily confirmed that it can run the transplanted MicroPython. key word: MM32F3273,MicroPython,STM32,Bootloader,ISP stay In the morning Design with SD Card MM32F3277 MicroPython Experiment board , Now prepare to test based on MM32F3273(LQFP-48) Run on a pin encapsulated circuit MicroPython System . this 5 slice MM32F32773273 The application was sent with the help of smart Su Yong . ▲ chart 1.1.1 Schematic diagram of test version The following is to realize the design of rapid plate making PCB chart . ▲ chart 1.1.2 A single chip used for rapid plate making PCB The design ▲ chart 1.1.3 After one minute plate making , Then weld for testing Use MM32-LINK, The future comes from smart MicroPython Download to MM32F3272 in . Because it comes from MindMotion Of MicroPython Need to use an external high-frequency crystal oscillator , Therefore, the crystal oscillator signal should be measured after power on . ▲ chart 1.2.1 Crystal oscillator 8MHz Clock signal stay UART1 Of TX It should be possible to measure REPL Prompt signal given after power on . The following can be seen through the oscilloscope after power on UART1-TX Transmitted waveform . Prove it MicroPython Yes MM32F3272 It's up and running . ▲ chart 1.2.2 Measure after power on UART1-TX Transmitted waveform MM32 Also has the UART-ISP function , So whether it can use STM32 Of UART-ISP Corresponding BootLoader Download the program ? So let's test that out . ** USBBT Link error 1. ** USBBT erase pages error ! 1 And that proves that ,MM32 Of UART-ISP And STM32 Of UART-ISP Not compatible . system Make a transfer interface , Test in MM32F3272G6P Running on MicroPython. from machine import Pin,UART import utime led = Pin('PB2', mode=Pin.OUT_PUSHPULL) btn = Pin('PB8', mode=Pin.IN_PULLUP) print("Test Pin In/Out.") while True: utime.sleep_ms(100) led.low() utime.sleep_ms(100) led.high() ▲ chart 2.1 Running results through Designed a simple test circuit , Verified MicroPython stay MM32F3273 Running on . It is preliminarily confirmed that it can run the transplanted MicroPython. stay be based on MM32F3273 Of MicroPython Experimental circuit board - Work is not normal , The specific reason is not clear . ■ Links to related literature : ● Related chart Links :
https://pythonmana.com/2021/11/20211125110148574H.html
CC-MAIN-2022-21
en
refinedweb
Normalize time series data intervals¶ If you followed one of the tutorials in the previous section, you should have some mock time series data about the position, or ground point, of the International Space Station (ISS). It is common to visualize time series data by graphing values over time. However, you may run into the following issues: The resolution of your data does not match the resolution you want for your visualization. For example, you want to plot a single value per minute, but your data is spaced in 10-second intervals. You will need to resample the data. Your data is non-continuous, but you want to visualize a continuous time series. For example, you want to plot every minute for the past 24 hours, but you are missing data for some intervals. You will need to fill in the missing values. This tutorial demonstrates the shortcomings of visualizing the non-normalized data and shows you how to address these shortcomings by normalizing your data using SQL. Note This tutorial focuses on the use of SQL. Code examples demonstrate the use of the CrateDB Python client. However, the following guidelines will work with any language that allows for the execution of SQL. Table of contents Prerequisites¶ Mock data¶ You must have CrateDB installed and running. This tutorial works with ISS location data. Before continuing, you should have generated some ISS data by following one of the tutorials in the previous section. Python setup¶ You should be using the latest stable version of Python. You must have the following Python libraries installed: pandas – querying and data manipulation SQLAlchemy – a powerful database abstraction layer The CrateDB Python Client – SQLAlchemy support for CrateDB Matplotlib – data visualization geojson – Functions for encoding and decoding GeoJSON formatted data You can install (or upgrade) the necessary libraries with Pip: sh$ pip3 install --upgrade pandas sqlalchemy crate matplotlib geojson Using Jupyter Notebook¶ This tutorial shows you how to use Jupyter Notebook so that you can display data visually and experiment with the commands as you see fit. Jupyter Notebook allows you to create and share documents containing live code, equations, visualizations, and narrative text. You can install Jupyter with Pip: sh$ pip3 install --upgrade notebook Once installed, you can start a new Jupyter Notebook session, like this: sh$ jupyter notebook This command should open a new browser window. In this window, select New (in the top right-hand corner), then Notebook → Python 3. Type your Python code at the input prompt. Then, select Run (Shift-Enter ⇧⏎) to evaluate the code: You can re-evaluate input blocks as many times as you like. See also Alternative shells¶ Jupyter mimics Python’s interactive mode. If you’re more comfortable in a text-based environment, you can use the standard Python interpreter. However, we recommend IPython (the kernel used by Jupyter) for a more user-friendly experience. You can install IPython with Pip: sh$ pip3 install --upgrade ipython Once installed, you can start an interactive IPython session like this: sh$ ipython Python 3.9.10 (main, Jan 15 2022, 11:48:04) Type 'copyright', 'credits' or 'license' for more information IPython 8.0.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: Steps¶ To follow along with this tutorial, copy and paste the example Python code into Jupyter Notebook and evaluate the input one block at a time. Query the raw data¶ This tutorial uses pandas to query CrateDB and manipulate the results. To get started, import the pandas library: import pandas Pandas uses SQLAlchemy and the CrateDB Python Client to provide support for crate:// style connection strings. Then, query the raw data: pandas.read_sql('SELECT * FROM doc.iss', 'crate://localhost:4200') Note By default, CrateDB binds to port 4200 on localhost. Edit the connection string as needed. If you evaluate the read_sql() call above, the Jupyter notebook should eventually display a table like this: Here are a few ways to improve this result: The current query returns all data. At first, this is probably okay for visualization purposes. However, as you generate more data, you will probably find it more useful to limit the results to a specific time window. The timestampcolumn isn’t human-readable. It would be easier to understand the results if this value was as a human-readable time. The positioncolumn is a Geographic types. This data type isn’t easy to plot on a traditional graph. However, you can use the distance() function to calculate the distance between two geo_pointvalues. If you compare positionto a fixed place, you can plot distance over time for a graph showing you how far away the ISS is from some location of interest. Here’s an improvement that wraps the code in a function named raw_data() so that you can execute this query multiple times: import pandas def raw_data(): # From < berlin_position = [52.520008, 13.404954] # Returns distance in kilometers (division by 1000) sql = f''' SELECT iss.timestamp AS time, DISTANCE(iss.position, {berlin_position}) / 1000 AS distance FROM doc.iss WHERE iss.timestamp >= CURRENT_TIMESTAMP - INTERVAL '1' DAY ORDER BY time ASC ''' return pandas.read_sql(sql, 'crate://localhost:4200', parse_dates={'time': 'ms'}) Specifically: You can define the location of Berlin and interpolate that into the query to calculate the DISTANCE()of the ISS ground point in kilometers. You can use CURRENT_TIMESTAMP with an interval value expression ( INTERVAL '1' DAY) to calculate a timestamp that is 24 hours in the past. You can then use a WHERE clause to filter out records with a timestampolder than one day. An ORDER BY clause sorts the results by timestamp, oldest first. You can use the parse_datesargument to specify which columns read_sql()should parse as datetimes. Here, a dictionary with the value of msis used to specify that timeis a millisecond integer. Execute the raw_data() function: raw_data() Jupyter should display a table like this: Above, notice the query used by the raw_data() function produces: - Fewer rows than the previous query (limited by the 24 hour time window) - A human-readable time (instead of a timestamp) - The distance of the ISS ground point in kilometers (instead of a geo_pointobject) Plot the data¶ You can plot the data returned by the previous query using Matplotlib. Here’s an example function that plots the data: import matplotlib.pyplot as plt import matplotlib.dates as mdates def plot(data): fig, ax = plt.subplots(figsize=(12, 6)) ax.scatter(data['time'], data['distance']) ax.set( xlabel='Time', ylabel='Distance (km)', title='ISS Ground Point Distance (Past 24 Hours)') ax.xaxis_date() ax.xaxis.set_major_locator(mdates.HourLocator()) ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:00')) # Plot the whole date range (null time values are trimmed by default) ax.set_xlim(data.min()['time'], data.max()['time']) fig.autofmt_xdate() Above, the plot() function: - Generates a figurethat measures 12 × 6 (inches) - Plots dataas a scatterdiagram (distance over time) - Sets the axeslabels and title - Sets up the x-axis to handle datetimes - Configures major tick locationsevery hour - Configures major tick formattingwith a time string( %H:00) - Forces Matplotlib to plot the whole data set, including null timevalues, by manually setting the limits of the x-axis(which are trimmed by default) - Activates x-axis tick label auto-formatting(rotates them for improved readability) See also The full Matplotlib documentation You can test the plot() function by passing in the return value of raw_data(): plot(raw_data()) Jupyter should display a plot like this: Above, notice that: - This plot looks more like a line chartthan a scatter diagram. That’s because the raw data appears in intervals of 10 seconds. At this resolution, such a high sampling frequency produces so many data points that they appear to be a continuous line. - The x-axis does not cover a full 24 hours. Matplotlib is plotting the whole data set, as requested. However, the data generation script has only been running for a short period. The query used by raw_data()only filters out records older than 24 hours (using a WHEREclause). The query does not fill in data for any missing time intervals. As a result, the visualization may be inaccurate if there is any missing data (in the sense that it will not indicate the presence of missing data). Resample the data¶ When plotting a longer timeframe, a sampling frequency of 10 seconds can be too high, creating an unnecessary large number of data points. Therefore, here is a basic approach to resample data at a lower frequency: - Place values of the timecolumn into bins for a given interval (using DATE_BIN()). In this example, we are resampling the data per minute. This means that all rows with an identical timevalue on minute-level are placed into the same date bin. - Group rows per date bin (using GROUP BY). The position index 1is a reference to the first column of the SELECTclause so we don’t need to repeat the whole DATE_BINfunction call. - Calculate an aggregate value across the grouped rows. For example, if you have six rows with six distances, you can calculate the average distance (using avg(column)) and return a single value. Tip Date bin is short for date binning, or data binning in general. It is sometimes also referred to as time bucketing. Here’s a new function with a rewritten query that implements the three steps above and resamples the raw data by the minute: def data_by_minute(): # From < berlin_position = [52.520008, 13.404954] # Returns distance in kilometers (division by 1000) sql = f''' SELECT DATE_BIN('1 minute'::INTERVAL, iss.timestamp, 0) AS time, COUNT(*) AS records, AVG(DISTANCE(iss.position, {berlin_position}) / 1000.0) AS distance FROM doc.iss WHERE iss.timestamp >= CURRENT_TIMESTAMP - '1 day'::INTERVAL GROUP BY 1 ORDER BY 1 ASC ''' return pandas.read_sql(sql, 'crate://localhost:4200', parse_dates={'time': 'ms'}) Note The DATE_BIN function is available in CrateDB versions >= 4.7.0. In older versions, you can use DATE_TRUNC('minute', "timestamp") instead. The records column produced by this query will tell you how many source rows have been grouped by the query per result row. Check the output: data_by_minute() Tip Despite an ideal time series interval of 10 seconds, some result rows may be aggregating values over fewer than six records. Irregularities may occur when: - Data collection started or stopped during that period - There were delays in the data collection (e.g., caused by network latency, CPU latency, disk latency, and so on) You can plot this data like before: plot(data_by_minute()) Here, notice that the individual data points are now visible (i.e., the apparent line in the previous diagram is now discernible as a series of discrete values). Interpolate missing records¶ The data_by_minute() function resamples data by the minute. However, the query used can only resample data for minutes with one or more records. - If you want one data point per minute interval irrespective of the number of records, you must interpolate those values. You can interpolate data in many ways, some more advanced than others. For this tutorial, we will show you how to achieve the simplest possible type of interpolation: null interpolation. Null interpolation works by filling in any gaps in the time series with NULL values. NULL is a value used to indicate missing data. The result is a time series that indicates the presence of missing data, lending itself well to accurate visualization. You can perform null interpolation like so: Generate continuous null data for the same period as the right-hand table of a join. You should sample this data at the frequency most appropriate for your visualization. Select the data for the period you are interested in as the left-hand table of a join. You should resample this data at the same frequency as your null data. Join both tables with a left inner join on timeto pull across any non-null values from the right-hand table. The result is a row set that has one row per interval for a fixed period with null values filling in for missing data. See also Read more about how joins work. A brief example¶ To illustrate how null interpolation works with a brief example, imagine that you are interested in a specific five minute period between 07:00 and 07:05. Here’s your resampled data: Notice that rows for 07:01 and 07:04 are missing. Perhaps the data collection process ran into issues during those time windows. If you generate null data for the same period, it will look like this: Note A column full of null values will be cast to None values by pandas. That’s why this table displays None instead of NULL. If you perform a left inner join with those two result sets (on the time column), you will end up with the following: Here, notice that: There is one result row per minute interval, even when there are no corresponding records. Missing data results in a distancevalue of NaN(Not a Number). Pandas will cast NULLvalues to NaNwhen a column contains numeric data. See also Read more about Working with missing data using pandas. Generate continuous null data for the past 24 hours¶ You can generate continuous null data with the generate_series() table function. A table function is a function that produces a set of rows. For example, this query generates null values for every minute in the past 24 hours: def null_by_minute_24h(): sql = ''' SELECT time, NULL AS distance FROM generate_series( DATE_TRUNC('minute', CURRENT_TIMESTAMP) - INTERVAL '24 hours', DATE_TRUNC('minute', CURRENT_TIMESTAMP), '1 minute'::INTERVAL ) AS series(time) ''' return pandas.read_sql(sql, 'crate://localhost:4200', parse_dates={'time': 'ms'}) Test the function, like so: null_by_minute_24h() Plot the data: plot(null_by_minute_24h()) This plot displays null values for a full 24 hour period. Conceptually, all that remains is to combine this null plot with the plot that includes your resampled data. Bring it all together¶ To combine the null data with your resampled data, you can write a new query that performs a left Inner joins, as per the previous introductions. def data_24h(): # From < berlin_position = [52.520008, 13.404954] # Returns distance in kilometers (division by 1000) sql = f''' SELECT time, COUNT(*) AS records, AVG(DISTANCE(iss.position, {berlin_position}) / 1000) AS distance FROM generate_series( DATE_TRUNC('minute', CURRENT_TIMESTAMP) - INTERVAL '24 hours', DATE_TRUNC('minute', CURRENT_TIMESTAMP), '1 minute'::INTERVAL ) AS series(time) LEFT JOIN doc.iss ON DATE_TRUNC('1 minute'::INTERVAL, iss.timestamp, 0) = time GROUP BY time ORDER BY time ASC ''' return pandas.read_sql(sql, 'crate://localhost:4200', parse_dates={'time': 'ms'}) In the code above: The generate_series() table function creates a row set called timethat has one row per minute for the past 24 hours. The isstable can be joined to the timeseries by truncating the iss.timestampcolumn to the minute for the join condition. Like before, a GROUP BY clause can be used to collapse multiple rows per minute into a single row per minute. Similarly, the avg(column) function can be used to compute an aggregate DISTANCEvalue across multiple rows. There is no need to check for null values here because the AVG()function discards null values. Test the function: data_24h() Plot the data: plot(data_24h()) And here’s what it looks like if you wait a few more hours: The finished result is a visualization that uses time series normalization and resamples raw data to regular intervals with the interpolation of missing values. This visualization resolves both original issues: You want to plot a single value per minute, but your data is spaced in 10-second intervals. You will need to resample the data. You want to plot every minute for the past 24 hours, but you are missing data for some intervals. You will need to fill in the missing values.
https://crate.io/docs/crate/howtos/en/latest/getting-started/normalize-intervals.html
CC-MAIN-2022-21
en
refinedweb
Inference Pipeline with Scikit-learn and Linear Learner Typically a Machine Learning (ML) process consists of few steps: data gathering with various ETL jobs, pre-processing the data, featurizing the dataset by incorporating standard techniques or prior knowledge, and finally training an ML model using an algorithm. In many cases, when the trained model is used for processing real time or batch prediction requests, the model receives data in a format which needs to pre-processed (e.g. featurized) before it can be passed to the algorithm. In the following notebook, we will demonstrate how you can build your ML Pipeline leveraging the Sagemaker Scikit-learn container and SageMaker Linear Learner algorithm & after the model is trained, deploy the Pipeline (Data preprocessing and Lineara Learner) as an Inference Pipeline behind a single Endpoint for real time inference and for batch inferences using Amazon SageMaker Batch Transform. We will demonstrate this using the Abalone Dataset to guess the age of Abalone with physical features. The dataset is available from UCI Machine Learning; the aim for this task is to determine age of an Abalone (a kind of shellfish) from its physical measurements. We’ll use Sagemaker’s Scikit-learn container to featurize the dataset so that it can be used for training with Linear Learner. Table of contents Preprocessing data and training the model Upload the data for training Create a Scikit-learn script to train with Create SageMaker Scikit Estimator Batch transform our training data Fit a LinearLearner Model with the preprocessed data Inference Pipeline with Scikit preprocessor and Linear Learner Set up the inference pipeline Make a request to our pipeline endpoint - Let’s first create our Sagemaker session and role, and create a S3 prefix to use for the notebook example. [ ]: import sagemaker from sagemaker import get_execution_role sagemaker_session = sagemaker.Session() # Get a SageMaker-compatible role used by this Notebook Instance. role = get_execution_role() # S3 prefix bucket = sagemaker_session.default_bucket() prefix = "Scikit-LinearLearner-pipeline-abalone-example" Preprocessing data and training the model SageMaker team has downloaded the dataset from UCI and uploaded to one of the S3 buckets in our account. [ ]: ! mkdir abalone_data ! aws s3 cp s3://sagemaker-sample-files/datasets/tabular/uci_abalone/abalone.csv ./abalone_data When training large models with huge amounts of data, you’ll typically use big data tools, like Amazon Athena, AWS Glue, or Amazon EMR, to create your data in S3. We can use the tools provided by the SageMaker Python SDK to upload the data to a default bucket. [ ]: WORK_DIRECTORY = "abalone_data" train_input = sagemaker_session.upload_data( path="{}/{}".format(WORK_DIRECTORY, "abalone.csv"), bucket=bucket, key_prefix="{}/{}".format(prefix, "train"), ) To run Scikit-learn on Sagemaker SKLearn Estimator with a script as an entry point. Chainer, the script run by this notebook: from __future__ import print_function import time import sys from io import StringIO import os import shutil import argparse import csv import json import joblib import numpy as np import pandas as pd from sklearn.compose import ColumnTransformer, make_column_selector from sklearn.impute import SimpleImputer from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Binarizer, StandardScaler, OneHotEncoder from sagemaker_containers.beta.framework import ( content_types, encoders, env, modules, transformer, worker) # Since we get a headerless CSV file we specify the column names here. feature_columns_names = [ 'sex', # M, F, and I (infant) 'length', # Longest shell measurement 'diameter', # perpendicular to length 'height', # with meat in shell 'whole_weight', # whole abalone 'shucked_weight', # weight of meat 'viscera_weight', # gut weight (after bleeding) 'shell_weight'] # after being dried label_column = 'rings' feature_columns_dtype = { 'sex': "category", 'length': "float64", 'diameter': "float64", 'height': "float64", 'whole_weight': "float64", 'shucked_weight': "float64", 'viscera_weight': "float64", 'shell_weight': "float64"} label_column_dtype = {'rings': "float64"} # +1.5 gives the age in years def merge_two_dicts(x, y): z = x.copy() # start with x's keys and values z.update(y) # modifies z with y's keys and values & returns None return, header=None, names=feature_columns_names + [label_column], dtype=merge_two_dicts(feature_columns_dtype, label_column_dtype)) for file in input_files ] concat_data = pd.concat(raw_data) # Labels should not be preprocessed. predict_fn will reinsert the labels after featurizing. concat_data.drop(label_column, axis=1, inplace=True) # This section is adapted from the scikit-learn example of using preprocessing pipelines: # # # # We will train our classifier with the following features: # Numeric Features: # - length: Longest shell measurement # - diameter: Diameter perpendicular to length # - height: Height with meat in shell # - whole_weight: Weight of whole abalone # - shucked_weight: Weight of meat # - viscera_weight: Gut weight (after bleeding) # - shell_weight: Weight after being dried # Categorical Features: # - sex: categories encoded as strings {'M', 'F', 'I'} where 'I' is Infant numeric_transformer = make_pipeline( SimpleImputer(strategy='median'), StandardScaler()) categorical_transformer = make_pipeline( SimpleImputer(strategy='constant', fill_value='missing'), OneHotEncoder(handle_unknown='ignore')) preprocessor = ColumnTransformer(transformers=[ ("num", numeric_transformer, make_column_selector(dtype_exclude="category")), ("cat", categorical_transformer, make_column_selector(dtype_include="category"))]) preprocessor.fit(concat_data) joblib.dump(preprocessor, os.path.join(args.model_dir, "model.joblib")) print("saved model!")), header=None) if len(df.columns) == len(feature_columns_names) + 1: # This is a labelled example, includes the ring label df.columns = feature_columns_names + [label_column] elif len(df.columns) == len(feature_columns_names): # This is an unlabelled example. df.columns = feature_columns_names """ features = model.transform(input_data) if label_column in input_data: # Return the label (as the first column) and the set of features. return np.insert(features, 0, input_data[label_column], axis=1) else: # Return only the set of features return features def model_fn(model_dir): """Deserialize fitted model """ preprocessor = joblib.load(os.path.join(model_dir, "model.joblib")) return preprocessor To run our Scikit-learn training script on SageMaker, we construct a sagemaker.sklearn.estimator.sklearn estimator, which accepts several constructor arguments: entry_point: The path to the Python script SageMaker runs for training and prediction. role: Role ARN framework_version: Scikit-learn version you want to use for executing your model training code. train FRAMEWORK_VERSION = "0.23-1" script_path = "sklearn_abalone_featurizer.py" sklearn_preprocessor = SKLearn( entry_point=script_path, role=role, framework_version=FRAMEWORK_VERSION, instance_type="ml.c4.xlarge", sagemaker_session=sagemaker_session, ) [ ]: sklearn_preprocessor.fit({"train": train_input}) Now that our proprocessor is properly fitted, let’s go ahead and preprocess our training data. Let’s use batch transform to directly preprocess the raw data and store right back into s3. [ ]: # Define a SKLearn Transformer from the trained SKLearn Estimator transformer = sklearn_preprocessor.transformer( instance_count=1, instance_type="ml.m5.xlarge", assemble_with="Line", accept="text/csv" ) [ ]: # Preprocess training input transformer.transform(train_input, content_type="text/csv") print("Waiting for transform job: " + transformer.latest_transform_job.job_name) transformer.wait() preprocessed_train = transformer.output_path Let’s take the preprocessed training data and fit a LinearLearner Model. Sagemaker provides prebuilt algorithm containers that can be used with the Python SDK. The previous Scikit-learn job preprocessed the raw Titanic dataset into labeled, useable data that we can now use to fit a binary classifier Linear Learner model. For more on Linear Learner see: [ ]: import boto3 from sagemaker.image_uris import retrieve ll_image = retrieve("linear-learner", boto3.Session().region_name) [ ]: s3_ll_output_key_prefix = "ll_training_output" s3_ll_output_location = "s3://{}/{}/{}/{}".format( bucket, prefix, s3_ll_output_key_prefix, "ll_model" ) ll_estimator = sagemaker.estimator.Estimator( ll_image, role, instance_count=1, instance_type="ml.m4.2xlarge", volume_size=20, max_run=3600, input_mode="File", output_path=s3_ll_output_location, sagemaker_session=sagemaker_session, ) ll_estimator.set_hyperparameters(feature_dim=10, predictor_type="regressor", mini_batch_size=32) ll_train_data = sagemaker.inputs.TrainingInput( preprocessed_train, distribution="FullyReplicated", content_type="text/csv", s3_data_type="S3Prefix", ) data_channels = {"train": ll_train_data} ll_estimator.fit(inputs=data_channels, logs=True) Serial Inference Pipeline with Scikit preprocessor and Linear Learner Setting up a Machine Learning pipeline can be done with the Pipeline Model. This sets up a list of models in a single endpoint; in this example, we configure our pipeline model with the fitted Scikit-learn inference model and the fitted Linear Learner model. Deploying the model follows the same deploy pattern in the SDK. [ ]: from sagemaker.model import Model from sagemaker.pipeline import PipelineModel import boto3 from time import gmtime, strftime timestamp_prefix = strftime("%Y-%m-%d-%H-%M-%S", gmtime()) scikit_learn_inferencee_model = sklearn_preprocessor.create_model() linear_learner_model = ll_estimator.create_model() model_name = "inference-pipeline-" + timestamp_prefix endpoint_name = "inference-pipeline-ep-" + timestamp_prefix sm_model = PipelineModel( name=model_name, role=role, models=[scikit_learn_inferencee_model, linear_learner_model] ) sm_model.deploy(initial_instance_count=1, instance_type="ml.c4.xlarge", endpoint_name=endpoint_name) Here we just grab the first line from the test data (you’ll notice that the inference python script is very particular about the ordering of the inference request data). output_fn() method in our entry point. Note that we set the Accept to application/json, since Linear Learner does not support text/csv Accept. The prediction output in this case is trying to guess the number of rings the abalone specimen would have given its other physical features; the actual number of rings is 10. [ ]: from sagemaker.predictor import Predictor from sagemaker.serializers import CSVSerializer payload = "M, 0.44, 0.365, 0.125, 0.516, 0.2155, 0.114, 0.155" actual_rings = 10 predictor = Predictor( endpoint_name=endpoint_name, sagemaker_session=sagemaker_session, serializer=CSVSerializer() ) print(predictor.predict(payload)) Once we are finished with the endpoint, we clean up the resources! [ ]: sm_client = sagemaker_session.boto_session.client("sagemaker") predictor.delete_model() sm_client.delete_endpoint(EndpointName=endpoint_name) [ ]: transformer.delete_model()
https://sagemaker-examples.readthedocs.io/en/latest/sagemaker-python-sdk/scikit_learn_inference_pipeline/Inference%20Pipeline%20with%20Scikit-learn%20and%20Linear%20Learner.html
CC-MAIN-2022-21
en
refinedweb
Introduction: Android Jammer Control Introduction I am a lazzy person, i need one remote control for the jammer and i have one HC06 lying around and my android phone, in this project I will demonstrate the use of an android phone as an remote control for my 433 Mhz jammer arduino using only 3 element´s, KISS theory List of materials: -Arduino -433 RF Module -HC06 (bluetooth module) Step 1: Schematics For this project I use one breadboard, but you can simple connect the RF transmitter and the HC06 to the arduino, pay attention to the connection of HC06, arduino port RXD-> TXD HC06 and Arduino port TXD->RXD HC06. The power comes from a 12 volts battery and don´t forget to connect the 5 volts power source to hc06, if you conect to 12 V you kill it Step 2: The Android /arduino Code... For programing the android i use the MIT app inventor, its easy to develop and have what i need. the program explain´s by himself, one button connect´s to hc06, and more two buttons for the remote controle (ON OFF), the skull is just to remmind about the consequences of using this jammer outside the lab. Arduino source code And now the source code: #include); } 7 Comments 5 years ago No error if to write so #include <SoftwareSerial.h> SoftwareSerial mySerial (0, 1); 6 years ago on Introduction code in my arduino one doesn't work... #include SoftwareSerial mySerial(0, 1); i think the problem is library.. sketch_jul22a.ino:1:10: error: #include expects "FILENAME" or <FILENAME> sketch_jul22a.ino:3:1: error: 'SoftwareSerial' does not name a type sketch_jul22a.ino: In function 'void setup()': sketch_jul22a.ino:10:21: error: 'mySerial' was not declared in this scope sketch_jul22a.ino: In function 'void loop()': sketch_jul22a.ino:20:9: error: 'mySerial' was not declared in this scope Reply 5 years ago Put <> before and after softwareserial Reply 5 years ago Type #include 6 years ago on Introduction hay, can i use this tool to jam the phone signal ? thanks Reply 6 years ago on Introduction Nope, this only jam the 433 Mhz signal 6 years ago on Introduction it works fine whit standard libray...it works!!!
https://www.instructables.com/Android-jammer-control/
CC-MAIN-2022-21
en
refinedweb
I was writing a custom Twisted XML-RPC server for radio station DJs to use, but one station was managing all of its internal web app users and groups through Zope. Twisted has an amazingly pluggable authentication framework, so the requirement was satisfied with the following. Note that in this simple example, every time a user executes an XML-RPC method, they are authenticating against Zope. This involves an xmlrpclib.ServerProxy instantiation as well as the overhead of making a network connection to Zope. For this reason, as well as in the event of Zope being down, one might want to implement some form of caching (without passwords), so that application functionality is not impacted by Zope downtime and overhead from authentication is only incurred when necessary. radix makes a very good point in the comments: the use of xmlrpclib in this recipe is blocking. This means that if you have 10, 20, whatever number of people using the app, and someone new logs in, the twisted reactor can't do it's usual thing and cycle through requests until that user finishes logging in. I will post an update that makes use of the non-blocking t.w.xmlrpc code. The solution will be messier, though, as t.w.xmlrpc is broken in that it doesn't handle scheme://username:pass@host:port URLs. This is due to the fact that t.w.xmlrpc.QueryProtocol doesn't set an Authentication header... and there's no mechanism in t.w.xmlrpc.Proxy and QueryFactory for parsing and setting user and password into from the URL. Update: see the comments below for how to work around this limitation. The idea behind this is to not so much use the internal authentication machinery of Zope, but rather to simply attempt to authenticate in Zope via XML-RPC. The success or failure of that is evaluated and used to determine whether or not you are an authenticated user in the twisted application. ZopeChecker makes use of the following Zope/Plone python script, named getXMLRPCUserInfo. This needs to be in your Zope/Plone path. <pre> member=context.portal_membership.getAuthenticatedMember() if context.portal_membership.isAnonymousUser(): authenticated = False else: authenticated = True return { 'name': member.getUserName(), 'id': member.getId(), 'roles': member.getRoles(), 'authenticated': authenticated, } </pre> You could use this from an interactive python session in the following manner: <pre> import xmlrpclib>> server = ServerProxy(url % good) >>> info = server.getXMLRPCUserInfo() >>> info.get('authenticated') True >>> info.get('roles') ['Authenticated'] >>> info.get('name') "Joseph O'Blow" >>> server = ServerProxy(url % badpass) >>> info = server.getXMLRPCUserInfo() >>> info.get('authenticated') False >>> info.get('roles') ['Anonymous'] >>> info.get('name') 'Anonymous User' </pre> As for how the Zope checker gets plugged into a Twisted application, here is a .tac file that demonstrates this: <pre> from twisted.web import server from twisted.cred import portal from twisted.application import service, internet from twisted.internet.ssl import DefaultOpenSSLContextFactory from kxxx.musicdb import auth from kxxx.musicdb.utils import log from kxxx.musicdb.conf import cfg, getResource authentication setup checker = auth.ZopeChecker(cfg.user_database.host, port=cfg.user_database.port, scheme=cfg.user_database.scheme, path=cfg.user_database.path) realm = auth.MusicDBAppRealm() authportal = portal.Portal(realm) authportal.registerChecker(checker) authrsrc = auth.BasicAuthResource(authportal) encryption setup privkey_file = getResource([cfg.ssl.path, cfg.ssl.private_key]) cert_file = getResource([cfg.ssl.path, cfg.ssl.ca_cert]) ssl_context = DefaultOpenSSLContextFactory(privkey_file, cert_file) setup the twisted XML-RPC server as an application application = service.Application(cfg.app_name) xmlrpc_site = server.Site(authrsrc) xmlrpc_server = internet.SSLServer(cfg.port, xmlrpc_site, ssl_context) xmlrpc_server.setServiceParent(application) </pre> Note that cfg is actually a ZConfig instance, with filenames provided by setuptools' pkg_resource, so no configuration values are hard-coded. getResource() is actually a wrapper for pkg_resource.resource_filename() with the added functionality of checking for the resource in question at a configured set of locations on the file system priort to pulling it from the egg. MusicDBAppRealm is where all the handlers are set up for XLM-RPC methods (so we can do stuff like server.query.getXXX(), server.update.addXXX(), etc.). MusicDBAppRealm instantiates MusicDBAppAvatar() which is a subclass of the XML-RPC application API. Be sure to read everything here: The Twisted-Python mail list is an invaluable resource; take advantage of it: Also: Abe Fettig gives a great summary of Authentication in the new Twisted book. But most importantly: read the source, Luke. Please, please, please. You really don't want to be using xmlrpclib here. Use twisted.web.xmlrpc.Proxy. xmlrpclib is blocking your entire Twisted process every time you authenticate, and Twisted has a nice alternative already available for you in twisted.web.xmlrpc. twisted.web.xmlrpc. Thanks -- I'll add that to the comments. That's what I've done in production (in addition to implementing a caching solution). I did want to keep the recipe simple, so I left that bit out. I'll make a note in the description for now, but when I clean up and pare down the prod code, I'll update the recipe. Using Deferreds. Okay, I have posted a couple more recipes that should make this as clean as possible. However, since twitsed.web.xmlrpc itself doesn't actually support authentication, I will not modify the recipe, but will post how to work around this here. The code to have a Twisted XML-RPC Proxy which supports Authentication is here: With that said, here's what you would do to modify this recipe:
https://code.activestate.com/recipes/473838-authenticating-twisted-with-zopeplone/?in=lang-python
CC-MAIN-2022-21
en
refinedweb
Angular Angular Column Chart provides an option to plot data bi-directionally to compare and analyze the value clearly. The Angular Column Chart provides an option to customize the spacing between two bars and the width of the bar. Modernize the UI by applying rounded corners to the column chart. Customize the look and feel of the column chart using built-in APIs. Easily get started with Angular Column Chart using a few simple lines of HTML and TS code example as demonstrated below. Also explore our Angular Column Chart Example that shows you how to render and configure the chart. <ejs-chart <e-series-collection> <e-series [dataSource]='data' type='Column' xName='x' yName='y'> </e-series> </e-series-collection> </ejs-chart> import { Component } from '@angular/core'; export class AppComponent { public data: Object[] = [ { x: 'GER', y: 172 }, { x: 'RUS', y: 300 }, { x: 'BRZ', y: 239 }, { x: 'IND', y: 462 }, { x: 'CHN', y: 621 }, ]; //Initializing Primary X Axis public primaryXAxis: Object = { valueType: 'Category', }; } //app.module.ts import { ChartModule } from '@syncfusion/ej2-ng-charts'; import { ColumnSeriesService, CategoryService} from '@syncfusion/ej2-ng-charts'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, ChartModule ], providers: [ ColumnSeriesService, CategoryService], bootstrap: [AppComponent] }) export class AppModule { } Learn the available options to customize Angular Column Chart. Column Chart API Reference Explore the Angular Column Chart APIs.
https://www.syncfusion.com/angular-ui-components/angular-charts/chart-types/column-chart
CC-MAIN-2022-21
en
refinedweb
A Swift package for working with GraphViz. import GraphViz var graph = Graph(directed: true) let a = Node("a"), b = Node("b"), c = Node("c") graph.append(Edge(from: a, to: b)) graph.append(Edge(from: a, to: c)) var b_c = Edge(from: b, to: c) b_c.constraint = false graph.append(b_c) // Render image to SVG using dot layout algorithm graph.render(using: .dot, to: .svg) { result in guard .success(let data) = result, let svg = String(data: data, encoding: .utf8) else { return } print(svg) } digraph { a -> b a -> c b -> c [constraint=false] } Note: render(using:to:)and related methods require GraphViz to be installed on your system. import GraphViz let graph = Graph(directed: true) { "a" --> "b" "a" --> "c" ("b" --> "c").constraint(false) } Note: Swift 5.1 may require explicit typecast expressions in order to reconcile use of custom edge operators like -->. ( error: ambiguous reference to member '-->') You can install GraphViz on your system by running the following command: # macOS $ brew install graphviz # Linux (Ubuntu) $ sudo apt-get install graphviz Important: If you add GraphViz to your macOS app and installed system dependencies using Homebrew, Xcode may emit an error message like the following: Warning: Could not load "/usr/lib/graphviz/libgvplugin_gdk.so.6" It was found, so perhaps one of its dependents was not. Try ldd. One solution is to run the following commands to sign the dependencies (replacing MyName (MyTeam)with your developer account name and team name): $ codesign -f -s "Apple Development: MyName (MyTeam)" /usr/local/opt/*/lib/*.dylib $ codesign -f -s "Apple Development: MyName (MyTeam)" /usr/local/Cellar/*/*/lib/*.dylib Add the GraphViz package to your target dependencies in Package.swift: import PackageDescription let package = Package( name: "YourProject", dependencies: [ .package( url: " from: "0.4.1" ), ] ) Add GraphViz as a dependency to your target(s): targets: [ .target( name: "YourTarget", dependencies: ["GraphViz"]), MIT Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics
https://swiftpack.co/package/SwiftDocOrg/GraphViz
CC-MAIN-2022-21
en
refinedweb
Back to: C#.NET Tutorials For Beginners and Professionals Thread Pool in C# In this article, I am going to discuss Thread Pool in C# with examples. Please read our previous article where we discussed the Performance Testing of a multithreaded application in C#. As part of this article, we are going to discuss the following pointers. - The Request Life cycle of a Thread. - What is Thread Pooling in C#? - Why do we need C# Thread Pool? - Performance testing between normal thread and thread pooling The Request Life cycle of a Thread in C# with Example. Let us understand the life cycle of a thread in C#. In order to understand this, please have a look at the following image. When the .NET framework receives a request (the request can be a method call or function call from any kind of application). To that handle request, a thread object is created. When the thread object is created some resources are allocated to that thread object such as memory. After then the task is executed and once the task is completed then the garbage collector removes that thread object for free-up memory allocation. This is the life cycle of a thread in C#. These steps are going to be repeated again and again for each request that comes in a multithread application. That means every time a new thread object created and get allocated in the memory. If there are many requests then there will be many thread objects and if there are many thread objects then there will be load on the memory which slows down your application. There is a great room for performance improvements. The Thread object is created, resources are allocated, the task is executed, and then it should not go for garbage collection, instead of how about taking the thread object and put it into a pool as shown in the below image. This is where thread pooling comes into the picture. Thread Pool in C#: Thread pool in C# is nothing but a collection of threads that can be reused to perform no of tasks in the background. Now when a request comes, then it directly goes to the thread pool and checks whether there are any free threads available or not. If available, then it takes the thread object from the thread pool and executes the task as shown in the below image. Once the thread completes its task then it again sent back to the thread pool so that it can reuse. This reusability avoids an application to create the number of threads and this enables less memory consumption. How to use C# Thread Pool? Let us see a simple example to understand how to use Thread Pooling. Once you understand how to use thread pooling then we will see the performance benchmark between the normal thread object and thread pool. Step1: In order to implement thread pooling in C#, first, we need to import the Threading namespace as ThreadPool class belongs to this namespace as shown below. using System.Threading; Step2: Once you import the Threading namespace, then you need to use the ThreadPool class and using this class you need to call the QueueUserWorkItem static method. If you go to the definition of the QueueUserWorkItem method, then you will see that this method takes one parameter of type WaitCallback object. While creating the object of the WaitCallback class, you need to pass the method name that you want to execute. ThreadPool.QueueUserWorkItem(new WaitCallback(MyMethod)); Here, the QueueUserWorkItem method Queues the function for execution and that function executes when a thread becomes available from the thread pool. If no thread is available then it will wait until one thread gets freed. Here MyMethod is the method that we want to execute by a thread pool thread. The complete code is given below. As you can see in the below code, here, we create one method that is MyMethod and as part of that method, we simply printing the thread id, whether the thread is a background thread or not and whether it is from thread pool or not. And we want to execute this method 10 times using the thread pool threads. So, here we use a simple for each loop and use the ThreadPool class and call that method. using System; using System.Threading; namespace ThreadPoolApplication { class Program { static void Main(string[] args) { for (int i = 0; i < 10; i++) { ThreadPool.QueueUserWorkItem(new WaitCallback(MyMethod)); } Console.Read(); } public static void MyMethod(object obj) { Thread thread = Thread.CurrentThread; string message = $"Background: {thread.IsBackground}, Thread Pool: {thread.IsThreadPoolThread}, Thread ID: {thread.ManagedThreadId}"; Console.WriteLine(message); } } } Once you execute the above code, it will give you the following output. As you can see, it shows that it is a background thread and this thread is from the thread pool and the thread Ids may vary in your output. Here, you can see three threads handle all the 10 method calls. Performance testing using and without using Thread Pool in C# with Example: Let us see an example to understand the performance benchmark. Here, we will compare how much time does the thread object takes and how much time does the thread pool thread takes to do the same task i.e. to execute the same methods. In order to do this, what we are going to do is, we will create a method called Test as shown below. This method takes an input parameter of type object and as part of that Test method we are doing nothing means an empty method. Then we will create two methods such as MethodWithThread and MethodWithThreadPool and inside these two methods, we will create one for loop which will execute 10 times. Within for loop, we are going to call the Test as shown below. As you can see, the MethodWithThread method uses the Thread object to call the Test method while the MethodWithThreadPool method uses the ThreadPool object to call the Test method. Now we need to call the above two methods (MethodWithThread and MethodWithThreadPool) from the main method. As we are going to test the performance benchmark, so we are going to call these two methods between the stopwatch start and end as shown below. The Stopwatch class is available in System.Diagnostics namespace. The for loop within the Main method is for warm-up. This is because when we run the code for the first time, compilation happens and compilation takes some time and we don’t want to measure that. The complete code is given below. using System; using System.Diagnostics; using System.Threading; namespace ThreadPoolApplication { class Program { static void Main(string[] args) { for (int i = 0; i < 10; i++) { MethodWithThread(); MethodWithThreadPool(); } Stopwatch stopwatch = new Stopwatch(); Console.WriteLine("Execution using Thread"); stopwatch.Start(); MethodWithThread(); stopwatch.Stop(); Console.WriteLine("Time consumed by MethodWithThread is : " + stopwatch.ElapsedTicks.ToString()); stopwatch.Reset(); Console.WriteLine("Execution using Thread Pool"); stopwatch.Start(); MethodWithThreadPool(); stopwatch.Stop(); Console.WriteLine("Time consumed by MethodWithThreadPool is : " + stopwatch.ElapsedTicks.ToString()); Console.Read(); } public static void MethodWithThread() { for (int i = 0; i < 10; i++) { Thread thread = new Thread(Test); } } public static void MethodWithThreadPool() { for (int i = 0; i < 10; i++) { ThreadPool.QueueUserWorkItem(new WaitCallback(Test)); } } public static void Test(object obj) { } } } Output: As you can see in the above output, the Time consumed by MethodWithThread is 663 and the Time consumed by MethodWithThreadPool is 93. If you observe there is a vast time difference between these two. So it proofs that the thread pool gives better performance as compared to the thread class object. If there are needs to create one or two threads then you need to use Thread class object while if there is a need to create more than 5 threads then you need to go for thread pool class in a multithreaded environment. That’s it for today. In the next article, I am going to discuss Asynchronous Programming in C# with examples. Here, in this article, I try to explain Thread Pool in C# with examples. I hope you enjoy this article and understood C# thread pooling. 5 thoughts on “Thread Pooling in C#” When I am executing this program in a separate static class, and calling method from Main method, then time elapsed with thread is very less as compared to Thread Pooling!!! Mean opposite result Why is it so. This is the output : Execution using threads Total time taken with thread : 0 Execution using thread POOL Total time taken with thread POOL : 8 Execution using Thread Time consumed by MethodWithThread is : 4450 Execution using Thread Pool Time consumed by MethodWithThreadPool is : 21905 for (int i = 0; i < 10; i++) { } Thread thread = new Thread(Test); thread.start(); Threadpool has a limit of 25 thread per pool when your has more then it becomes to deadlock. this is up to how many cores of your laptop.
https://dotnettutorials.net/lesson/thread-pooling/
CC-MAIN-2022-21
en
refinedweb
So far the move to wxPython has been going fairly smoothly. However, it's crucial that I be able to display items in the center of the screen (images, buttons, and radioboxes). I read about wx.ALIGN_CENTER_VERTICAL and wx.ALIGN_CENTER_HORIZONTAL, but the vertical option just doesn't seem to be working for me. Below I've modified vegaseat's code for the radiobox. As it is, it doesn't align vertically but will align horizontally if I put that in instead. Any help? import wx class MyFrame(wx.Frame): def __init__(self, parent=None): wx.Frame.__init__(self, parent, wx.ID_ANY, size=(500, 360)) # match to the number of radiobuttons self.mychoices = ['image1', 'image2', 'image3', 'image4'] # create a box with 4 radio buttons, no labels here label_choices = [' ', ' ', ' ', ' '] self.radiobox = wx.RadioBox(self, wx.ID_ANY, " click on a button ", choices=label_choices, style=wx.VERTICAL) # bind mouse click to an action self.radiobox.Bind(wx.EVT_RADIOBOX, self.onAction) # show present selection self.onAction(None) self.verticalDisplay = wx.BoxSizer(wx.VERTICAL) self.verticalDisplay.Add(self.radiobox, 0, wx.ALIGN_CENTER_VERTICAL) self.SetSizer(self.verticalDisplay) def onAction(self, event): """show the selected choice""" index = self.radiobox.GetSelection() s = "Selected " + self.mychoices[index] # show the result in the frame title self.SetTitle(s) app = wx.App(0) MyFrame().Show() app.MainLoop()
https://www.daniweb.com/programming/software-development/threads/195121/wxpython-vertical-aligning-failing
CC-MAIN-2022-21
en
refinedweb
From Fedora Project Wiki You do not have permission to edit this page, for the following reasons: - The action you have requested is limited to users in the group: Users. - You do not have permission to edit pages in the Fedora_Project_Wiki_talk namespace. You can view and copy the source of this page. Template used on this page: Return to Fedora Project Wiki talk:Deletion.
https://www.fedoraproject.org/w/index.php?title=Fedora_Project_Wiki_talk:Deletion&action=edit
CC-MAIN-2022-21
en
refinedweb
#include <SIM_ConstraintNetworkIterator.h> Generic implementation of ConstraintAccessor, which evaluates constraint parameter values by name. Definition at line 275 of file SIM_ConstraintNetworkIterator.h. Default constructor uses SIM_DataFilterAll. Returns whether the constraint type should be included when iterating over the constraint network, and performs any necessary caching with the constraint data and its index. Implements SIM_ConstraintNetwork::ConstraintAccessor. Update the current constraint data type index and primitive offset. Definition at line 113 of file SIM_ConstraintNetworkIteratorImpl.h. Returns the value of an attribute of the constraint. If there is no primitive attribute with that name, a default value will be taken from the attached subdata if possible. Definition at line 127 of file SIM_ConstraintNetworkIteratorImpl.h. Definition at line 120 of file SIM_ConstraintNetworkIteratorImpl.h. Retrieve a value from the attached subdata for the constraint. Definition at line 136 of file SIM_ConstraintNetworkIteratorImpl.h. Looks up a value for a primitive attribute. Returns true if the attribute exists, and false otherwise. Definition at line 149 of file SIM_ConstraintNetworkIteratorImpl.h. Initialize with the constraint network's GU_Detail, and the number of constraint types referenced by the geometry (from the 'constraint_name' primitive attribute). Implements SIM_ConstraintNetwork::ConstraintAccessor.
https://www.sidefx.com/docs/hdk/class_s_i_m___constraint_network_1_1_generic_constraint_accessor.html
CC-MAIN-2022-21
en
refinedweb
How to solve machine learning problems in the real world Becoming a machine learning engineer pro is your goal? Sure, online ML courses and Kaggle-style competitions are great resources to learn the basics. However, the daily job of a ML engineer requires an additional layer of skills that you won’t master through these approaches. By Pau Labarta Bajo, mathematician and data scientist. So, you want to become a professional machine learning engineer? Tempted to take (yet another) online course on ML to land that first job Online courses on Machine Learning and Kaggle-style competitions are great resources to learn the fundamentals of machine learning. However, the daily job of a machine learning engineer requires an additional layer of skills that you won’t master there. In this article, I will give you 4 tips to help you solve ML problems in the real world. I have learned them (the hard way) while working as a freelance ML engineer at Toptal. By the way, if you would also like to work on a freelance basis (highly recommended!) you can check my blog post on how to become one. Photo by Valdemaras D. from Pexels. The gap between machine learning courses and practice Completing many online courses on ML seems like a safe path to learning. You follow along with the course code on Convolutional Nets, you implement yourself, and voila! You become an expert in Computer Vision! Well, you don’t. You are missing 4 key skills to build successful ML solutions in a professional environment. Let’s start! 1. Understand the business problem first, then frame it as a Machine Learning problem. When you follow an online course or participate in a Kaggle competition, you do not need to define the ML problem to solve. You are told what to solve for (e.g., predict house prices) and how to measure how close you are to a good solution (e.g., mean squared error of the model predictions vs. actual prices). They also give you all the data and tell you what the features are, and what is the target metric to predict. Given all this information, you jump straight into the solution space. You quickly explore the data and start training model after model, hoping that after each submission, you climb a few steps in the public leaderboard. Technical minds, like software and ML engineers, love to build things. I include myself in this group. We do that even before we understand the problem we need to solve. We know the tools, and we have quick fingers, so we jump straight into the solution space (aka the HOW) before taking the time to understand the problem we have in front of us (aka the WHAT). When you work as a professional data scientist or ML engineer, you need to think of a few things before building any model. I always ask 3 questions at the beginning of every project: - What is the business outcome that management wants to improve? Is there a clear metric for that, or do I need to find proxy metrics that make my life easier? It is crucial you talk with all relevant stakeholders at the beginning of the project. They often have much more business context than you and can greatly help you understand what the target you need to shoot at is. In the industry, it is better to build an okay-ish solution for the right problem than a brilliant solution for the wrong problem. Academic research is often the opposite. Answer this first question, and you will know the target metric of your ML problem. - Is there any solution currently working in production to solve this, like another model or even some rule-based heuristics? If there is one, this is the benchmark you have to beat in order to have a business impact. Otherwise, you can have a quick win by implementing a non-ML solution. Sometimes you can implement a quick and simple heuristic that already brings an impact. In the industry, an okay-ish solution today is better than a brilliant solution in 2 months. Answer this second question, and you will understand how good the performance of your models needs to be in order to make an impact. - Is the model going to be used as a black-box predictor? Or do we intend to use it as a tool to assist humans in making better decisions? Creating black-box solutions is easier than explainable ones. For example, if you want to build a Bitcoin trading bot, you only care about the estimated profit it will generate. You backtest its performance and see if this strategy brings you value. Your plan is to deploy the bot, monitor its daily performance, and shut it down in case it makes you lose money. You are not trying to understand the market by looking at your model. On the other hand, if you create a model to help doctors improve their diagnosis, you need to create a model whose predictions can be easily explained to them. Otherwise, that 95% prediction accuracy you might achieve is going to be of no use. Answer this third question, and you will know if you need to spend extra time working on the explainability, or you can focus entirely on maximizing accuracy. Answer these 3 questions, and you will understand WHAT the ML problem you need to solve is. 2. Focus on getting more and better data In online courses and Kaggle competitions, the organizers give you all the data. In fact, all participants use the same data and compete against each other on who has the better model. The focus is on models, not on the data. In your job, the exact opposite will happen. Data is the most valuable asset you have that sets apart successful from unsuccessful ML projects. Getting more and better data for your model is the most effective strategy to improve its performance. This means two things: - You need to talk (a lot) with the data engineering guys. They know where each bit of data is. They can help you fetch it and use it to generate useful features for your model. Also, they can build the data ingestion pipelines to add 3rd party data that can increase the performance of the model. Keep a good and healthy relationship, go for a beer once in a while, and your job is going to be easier, much easier. - You need to be fluent in SQL. The most universal language to access data is SQL, so you need to be fluent at it. This is especially true if you work in a less data-evolved environment, like a startup. Knowing SQL lets you quickly build the training data for your models, extend it, fix it, etc. Unless you work in a super-developed tech company (like Facebook, Uber, and similar) with internal feature stores, you will spend a fair amount of time writing SQL. So better be good at it. Machine Learning models are a combination of software (e.g., from a simple logistic regression all the way to a colossal Transformer) and DATA (capital letters, yes). Data is what makes projects successful or not, not models. 3. Structure your code well Photo by Igor Starkov from Pexels. Jupyter notebooks are great to quickly prototype and test ideas. They are great for fast iteration in the development stage. Python is a language designed for fast iterations, and Jupyter notebooks are the perfect match. However, notebooks quickly get crowded and unmanageable. This is not a problem when you train the model once and submit it to a competition or online course. However, when you develop ML solutions in the real world, you need to do more than just training the model once. There are two important aspects that you are missing: - You must deploy your models and make them accessible to the rest of the company. Models that are not easily deployed do not bring value. In the industry, an okay-ish model that can be easily deployed is better than the latest colossal-Transformer that no one knows how to deploy. - You must re-train models to avoid concept drift. Data in the real-world changes over time. Whatever model you train today is going to be obsolete in a few days, weeks, or months (depending on the speed of change of the underlying data). In the industry, an okay-ish model trained with recent data is better than a fantastic model trained with data from the good-old-days. I strongly recommend packaging your Python code from the beginning. I directory structure that works well for me is the following: my-ml-package ├── README.md ├── data │ ├── test.csv │ ├── train.csv │ └── validation.csv ├── models ├── notebooks │ └── my_notebook.ipynb ├── poetry.lock ├── pyproject.toml ├── queries └── src ├── __init__.py ├── inference.py ├── data.py ├── features.py └── train.py Poetry is my favorite packaging tool in Python. With just 3 commands you can generate most of this folder structure. $ poetry new my-ml-package $ cd my-ml-package $ poetry install I like to keep separate directories for the common elements to all ML projects: data, queries, Jupyter notebooks, and serialized models generated by the training script: $ mkdir data queries notebooks models I recommend adding a .gitignore file to exclude data and models from source control, as they contain potentially huge files. When it comes to the source code in src/ I like to keep it simple: data.pyis the script that generates the training data, usually by quering an SQL-type DB. It is very important to have a clean and reproducible way to generate training data, otherwise you will end up wasting time trying to understand data inconsistencies between different training sets. features.pycontains the feature pre-processing and engineering that most models require. This includes things like imputing missing valus, encoding of categorical variables, adding transformations of existing variables, etc. I love to use and recommend scikit-learn dataset transformation API. train.pyis the training script that splits data into train, validation, test sets, and fits an ML model, possibly with hyper-parameter optimization. The final model is saved as an artifact under models/ inference.pyis a Flask or FastAPI app that wraps your model as a REST API. When you structure your code as a Python package your Jupyter notebooks do not contain tons of function declarations. Instead, these are defined inside src and you can load them into the notebook using statements like from src.train import train. More importantly, clear code structure means healthier relationships with the DevOps guy that is helping you and faster releases of your work. Win-win. 4. Avoid deep learning at the beginning Nowadays, we often use the terms Machine Learning and Deep learning as synonyms. But they are not. Especially when you work on real-world projects. Deep Learning models are state-of-the-art (SOTA) in every field of AI nowadays. But you do not need SOTA to solve most business problems. Unless you are dealing with computer vision problems, where Deep Learning is the way to go, please do not use deep learning models from the start. Typically, you start an ML project, you fit your first model, say a logistic regression, and you see the model performance is not good enough to close the project. You think you should try more complex models and neural networks (aka deep learning) are the best candidates. After a bit of googling, you find a Keras/PyTorch code that seems appropriate for your data. You copy and paste it and try to train it with your data. You will fail. Why? Neural networks are not plug-and-play solutions. They are the opposite of that. They have thousands/millions of parameters, and they are so flexible that they are a bit tricky to fit in your first shot. Eventually, if you spend a lot of time, you will make them work, but you will need to invest too much time. There are plenty of out-of-the-box solutions, like the famous XGBoost models, that work like a charm for many problems, especially for tabular data. Try them before you get into the Deep Learning territory. Conclusion The job of a professional ML engineer is more complex than what you will learn in any online course. I would love to help you become one, so if you want to learn more go subscribe to the datamachines newsletter or check out my blog. Original. Reposted with permission. Bio: Pau Labarta Bajo is a mathematician and data scientist with over 10 years of experience crunching numbers and models for different problems, including financial trading, mobile gaming, online shopping, and healthcare. Related:
https://www.kdnuggets.com/2021/09/solve-machine-learning-problems-real-world.html
CC-MAIN-2022-21
en
refinedweb
A newer version of this page is available. Switch to the current version. BreakpointsLayoutBreakpoint Class Provides settings that allows you to specify breakpoints at which the control rearranges its elements if the browser width changes. Namespace: DevExpress.Web Assembly: DevExpress.Web.v20.2.dll Declaration public class BreakpointsLayoutBreakpoint : CollectionItem Public Class BreakpointsLayoutBreakpoint Inherits CollectionItem Related API Members The following members accept/return BreakpointsLayoutBreakpoint objects:
https://docs.devexpress.com/AspNet/DevExpress.Web.BreakpointsLayoutBreakpoint?v=20.2
CC-MAIN-2022-21
en
refinedweb
Mercurial > dropbear view ke _KEX_H_ #define _KEX_H_ #include "includes.h" #include "algo.h" void send_msg_kexinit(); void recv_msg_kexinit(); void send_msg_newkeys(); void recv_msg_newkeys(); void kexfirstinitialise(); void gen_kexdh_vals(mp_int *dh_pub, mp_int *dh_priv); void kexdh_comb_key(mp_int *dh_pub_us, mp_int *dh_priv, mp_int *dh_pub_them, sign_key *hostkey); #ifndef DISABLE_ZLIB int is_compress_trans(); int is_compress_recv(); #endif void recv_msg_kexdh_init(); /* server */ void send_msg_kexdh_init(); /* client */ void recv_msg_kexdh_reply(); /* client */ struct KEXState { unsigned sentkexinit : 1; /*set when we've sent/recv kexinit packet */ unsigned recvkexinit : 1; unsigned them_firstfollows : 1; /* true when first_kex_packet_follows is set */ */ unsigned our_first_follows_matches : 1; time_t lastkextime; /* time of the last kex */ unsigned int datatrans; /* data transmitted since last kex */ unsigned int datarecv; /* data received since last kex */ }; #define MAX_KEXHASHBUF 2000 #endif /* _KEX_H_ */
https://hg.ucc.asn.au/dropbear/file/cd114f427281/kex.h
CC-MAIN-2022-21
en
refinedweb
Custom Arduino Library won't register. 13 views (last 30 days) Show older comments Kevin Gilliam on 5 Feb 2018 Commented: Nicolas Petit on 17 Nov 2021 As the title suggests, I am trying to implement custom libraries with the Arduino support package, but I can't get them to register. I'm using 2017b on Windows 10. Support package is version 17.2.0. I've tried with the three example tutorials (LCD, Ultrasonic, and HelloWorld), and no luck getting them to register. I have definitely added my arduino libraries to the path, along with my working directory that has my package directories and .m files. I've un/re-installed the support packages (in admin mode and not) and no luck. I did the thing they suggest for troubleshooting here Here is my HelloWorld.h file: #include "LibraryBase.h" class HelloWorld : public LibraryBase { public: HelloWorld(MWArduinoClass& a){ libName = "ExampleAddon/HelloWorld"; a.registerLibrary(this); public: void commandHandler(byte cmdID, byte* dataIn, unsigned int payloadSize){ switch (cmdID){ case 0x01:{ byte val [13] = "Hello World"; sendResponseMsg(cmdID, val, 13); break; default:{ // Do nothing And here is my HelloWorld.m: classdef HelloWorld < arduinoio.LibraryBase properties(Access = private, Constant = true) READ_COMMAND = hex2dec('01') end properties(Access = protected, Constant = true) LibraryName = 'ExampleAddon/HelloWorld' DependentLibraries = {} ArduinoLibraryHeaderFiles = {} CppHeaderFile = fullfile(arduinoio.FilePath(mfilename('fullpath')), 'src', 'HelloWorld.h') CppClassName = 'HelloWorld' end methods function obj = HelloWorld(parentObj) obj.Parent = parentObj; obj.Pins = []; end function out = read(obj) cmdID = obj.READ_COMMAND; inputs = []; output = sendCommand(obj, obj.LibraryName, cmdID, inputs); out = char(output); end end end No matter what I try, the end result is always the same: 6×1 cell array {'Adafruit/MotorShieldV2'} {'I2C' } {'RotaryEncoder' } {'SPI' } {'Servo' } {'ShiftRegister' } Any thoughts? Thanks! 1 Comment Madhu Govindarajan on 5 Feb 2018 So when you say you tried the example tutorials LCD one - are you referring to this one here - If so, have you confirmed that when you are adding the files to the path that the subfolders are being included? Are you getting any error messages/warning messages that are suppressed while you are following these tutorials? Accepted Answer Hi Kevin, I know you have tried with the example add-on, but just to confirm it again, can you run the following code in MATLAB where you have the support package installed? >>addpath(fullfile(arduinoio.SPPKGRoot,'arduinoioexamples','SDKExampleHelloWorld')) >>listArduinoLibraries See if you get the HelloWorld addon registered. If not, please contact our Technical Support to get further help. On a side note, you are missing a semicolon at the end of your class definition in the HelloWorld.h file. Each C++ class ends with it. It will cause arduino programming to fail, after the library register issue is solved. Thanks, Menghan MATLAB Hardware Team 3 Comments More Answers (0) See Also Community Treasure Hunt Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
https://nl.mathworks.com/matlabcentral/answers/380764-custom-arduino-library-won-t-register
CC-MAIN-2022-21
en
refinedweb
Details Description It seems like spark inner join is performing a cartesian join in self joining using `joinWith` and an inner join using `join` Snippet: scala> val df = spark.range(0,5) df: org.apache.spark.sql.Dataset[Long] = [id: bigint] scala> df.show +---+ | id| +---+ | 0| | 1| | 2| | 3| | 4| +---+ scala> df.join(df, df("id") === df("id")).count 21/06/04 16:01:39 WARN Column: Constructing trivially true equals predicate, 'id#1649L = id#1649L'. Perhaps you need to use aliases. res21: Long = 5 scala> df.joinWith(df, df("id") === df("id")).count 21/06/04 16:01:47 WARN Column: Constructing trivially true equals predicate, 'id#1649L = id#1649L'. Perhaps you need to use aliases. res22: Long = 25 According to the comment in code source, joinWith is expected to manage this case, right? def joinWith[U](other: Dataset[U], condition: Column, joinType: String): Dataset[(T, U)] = { // Creates a Join node and resolve it first, to get join condition resolved, self-join resolved, // etc. I find it weird that join and joinWith haven't the same behaviour.
https://issues.apache.org/jira/browse/SPARK-35652
CC-MAIN-2022-21
en
refinedweb
consecutiveAverage = arr => { return arr.map((el, ind, array) => { return ((el + (array[ind-1] || 0)) / (1 + !!ind)); }); }; console.log(consecutiveAverage(arr)); The output in the console will be − [ 3, 4, 6, 7.5, 5.5, 4, 6, 5.5, 3, 5, 6, 3, 1.5 ]
https://www.tutorialspoint.com/find-consecutive-elements-average-javascript
CC-MAIN-2022-21
en
refinedweb
ROS1, using ROS2 Bridge to talk to multiple robots I want to talk to different machines over a network and would like to use ROS2 / DDS. Our robots are ROS1 and need to stay that way for now. To solve this I want to use ros1<-->ros1_bridge<-->ros1_bridge<-->ros1 Has anyone tried this to add ros2 / DDS between robots? This is possible, but will require you to have both ROS1 and ROS2 on the robot which can cause some problems especially with sourcing. We have managed to implement the ros1-bridge on a robot running a ROS1 stack with a small ROS2 install next to it. All the ROS1 topics will become available in the ROS2 global data-space. So if you give all robots a 2-way ros1-bridge then they will indeed all see each other topics (assuming you properly set the ROS_DOMAIN_ID values etc.). What will also be very important is namespaces. If you don't properly name topics or don't properly shield topics from being passed to the global dataspace the robots will start publishing on each others topics (you don't want robot 1 to publish a cmd_vel to robot 2 !!!!). Your "question" is not very descriptive so maybe come with a more properly described use-case or ...(more) Thanks you answered my question. I would probably suggest to include multimaster_fkiein such a setup (ie: one per robot), which should include infrastructure to properly deal with some of the "problems" that @MCornelis describes. Then consider the bridge as just that: a bridge or perhaps even a tunnel, and have it only bridge topics that have been configured to be forwarded by multimaster_fkie. Have you tried this and does it have dds qos? The message exchange over the bridge will use ROS 2 infrastructure, so yes, that part will have DDS QoS attached. Everything local to the robots (ie: the robot-local ROS graph) will of course not have DDS involved at all, so no QoS there (but that is probably also not needed). I've not verified how this will interact with ROS 1 service clients blocking, waiting for a response and the bridge failing to deliver the message.
https://answers.ros.org/question/336098/ros1-using-ros2-bridge-to-talk-to-multiple-robots/
CC-MAIN-2022-21
en
refinedweb
ActiveSupport's try does not like Ruby's method_missing Let's say we have the following code in user.rb to help with authorisation: def method_missing(method_name, *args, &block) if action = method_name[/^can_(.*)\?$/, 1] @can_do.include?(action) else super end end And we utilise it like that: if @current_user.try(:can_publish_post?) @post.publish! end Well... This won't work. You see, ActiveSupport's try is sending a public method call to the object it is called on only if the object responds to that method. In other words, if we want method_missing and try to play along nicely we need a little more grease in our user.rb: def respond_to?(method_name, *args, &block) method_name =~ /^can_.*\?$/ or super end This way, our User model will let others know that it can actually respond to @cat.try(:can_i_haz_cheezburger?). PS: this is a post-3.2 rails change, it is only on master right now but I stumbled upon it accidentaly and thought to share. Written by Kostas Karachalios Related protips Ruby On Rails: Using user saved ActiveSupport TimeZone String to fire a job at the users midnight HTTP Posts in Ruby 2 Responses Add your response Nice catch. Anyway, what's the point of using try with dynamic method like this? @rwz try is always useful when there might be a possibility for the object you call a method on, to be nil (the current_user instance variable in my case). When one builds a Rails app, they usually use a ton of gems and it is usually difficult to know whether a method they use is going through a method_missing or it is declared somewhere and thus the object in question can respond to it.
https://coderwall.com/p/so8kig/activesupport-s-try-does-not-like-ruby-s-method_missing
CC-MAIN-2022-21
en
refinedweb
On Fri, Jan 03, 2003 at 03:37:06AM -0700, Eric W. Biederman wrote:> Suparna Bhattacharya <suparna@in.ibm.com> writes:> > > The good news is that it worked for me. Not only that, I have just > > managed to get lkcd to save a dump in memory and then write it out > > to disk after a kexec soft boot ! I haven't tried real panic cases yet > > (which probably won't work rightaway :) ) and have testing and > > tuning to do. But kexec seems to be looking good.> > Nice. Any pointers besides lkcd.sourceforge.netI haven't posted this code to lkcd as yet - so far I'd onlychecked in the preparatory code reshuffle into lkcd cvs. There arestill some things to improve and think about, but am planningto upgrade to the latest tree early next week and put thingsout, and then work on it incrementally.> > For the kexec on panic case there is a little code motion yet to be> done so that no memory allocations need to happen. The big one is> setting up a page table with the reboot code buffer identity mapped.I missed noticing that.Bootimg avoided the allocation at this stage. It did something like this:+static unsigned long get_identity_mapped_page(void)+{+ set_pgd(pgd_offset(current->active_mm, + virt_to_phys(unity_page)), __pgd((_KERNPG_TABLE + _PAGE_PSE + (virt_to_phys(unity_page)&PGDIR_MASK))));+ return (unsigned long)unity_page;+}where unity page is within directly mapped memory (not highmem).> > I am tempted to do the identity mapping of the reboot code buffer in> init_mm, but for starters I will look at how complex it will be to> have a spare mm just sitting around for that purpose. When I get> to dealing with the architectures like the hammer, and the alpha where> you always need page tables I will need to develop an architecture> specific hook for building the page tables needed by the> code residing in the reboot code buffer, (because virtual memory> cannot be disabled), but that should be straight forward.A spare mm may be something which I could use for the crash dumppages mapping possibly simpler than the way it is maintainedright now ... but haven't given enough thought to it yet.> > My goal is to have no locks on the kexec part of the panic path. And> the current memory allocations are the only really bad part of that.OK.> > A dump question. Why doesn't the lkcd stuff use the normal ELF core> dump format? allowing ``gdb vmlinux core'' to work?I guess its ultimately a choice of format, how much processing to do at dump time, vs afterwards prior to analysis, and whetherit captures all aspects relevant for the kind of analysisintended. The lkcd dump format appears to designed in a way that makes it suitable for crash dumping kind of situations. It takes an approach of simplifying work at dump time (desirable). It enables pages to be dumped right away in any order with a header preceding the page dumped, which makes it easier to support extraction of information from truncated dumps. This also makes it easier to do selective dumping and placement of more critical data earlier in the dump.Secondly, it retains the notion of pages being dumped by physical address, with interpretation/conversions from virt-to-phys on analysis being taken care of the analyser or convertor. For examplethere has been work on a post processor that generates a core file from the lkcd dump corresponding to a given task/address space context for analysis via gdb. Similarly there is a capibilityin lcrash that lets one generate a (smaller) selected subset of dumped state from an existing dump, which can be mailed out from a remote site for analysis.The tradeoff is that there is a bit of pre-processing that happensprior to analysis for generation of an index, or conversiondepending on what analysis tool gets used. But that time is lesscrucial than actual dump time.Am cc'ing lkcd-devel on this one - there are experts who canadd to this or answer this question better than I can. RegardsSuparna--
https://lkml.org/lkml/2003/1/3/90
CC-MAIN-2022-21
en
refinedweb
#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/DenseSet.h" #include "llvm/Analysis/EHPersonalities.h" #include "llvm/Analysis/InstructionPrecedenceTracking.h" #include "llvm/IR/PassManager.h" Go to the source code of this file. Contains a collection of routines for determining if a given instruction is guaranteed to execute if a given point in control flow is reached. The most common example is an instruction within a loop being provably executed if we branch to the header of it's containing loop. There are two interfaces available to determine if an instruction is executed once a given point in the control flow is reached: 1) A loop-centric one derived from LoopSafetyInfo. 2) A "must be executed context"-based one implemented in the MustBeExecutedContextExplorer. Please refer to the class comments for more information. Definition in file MustExecute.h.
https://llvm.org/doxygen/MustExecute_8h.html
CC-MAIN-2022-21
en
refinedweb
RationalWiki:Saloon bar/Archive118 Contents - 1 To Train Up a Child - 2 Question for the veggies - 3 Rights of Man - grammar - 4 Spam - 5 Obama the traitor honors mean old indian who killed whites (Fox) - 6 Idea of the decade - 7 Organizing a sports competition that's ostensibly about bringing the peoples of the world together in the spirit of brotherhood and fair competition... - 8 The Great Recession and the death of manufacturing - 9 Should we capitalize "internet?" - 10 What the fuck has Obama done so far? - 11 You're driving down the road late at night... - 12 1421 exposed! - 13 Chillis! - 14 Dear Potheads... - 15 Very Special Epsiode - 16 Job Hunt Update - 17 A request for a favor. - 18 Project Blue beam - 19 Links in long articles - 20 Posting nudity/pornography on other's user talk pages - 21 Priest Church employee. Pedophile. Lather, rinse, repeat. - 22 Richard Dawkins - Beware the Believers (Expelled promo) - 23 Any Haitians in the house? - 24 The poor get poorer and the rich get pumped full of Vitamin C - 25 Yes or No on RW-Tan. - 26 The difference between policy and enforcement (or, crap political arguments) - 27 Crossword help - 28 The evolution of Republicans - 29 General site news - 30 Fat too much time on their hands - 31 Hiding comments in "recent changes" view - 32 News? - 33 Stoned lemurs - 34 All the woo you want - 35 The Conspiracy Files - 36 Something I stumbled upon in my readings of stuff - 37 Hurricane freakin Irene - 38 Gay Nazis - 39 Holy shit, Obama makes a good advisory appointment! - 40 Links to hate sites To Train Up a Child[edit] NZ looks to censor and remove the book from sale which is probably good considering the vicious child abuse problem NZ has (it's often considered NZ's "dark secret") but it puts me in a bit of a position because I don't believe any books should be censored. Thoughts anyone? Abuse? Sexual innuendo? Aceof Spades 23:02, 23 August 2011 (UTC) - You can 'abuse' me... with fuzzy handcuffs. Ah no, but seriously I think it's a fucking great idea. I don't advocate removing the book, more like putting it in the hands of psychologists, therapists, other such people who can read it and understand what sort of people and what sort of trauma they'll be dealing with. It can be a learning tool... just not the kind it was created for. HollowWorld (talk) 23:10, 23 August 2011 (UTC) - EC Not too familiar with the book, and while I'm against censorship, I'm also for appropriate places and times (which is why I don't expect the local library to carry Hustler); what's this book on about that some people think Kiwis shouldn't read it? Also, fuck you, toad. Also, I'm wet for you right now. B♭maj7 So let us be loving, hopeful and optimistic. And we’ll change the world. 23:13, 23 August 2011 (UTC) - It's best to fight lies with the truth, and not censorship.--User:Brxbrx/sig 23:17, 23 August 2011 (UTC) - It advocates raising children the "biblical way". How to administer proper discipline and it has been implicated in a couple of murders. In NZ we have a serious child abuse problem so its not the sort of thing we want on the shelves. But, that said, it shouldn't be banned. Aceof Spades 23:22, 23 August 2011 (UTC) Sounds like banning the book is deflecting attention away from the real issues here. B♭maj7 So let us be loving, hopeful and optimistic. And we’ll change the world. 23:29, 23 August 2011 (UTC) - No it's not that - the book is more seen as "one of things we don't need considering the problem we have". Aceof Spades 23:32, 23 August 2011 (UTC) - I was thinking along the lines of "we have this problem. I know, let's blame this book, instead of addressing social issues." Anyway, yeah, can't see a case for banning it. B♭maj7 So let us be loving, hopeful and optimistic. And we’ll change the world. 23:36, 23 August 2011 (UTC) - Its been a social policy nightmare in NZ for many years. But I am more concerned about AD's beer drinking habits. Aceof Spades 23:41, 23 August 2011 (UTC) - Tui is cheap!--talk 00:23, 24 August 2011 (UTC) - Wouldn't banning the book just make it more legitimate in the eyes of the type of people who would follow the advice within anyway? I mean, it's not like you can *actually* ban a book these days. At the most it'd make it slightly harder to obtain, but in reality it'd just be a symbolic gesture. Within hours there'd be scans/full text of it on the internet. X Stickman (talk) 00:24, 24 August 2011 (UTC) - I do not think it should be banned, because (1) sunlight is the best disinfectant, and (2) I think the book just appeals to the kind of wretch who is inclined to child abuse anyway. ListenerXTalkerX 03:29, 24 August 2011 (UTC) - Bleach is the best disinfectant. I say the book should be bleached. ONE / TALK 08:12, 24 August 2011 (UTC) - Sunlight, bleach, fire, sulfuric acid, are weak dilutions; the surest disinfectant is time. Markedc 64.28.251.41 (talk) 16:04, 25 August 2011 (UTC) Question for the veggies[edit] I have friends coming over on Saturday for a meal, and one is a veggie which means basically all the food (well, bar one dish) will have to be veggie, but I'm struggling for a good indian veggie starter. I thought maybe I could use some of the Quorn fillets and do them tandoori style, but I have no idea if that would actually work or not. Any vegetarians here who use the Quorn fillets often and can tell me if it would work OK? CrundyTalk nerdy to me 14:52, 24 August 2011 (UTC) - Oh, maybe I should learn to JFGI. CrundyTalk nerdy to me 14:58, 24 August 2011 (UTC) - tell 'em to bring sarnies. Pippa (talk) 15:00, 24 August 2011 (UTC) - Veggies get quite arsy if you invite them for dinner and don't throw out every bit of animal-based food in the house, hide all leather clothing / furniture, and stop buggering your cat. CrundyTalk nerdy to me 15:10, 24 August 2011 (UTC) - Not all. Some. But when you do get one like that you really want to just punch them in the face. There are a few I know who were in an uproar about an "abuse of trust" because chips were being fried in the same fryer that some chicken samosas were fried in a few days previously. I mean, get a grip, that's like homeopathic meat. ADK...I'll redeem your centrifuge! 16:49, 24 August 2011 (UTC) - Of course if you use beef dripping in your fryer they may have a valid point. ГенгисRationalWiki GOLD member 17:00, 24 August 2011 (UTC) I think Crundy needs to meet a better class of vegetarian; it's one thing for me to say "no, thanks, I'll just have the salad and some of the rice," which is what I do when in somebody else's home--it's another to rag on somebody for their food choices. The Qurn looks like it might go nice in a tandoori sort of thing, yes. I would eat it. B♭maj7 So let us be loving, hopeful and optimistic. And we’ll change the world. 17:07, 24 August 2011 (UTC) - but I'm struggling for a good indian veggie starter - Crundy needs a better Indian cookbook. I'm a committed carnivore and but I never miss the meat when I'm eating authentic Indian. I mean, apart from veg samosas and Onion Bahjis (sp?) how about some puris with an interesting filling. The choice is nigh on endless. Jack Hughes (talk) 17:51, 24 August 2011 (UTC) - As a vegetarian who loves Indian food (and who's not a dick about it) I have to agree with Jack. At least when eating out I can always find tons of good appetizers. Pakoras or samosas are some of my favorites. DickTurpis (talk) 18:17, 24 August 2011 (UTC) - Veggie here too, we're not evil you know, even the dickish ones are dickish because of their compassion. Not an excuse to be rude, of course, but they're just misguided. FairyCupcake (talk) 23:08, 24 August 2011 (UTC) - I would advise against the Quorn. Most of my veggie friends are divided on fake meat things, with some liking the texture of TVP in food and others reviling the chunkiness of it. I myself don't eat much of any meat substitute things, because it just reminds me of what I'm not eating in all the worst ways. The best veggie patties, to me, are not the ones that try to imitate beef but simply replace it with something different yet delicious in its own way. - That said, Quorn would "work" okay for tandoori, if you do decide to go that route anyway. I have actually had a similar sort of thing at an Indian restaurant, and they also have it at some Loving Hut franchises.--talk 00:01, 25 August 2011 (UTC) - Heh, my friend isn't one of "those" veggies. I was making a joke. It was my decision to make everything as meat free as possible. Re other starters, I dislike onion bhagies, and the mother-in-law never taught me how to make proper "bhajia" (diced mixed veg made up with gram flour and spices and then fried) which are awesome. I do like pakoras, but in general I get banned from any kind of deep frying because tehwife hates the lingering smell. I did think of doing puris, but (1) I can't think of a nice veggie filling, and (2) I'm only used to making "breakfast puri" which are very small and puff up like UFOs. Oh @AD: I'm pretty sure he likes quorn because at a BBQ a few years ago he made a quorn chilli con carne (which was actually really nice). I'll give the quorn a go and report back :) CrundyTalk nerdy to me 08:08, 25 August 2011 (UTC) Rights of Man - grammar[edit] dumb question, but i'm doing one of those "is this plural or singular" issues. The sentence - The old testament is troubling for those who think that the Rights of Man is important. -- even though "rights" is plural, it's a single document, so the copula should be singular, right? En attendant Godot 17:16, 24 August 2011 (UTC) - Go with human rights. Also, it's "are" for both cases.--User:Brxbrx/sig 17:26, 24 August 2011 (UTC) - Rights of Man is a French document (formally, Déclaration des droits de l'Homme et du Citoyen), which is why I used italics in it. And why i said it's a single document. En attendant Godot 17:29, 24 August 2011 (UTC) - If talking about the document it's singular (obviously) if talking about "rights" then it's plural (equally obviously) Pippa (talk) 17:33, 24 August 2011 (UTC) - The Rights of Man is a document about the rights of man which are undeniable. Pippa (talk) 17:38, 24 August 2011 (UTC) - I guess i knew that should be correct, but each time i wrote it, I would change it cause it sounded wrong. I do that with sports teams, too. ;-)En attendant Godot 17:39, 24 August 2011 (UTC) - Yeah, being French, I know at least a little bit about the French Revolution. But why pull this one out? Say human rights. The rights of all humans. This old manifesto ignores women, and human rights encompasses all of its contents anyways.--User:Brxbrx/sig 17:58, 24 August 2011 (UTC) - Sports teams are an exception here, I think -- nobody would say "The Yankees has signed a new pitcher", it sounds silly. Stranger still are teams with a singular noun form like the Miami Heat: "The Heat has won five straight games"? Still odd to me (I prefer "have won"), but better than "The Yankees has won five straight." I think there's a Safire column about this somewhere. --Benod (talk) 18:01, 24 August 2011 (UTC) - Some words are ambiguous or context-dependent though. Words like "headquarters" and "government". Depends on whether you conceptualise them as a group or a unit.--BobSpring is sprung! 18:11, 24 August 2011 (UTC) - Oft-times we omit words which can help sort these things out. When you say "the Rights of Man is important" you are really saying that "the Rights of Man is [an] important [book]" or "the Yankees [team] has won five straight games" but "the Yankees [players] are great sportsmen". ГенгисRationalWiki GOLD member 18:38, 24 August 2011 (UTC) - Yeah, when it ever sounds really wrong, I just add the qualifier. But then it messes with my style. ;-) As for why "The Rights of Man" specifically, cause it is one of the single most ground breaking texts we have, (along with some declarations of independence, maybe some constitutions and bills of rights), etc. that really puts into action, the ideas of Enlightenment. Those ideas, and that set of documents are the first time we are able to point to something and say "human rights matters". Up until then, Human rights was only important if/when someone bothered to care that given day. And why DdH and not the Bill of Rights? It's more expansive, more general and probably more influential world wide.En attendant Godot 18:48, 24 August 2011 (UTC) - GK just made me more confused about sports teams. "The Yankess have won 10 straight games". BUT "The Yankees defines itself as one of the oldest franchises in sports". (maybe you'd only see that if they add the qualifer "itself", but you dont' say "themselves". heh. ah, grammar, how i loathe/love thee.En attendant Godot 18:51, 24 August 2011 (UTC) - At the risk of repeating myself it depends on whether you are conceptualising it (or them) as a unit or a group. Some entities can be conceptualised as one or the other depending on the context.--BobSpring is sprung! 18:58, 24 August 2011 (UTC) - Thinking about the case in question, "The Rights of Man", I'm finding it difficult to think of a context where one wouldn't be referring to the name of the book - in which case it would be singular. As been mentioned above, we would probably say "human rights" if were were speaking about the rights themselves.--BobSpring is sprung! 19:03, 24 August 2011 (UTC) - Rights of Man is a book by Thomas Paine. - Declaration of the Rights of Man and of the Citizen is a document of the French Revolution. - The Rights of Man is a fictional ship, named after the book by Paine, from which Billy Budd was pressed in 1797. - The Rights of Man is a hornpipe in E minor which is the first thing I think of when hearing the phrase "rights of man." Oddly enough, the Fiddler's Companion link leads to some historical perspective on the eponymous book and other contemporary writings. Sprocket J Cogswell (talk) 19:22, 24 August 2011 (UTC) - Then here's the tricky bit, Cogs: how do you refer to these as a group? "The Rights of Mans"?--talk 00:04, 25 August 2011 (UTC) - Why would anyone in their right minds want to refer to such a group? Certainly not me. Rightses of Man? Sprocket J Cogswell (talk) 01:25, 25 August 2011 (UTC) - I just confirmed with a composition postgrad that no possible construction exists. Just a gap in the language because no one ever needs to say it.--talk 04:04, 25 August 2011 (UTC) - There are three books on the table. Three Rights of Mans. I use "peoples" a lot, which makes people think I'm strange... a plural plural, but in teh context of native american peoples, it's correct.En attendant Godot 04:08, 25 August 2011 (UTC) - The difference, I think, is that "people" is the plural of "persons," when it comes to talking about individual humans, but in another sense it is singular when it comes to talking about grouped sets of those humans. The two uses of "people" have a different functional definition: one is a generic group of humans and the other is a specific group of humans organized around a social or political framework. Even further, "peoples" operates on existing and accepted conventions. That's in distinction to the proper noun "Rights of Man", which is a singular label containing both a plural label modified by a singular label, and the various forms of which cannot be easily pluralized under traditional conventions. That's why we have to use italics to make the distinction - Rights of Mans works on a read, but Rights of Mans looks like a different book unless you have already been working through this discussion. Another complication is the audibility factor - we're inclined to write things in a way that is functional when spoken, which is why people who are feeling freed from the 18th century rules on plural possessive are shifting towards "Jesus's" rather than "Jesus'." When I, at least, say "Rights of Mans," I actually say "Rights of Manses," which works even less. That might just be me, of course, but it introduces an additional disconnect to make it difficult to naturally pluralize Rights of Man as Rights of Mans, even if would practically function that way if it was forced. - tl;dr: You can force it but there are reasons no convention dictates a solution.--talk 05:05, 25 August 2011 (UTC) There are some hoops not worth jumping through. In casual speech, nonverbal cues are available if needed. In careful writing, strategic parsimonious circumlocution can help keep it clear. Sprocket J Cogswell (talk) 07:08, 25 August 2011 (UTC) - If you really wanted to force a plural wouldn't it be "Rights of Men"? But the book is not about "man" but (in an age before political correctness) "mankind". - Furthermore, "Rights of Man" is is grammatically equivalent to "Men's Rights" - a concept which now has different meaning. All the more reason to simply refer to "Human rights". --BobSpring is sprung! 08:32, 25 August 2011 (UTC) - There are three books on the table. Three Rights of Mans. Nah, I don't think you can pluralise the name of the book. You would simply say "Three copies of...". Otherwise you get problems: - Three On the Origin of Speciess - Three The Infinite Books - Three A Brief History of Times - I'm not buying it. ONE / TALK 08:50, 25 August 2011 (UTC) - I have no problem with "Rights of Mans" when talking about several editions or copies of the book, yet acknowledge it could confuse someone not up to speed on the context. Pedantic opinion will differ, no doubt. - I would not use that construction in writing, nor in front of someone with a limited grasp of playful English. Sprocket J Cogswell (talk) 14:02, 25 August 2011 (UTC) - Man here is a generic singular . "Rights of men" suggests rights that all men possess collectively, "rights of man" suggests rights that each man possesses individually. I prefer the term human to man, since it is indisputably gender neutral; and while rights of humans sounds right, rights of human sounds a bit odd (makes me think of the rights of User:Human, such as the right to control his own talk page which he has recently been so pettily denied). I think the answer is, that the generic singular is no longer very productive in English, so it sounds fine in set phrases established back when it was productive, but attempting to use it in newer formulations just doesn't sound right. (((Zack Martin)))™ 10:16, 25 August 2011 (UTC) Spam[edit] For the first time ever, I checked my Gmail "Spam" folder. Horrors: Loads of not spam in there including some I'd been waiting for. Pippa (talk) 16:26, 25 August 2011 (UTC) - I pretty much never have anything fall into my junk folder. I also keep an eye on it regularly for the laughs. So many messages pretending to be from Facebook. ADK...I'll model your ax murderer! 16:31, 25 August 2011 (UTC) - Damn, now i'm singing that song.En attendant Godot 16:34, 25 August 2011 (UTC) - Pippa (talk) 16:40, 25 August 2011 (UTC)For the unaware. - Did someone say... spam? HollowWorld (talk) 16:56, 25 August 2011 (UTC) - SPAMSPAMSPAMSPAMSPAMBACON--Dumpling (talk) 17:10, 25 August 2011 (UTC) - Scrapple. The unbusinesslikeman of business 21:14, 25 August 2011 (UTC) Obama the traitor honors mean old indian who killed whites (Fox)[edit] You all know I have a particular tie to things Native, especially Lakota, so this article inflamed me. Please remember, sitting bull was killed during a prayer services. A bunch of old men (all teh young bucks were dead, too dangerous too keep on the rez), women and of course children. Slaughtered at Wounded Knee by an ancient "machine gun" type weapon... that ripped though the camp with devastating power. The Ghost Shirt dancers were praying. Just praying. But fox thinks that attention should not be given to them, or Sitting Bull. --En attendant Godot 03:42, 26 August 2011 (UTC) - eh, what great outrage. what old news. damn you facebook for recycling news and tricking me into thinking they are new articles. evil. (hum, i could of course, just read teh DATE.... but thatwould be silly now).En attendant Godot 03:54, 26 August 2011 (UTC) - "Comments for this page are closed." Heh, indeed. Nebuchadnezzar (talk) 04:07, 26 August 2011 (UTC) Idea of the decade[edit] Via Facebook: If academia fails, I want to open a hairdressers called the Socially Awkward Salon, which will have a sign promising no inane questions or unnecessary talking. There'll be books, comics and maybe even a games console below the mirror. And you could get a hair cut without having to interact with anyone (except to clarify the haircut). Hell, maybe even a poster of various standard hair cuts, like a menu, so you could go "that one". ADK...I'll terrorize your lighting! 13:34, 21 August 2011 (UTC) - What's a haircut? Тytalk 14:57, 21 August 2011 (UTC) - Fucking cutters always asking me questions about my life...--User:Brxbrx/sig 17:13, 21 August 2011 (UTC) Something about... I have no fucking clue[edit] - wow..... you gals and guys are good. - If I may interject at this point..... as I have slowly found myself descending to the bottom of this page I have been - intrinsically enveloped in the wide thought 'pattern's of each person talking. Listening as intently as I could I found myself - sinking ever so deeply into thought ..... I think I found my brain! - As we process the 'qualia' of cause vs effect or experience either physical or emotional sensations, the 'mind' is but the - body/physical brain 'We' use to process all of the 'intricate stuff' that makes up our Universes. Therefore 'We' as the energy, - that is divine/spiritual wasteland of ever-living, ongoing, never-dying space, 'We' guide these experiences/qualia ..... yes??? - Splinter groups of religion after man-made religious folklore ebb and flow across the seas of time, expressing individual ideas - that are of want to be followed, whether or not there may or may not be a truth to that particular idea. Us/We as the One who - exists in this realm of choice drive this body/physical 'vehicle' for lack of a better word/analogy. - But as to tasty ponies, since I could only suppose that the pony would be more tender than a horse, I would only wonder if a - pinto would be sweeter than a mustang, ( oil not included for digestion )..... - Our minds are just that ..... the keeper of the knowledge that 'We' throw into it and hopefully something sticks! ( I really - hope that sometimes )..... - Evil is the product of Abuses..... our bodily illnesses are of the bodies life breakdown and maladies that affect all bodies at - one juncture or another. If 'One' was not brainwashed from childhood with any sort of abuses then the evil that comes from - those abused would therefore not exist, quite literally. As for a 'Goddess/God' (lets be well rounded here and say that you - can't have a female without a male and visa versa ) - Whatever made or created all of this had one thing in mind..... to give - Us something so Beautifully coordinated that when we look up through the universal Eye we can see forever. - And as far as cutting One's hair - I prefer to not even walk near a person trained or not who bears a tool remotely shaped like - a pair of scissors...... for I feel that nothing good could ever come of it ..... So if I were to see something of that type - floating out in cyberspace ..... I personally would hit the delete key and take the train North!!! It just reminds me of that - commercial where a piece of dust lives between the keys of K and L and ends up spending to much time at the Space Bar! - This is a really interesting site. Thanks for letting a Canadian into your lair, it really is very appreciated. Oh, last note: - don't worry - we got your backs up here ..... although I don't know about our feds either at this point - they're not exactly - the brightest lightbulbs in the package. TLOS 10:20, 21 August 2011 (UTC) - I'm sure that was really very witty, but without my Concerta it's just tl;dr--User:Brxbrx/sig 18:36, 21 August 2011 (UTC) - Didn't mean to be..... but what is Concerta??? and does tl;dr mean total drivel??? ..... for in that case..... ok! - and I'm not a hair dresser so I surely won't be asking you questions about your life any time soon either. TLOS 11:51, 21 August 2011 - Concerta is nickname for methylphenidate, a drug taken against the effects of ADHD. "tl:dr" is internet slang for "too long; didn't read". So both together make sense... --★uːʤɱ atheist 19:45, 21 August 2011 (UTC) - Well, sorry but first I wasn't writing it to you - it was to the page - second - if you are refering to a malady of ADHD - from a simple little paragraph written in expose - pretty bad - and third if you've really got nothing nice to say, why - bother writing anything - you don't know who I am and are certainly not in any position to assume - for that just makes an - ass out of you then - doesn't it - I would certainly not assume that you where an ass - that would just make me like you- - something I surely wouldn't want to be - but thank you for your input - I'm sure you had fun writing it. TLOS 1:23, 21 August 2011 - What I was saying is that I'm out of my medication and that makes it a chore to read long posts.--User:Brxbrx/sig 20:33, 21 August 2011 (UTC) - Then please accept my misunderstanding of what you said - I felt as if I'd stepped on toes here and there is no way I - would even consider doing that. I came across this 'community' very accidentally - I was just here to comment on a page I - had come across - and then found myself writing introductory excerpts - sorry for the length - I'm a programmer not a - good writer and this is my first community - I'll do better in future. TLOS 1:42, 21 August 2011 - Hello TLOS, I read your post, I understand what you are saying. Hey, people here love to call me "TLDR" too ("too long didn't read"). Then again, I think yours and my "TLDR" styles are very different. Yours seems much more diffuse, like a painting... mine is sometimes more like hyperrational, hyperdetails oriented, like I'm trying to write out a mathematical theorem in prose... (((Zack Martin)))™ 10:13, 23 August 2011 (UTC) - Everytime I read "tl;dr" without a good excuse (like "have to go to work" or "forgot to take my pills") I assume the peson has lost the debate or at least any interest, But hey, still better than people moaning about your "walls of text" (equally bull) or "rants"... --★uːʤɱ sinner 11:32, 23 August 2011 (UTC) - If you've lost interest, the best thing to do is not respond at all. If you are still interested enough to respond, even if just to say TLDR, you haven't really lost interest. Polite responses include, (1) not responding at all, (2) That sounds interesting, sorry I don't have time to respond to it in full now, but I will later if I get the chance (even if you never get around to doing it, so long as you had some genuine possibility of doing so when you said that, you aren't being impolite or untruthful)... (((Zack Martin)))™ 11:43, 23 August 2011 (UTC) - I'm glad UHM accepts that me running out of my medication is a valid excuse. Me and Maratrean, however, have a score to settle now...--User:Brxbrx/sig 03:28, 24 August 2011 (UTC) - Brxbrx, that wasn't really directed at you. If someone says Too long to read because I haven't taken my ADHD medication, I don't think there is anything impolite about that. Such a statement is too honest about your own limitations for me to consider it impolite. It is those who respond with TLDR in a dismissive tone whom I am addressing. (((Zack Martin)))™ 10:23, 25 August 2011 (UTC) - I have no grudge with you. I was joking. It's hard for me to get that across at times.--User:Brxbrx/sig 20:05, 26 August 2011 (UTC) Organizing a sports competition that's ostensibly about bringing the peoples of the world together in the spirit of brotherhood and fair competition...[edit] ...while a billion of those people are in the middle of a month-long fast. Discuss. B♭maj7 Define "talk." Define "page." 19:48, 21 August 2011 (UTC) - Ramadan moves around quite a bit, the Olympics less so. And as it lasts a month, if you were to pick a random time in the year to do something you have a 1 in 12 chance of doing it when Muslims are fasting. So. Fucking. What. If they want to put religious fasting above the Olympics that would be their problem, not anyone else's. They made a choice, well we assume they made a free informed choice, to follow a religion and actively hold it above absolutely everything else in their lives so they should deal with it. ADK...I'll bescumber your deity of personal preference! 02:23, 22 August 2011 (UTC) - Besides, a billion people are already going hungry for that month, and the month after, and the month after that, and not out of choice or religious compulsion. ADK...I'll voice your rope! 02:26, 22 August 2011 (UTC) - That second argument is weak -- Famine-afflicted states make sure that their athletes (as well as just about everyone living in the cities, food experts call it "urban bias.") As for the first part of your argument, I find it cold. Belief exists. Belief matters to actual, living, breathing people, and dismissing it with a "fuck them" is rarely productive. Moving the Olympics forward by a couple of weeks would have allowed the games to do in deed what they say they're all about. B♭maj7 Define "talk." Define "page." 02:33, 22 August 2011 (UTC) - Unless countries are forcing their athletes to adhere to the fast during the games, it must be regarded as a personal decision on their part; they need to consider whether they believe more in fasting or in winning a medal at the games, then make their decision and face the consequences. ListenerXTalkerX 02:47, 22 August 2011 (UTC) - It's putting people in conflict between two really important values, and it's the organizers thumbing their noses at a billion or so people worldwide, no small number of whom, coincidentally, lived under the colonial rule of the country putting the games on (its the local organizers and not the IOC that fixes the dates). It runs totally contradictory to the values espoused by the Olympic movement (for whatever those are worth) B♭maj7 Define "talk." Define "page." 02:52, 22 August 2011 (UTC) - I assume that the argument that "No season, week, month or day is any more relevant than any other" (as one of our anti-theistic editors put it a while back) would carry no weight with you in this question? - Also, do you know if any of the Muslim countries that are participating in these games, such as Iran, have lodged any complaints about this matter? ListenerXTalkerX 04:00, 22 August 2011 (UTC) - I don't know one way or the other, and maybe therefore, I'm making a tempest in a teapot. I wonder what this guy might say. Amazing how humans can never quite make up their minds, eh? B♭maj7 Define "talk." Define "page." 04:05, 22 August 2011 (UTC) - I am of the "who gives a flying fuck" persuasion. Aceof Spades 04:10, 22 August 2011 (UTC) - There are always other things going on, in the world, in a particular country, and in people's individual lives. What I see from Islamic voices is mostly a fairly moderate position, that it's unfortunate but can't really be helped, the Summer Games is held in the summer, and Ramadan moves so that an overlap is very nearly inevitable in some years (there was literally no way to prevent the 2012 Games overlapping with at least some interpretations of Ramadan, without violating the IOC's rules on timing of the summer games). The requirement to fast is not strong enough to utterly compel a moderate Muslim, a person could argue to himself or herself that representing their country and Islam to the world was of overriding importance, and then fast after they cease competition for the required time. Only the strictest observers would find this unacceptable (the same kind of people who would think the Olympic swimming events were inherently immodest and therefore no Muslim should watch let alone participate - fundies are killjoys everywhere). 82.69.171.94 (talk) 15:24, 22 August 2011 (UTC) - Also I saw some quite positive thinking, suggesting that the inconvenience itself is a positive attribute, that Muslims benefit from living in societies that tolerate their belief but don't rearrange everything to make it as convenient as possible (as almost inevitably happens in a majority Muslim country, secular state or not). The idea here will be familiar to Jews of a certain stripe, that confronting obstacles that are unique to your religion reminds you how important your religion is, and not to take it for granted. Ramadan doesn't make competition impossible just more difficult. 82.69.171.94 (talk) 15:33, 22 August 2011 (UTC) - This has been an issue that Muslim sports men and women have had to deal with for ages. Some footballers take a pragmatic approach to fasting, in that they'll eat normally the day before and on a match day and then make up the fasting time at a later date. See here. Bondurant (talk) 12:40, 23 August 2011 (UTC) - Cold? Really? It's plain fact. We could bung the Olympics at any point in the year and have a 1 in 12 chance of bumping into Ramadan. The world doesn't stop for a month just because some religion demands people stop eating. The Earth turns, the sun fuses hydrogen, and people still eat, excrete and watch TV. The universe is in the same camp as Ace here, it doesn't give a flying fuck. Adhering to a religion is a personal choice. Millions of people go out each Friday night after work, get absolutely slammed and wake up on a Saturday afternoon with a mental hangover, should we move the Olympics away from the weekend so those people also have a chance to compete without it conflicting with their personal choices, desires and traditions? No. That would be crazy. But because it's religion it's suddenly special and magical and we can't even take a dump without offending one of them. To put it in polite terms: Fuck. That. Shit. ADK...I'll graphitize your equestrian! 13:36, 23 August 2011 (UTC) - Sorry, made a miscalculation there, as the complaint is that the Olympics is oraganised in the weeks after Ramadan rather than during it, it's actually closer to 1 in 10 or 1 in 9 chance of it clashing, not 1 in 12. ADK...I'll bescumber your embryo! 13:39, 23 August 2011 (UTC) Would it be utterly tasteless to suggest that in light of their judicial dismembering the likes of Saudi Arabia could send a team to the Paralympics which are post Ramadan? Also it should not be forgotten that Eric Liddell did not run in his best event at the 1924 Olympics because as a devout Christian he refused to race on a Sunday. ГенгисRationalWiki GOLD member 16:19, 23 August 2011 (UTC) - Seems to me like looking for reasons to be offended. If you don't like the rules, don't play the game. See also Johnathon Edwards who refused to jump on Sundays. (He's now atheist) Pippa (talk) 16:36, 23 August 2011 (UTC) - Given that Muslims are involved, this could become an explosive controversy LOL! 74.89.192.173 (talk) 03:30, 26 August 2011 (UTC) - Doesn't 'LOL' mean something is supposed to be funny? AMassiveGay (talk) 03:42, 26 August 2011 (UTC) - Yeah, it does, and it IS funny, at least, in my opinion. And the opinions of some of my friends, who love these kinds of politically-incorrect jokes. 74.89.192.173 (talk) 16:04, 26 August 2011 (UTC) The Great Recession and the death of manufacturing[edit] I came across this IMF paper recently, which ties together income inequality, debt, and financial instability. It's an interesting analysis of the spike in all three that occurred in the 1920s and 2000s. Another similarity not mentioned in the paper is the erosion of the economic base over these periods -- in the 1920s it was agriculture that was wiped out (and even more so in the '30s) and manufacturing in the 2000s (as well as years prior). Interesting to speculate that there may be a single underlying cause of these economic disasters, but it's always best to remember Mencken's words: "For every complex problem, there is an answer that is clear, simple--and wrong." Nebuchadnezzar (talk) 21:15, 23 August 2011 (UTC) - These industries aren't dead, they were just relegated to developing and undeveloped nations. Faced with unions and the labor rights movement in general, the bourgeoisie simply moved the proletariat to places where they weren't organized. Now, the US and other developed countries are mostly just masses of petit bourgeois unaware or uncaring of the fact that while they enjoy their easy lives the very shirts of off their back were made under grueling conditions by foreign laborers that can only be thankful for the few dollars a week they make, because protesting the miserable conditions would simply mean that production would move to another location free from regulation or labor syndicates. The classes are still quite real, we just don't see it because the lower classes are far away and out of sight.--User:Brxbrx/sig 21:37, 23 August 2011 (UTC) - And our rivers get less of the dyestuff and other nastiness, while the airborne pollution has a chance to spread out or precipitate before it reaches our shores. Even less reason to keep the EPA bureaucracy in business. I remember the eighties, when the suits got all breathless about the service economy. Yeah, right, we can all make our living by shining one another's shoes. Sprocket J Cogswell (talk) 22:00, 23 August 2011 (UTC) - Well it doesn't matter that our rivers get less dye stuff because we're going to be shoving a giant fucking oil pipeline through, from the tar sands in Alberta to the Gulf of Mexico... which is apparently bad news for the environment. Who knew? HollowWorld (talk) 22:08, 23 August 2011 (UTC) - I should have added the qualifier "American." Globalization is one reason for the erosion of manufacturing, though I imagine technology played a role as well. And both of these changes coincide with a shift in business cycle and employment trends. Nebuchadnezzar (talk) 22:19, 23 August 2011 (UTC) - Will there ever be a time when even the robots are getting laid off? It's hard to get a job where I live, because employers are firing, or 'hardening up' by keeping the employees they have now. Apparently, everyone here thinks we're at the tip of a roller coaster and we're about to plummet hard. HollowWorld (talk) 22:24, 23 August 2011 (UTC) - This is the future! Nebuchadnezzar (talk) 22:39, 23 August 2011 (UTC) - Offshoring has played some role in "de-industrialization," but automation has made the remaining industry much less visible. I read somewhere that Sheffield is now producing more steel than at any other time in its history, except that the industry is now automated, so large numbers of steel workers are not needed anymore. ListenerXTalkerX 03:32, 24 August 2011 (UTC) - Yup. The problem is that automation destroys the low skill / low responsibility jobs because those are the jobs we most readily get machines to do. The economics works out OK (socialism lets you re-arrange the numbers so that some of the benefits of the automation are siphoned off to feed, house and clothe those whose jobs were destroyed) but the psychology is tricky. We have been teaching people that working for a living is a virtue for a long time. If all the jobs a particular person can do no longer exist, how are they to achieve this virtue? In my informal surveys although a fair number of people had no trouble with the idea of spending the rest of their life living modestly with no fear of poverty but no job, many more felt they would have to have some kind of job to give structure to their lives. There is definitely potential for violence as a society tries to adjust to permanent low employment -- both from those who want jobs and don't have them, and from those who have jobs and resent the fact that other people live comfortably without -- and it is perhaps for this reason that governments around the world have tried hard since the industrial revolution to keep people employed. 82.69.171.94 (talk) 13:37, 24 August 2011 (UTC) - I doubt we will ever run out of work to do. --145.94.77.43 (talk) 22:58, 25 August 2011 (UTC) - We don't have to run out of work, we just have to run out of work that some people can do. For every firefighter, tax accountant and train driver, there are hundreds of people filling sandwiches and sewing T-shirts. One day a robot derived from work on Robocup Rescue might replace one firefighter per shift, the government might simplify tax regulations, and a few more of the world's railways might switch to driverless operation, but meanwhile all the sandwich fillers can lose their jobs in a single day when a machine does their job for half the money. The sandwich fillers probably don't have the physical stamina of the firefighter, the head for figures of the accountant, or the ability to work alone and low risk health record of the train driver so they won't be competing for any of those jobs, that's why they became sandwich fillers in the first place. 82.69.171.94 (talk) 08:22, 26 August 2011 (UTC) Should we capitalize "internet?"[edit] A number of publications do not capitalize the noun "internet." I personally think the word's headed for common noun usage. Blue Talk 00:25, 24 August 2011 (UTC) - Are you volunteering to go through the wiki and make our usage consistent? B♭maj7 So let us be loving, hopeful and optimistic. And we’ll change the world. 00:27, 24 August 2011 (UTC) - No, by the royal "we" I meant humanity in general, not RationalWiki. Blue Talk 00:28, 24 August 2011 (UTC) - No more than we capitalise or even hyphenate email nowadays, in my opinion. E-Mail just looks weird now. X Stickman (talk) 00:30, 24 August 2011 (UTC) - An internet is a network of networks. The Internet is one particular internet, built on the TCP/IP protocol suite. The Internet is getting close to being the only internet, although arguably historically some other networks have qualified, such as the global X.25 network. - I would expect in the future, with space colonisation, the current TCP/IP Internet will fragment into many separate TCP/IP internets, since the protocols that are optimal for intraplanetary use are highly non-optimal for interplanetary and interstellar use, although then I'd expect we'll probably have an interplanetary/interstellar DTN internet of TCP/IP internets. - In conclusion the Internet is an internet, and is only one of many internets past, present and future, although it is close to being the only internet right now. (((Zack Martin)))™ 00:32, 24 August 2011 (UTC) - Your conclusion there is a good summary of it, I agree. Generally speaking, either Internet or internet is acceptable for those reasons.--talk 02:18, 24 August 2011 (UTC) - Uh, right; similarly, the Norwegian Nazi collaborator's name may be scribed "Vidkun quisling." ListenerXTalkerX 03:26, 24 August 2011 (UTC) - A proper noun used to refer to that person is rather a different matter. As you probably see, it introduces confusion about the referent - "Are we speaking of the generic quisling or the actual Quisling or some hybrid?" - which is the opposite of what communication is intended to do. In contrast, the near-complete identification of the mega-internet that is the Internet with the term itself is more of a form of a "generic trademark": a specific example that comes to stand for the whole set because of its ubiquity, like xerox or kleenex. So when you say "internet" you almost always mean "Internet," and that's understood.--talk 03:42, 24 August 2011 (UTC) - An internet, the Internet. The latter refers to a unique entity, hence is a proper noun and should be capitalized. The analogies with genericized trademarks are invalid, since there is more than one photostatic copier and more than one facial tissue. ListenerXTalkerX 03:52, 24 August 2011 (UTC) - There is more than one Internet, as well. My school's Student Internet is a link of local computers networked together. But no one calls it the Internet or even internet, really, because that word has been so thoroughly generalized. - I'm not a proscriptivist, so I don't hold much with the idea of rules in English. I do agree that formal use should probably prefer Internet, but functionally they are identical and both correct.--talk 04:17, 24 August 2011 (UTC) - I think your school's network is technically an "intranet." - I grew much more enthusiastic in my prescriptivism after a couple of semesters grading student homework. You could tell the foreigners apart from the Americans in that the former wrote legible English and the latter, well-stuffed with descriptivist dreck, often did not. ListenerXTalkerX 04:31, 24 August 2011 (UTC) - I was thinking, of what other internets are there, or have there been, other than the TCP/IP Internet we all know and love. The global Signaling System 7 network (also known as the public telephone system) is arguably an internet (a global network of networks), although due to VoIP and other factors it is slowly merging into the TCP/IP Internet. Past examples of internets would include FidoNet, BitNet, UUCPnet, and I've already mentioned X.25. Other possible present day examples of internets include the global AMHS system used for international communication between air traffic control authorities, and MMHS networks used for communication between allied military forces (including NATO). The later two are interesting, as being networks which for security reasons are kept quite separate from the public Internet, whether or not they are running on TCP/IP. (They are both X.400 email systems, so they could run either over the TCP/IP or OSI TP stacks, not sure what they use in practice, I suspect quite possibly a combination of both.) (((Zack Martin)))™ 04:38, 24 August 2011 (UTC) - I never realised it was supposed to be capitalised until a spell checker started shouting at me for it. Generally I think it's a bit "meh". ADK...I'll forsake your flagella! 16:44, 24 August 2011 (UTC) - Gonna have to agree. I honestly don't give a shit. If that makes me a bad person, I don't give a shit about that either. ONE / TALK 09:05, 25 August 2011 (UTC) - Military networks are separate from "the" Internet, but use TCP/IP. Their IPv4 version used part of the public address space, as they are far too large to use RFC1918. Most of the telephone network, including the higher layers of SS7, run over TCP/IP (e.g., IETF SIGTRAN). Howard C. Berkowitz (talk) 01:59, 27 August 2011 (UTC) - Yes. TCP/IP military networks are a TCP/IP internet, separate from the TCP/IP Internet. Most SS7 now may well be over SIGTRAN, but that is a relatively recent development, for a long time most of the global SS7 internet did not run on top of TCP/IP. And, most current X.400 email systems (i.e. MMHS and AMHS) probably are running over TCP/IP, but I would expect many of them would have run over OSI TP instead originally. (((Zack Martin)))™ 02:02, 27 August 2011 (UTC) What the fuck has Obama done so far?[edit] What the fuck has Obama done so far? Dan Savage posted this. Too bad the expletive means you can't link to it in a bunch of places. Of course, I still don't like the president, he's black he promised change but I see nothing but politics. He supported DOMA, FFS!--User:Brxbrx/sig 22:25, 24 August 2011 (UTC) - An interesting counter-point--User:Brxbrx/sig 22:26, 24 August 2011 (UTC) - I don't care, primary his ass! ARGLE BARGLE /Firebagger Nebuchadnezzar (talk) 22:50, 24 August 2011 (UTC) - Wat?--User:Brxbrx/sig 23:15, 24 August 2011 (UTC) - 47 positive things, according to the first website. I'm still meh towards him. Тytalk 23:19, 24 August 2011 (UTC) - See here. I'm still pretty much on the Firebagger side, but the whole "Primary Obama!" and the Hamsher-Norquist thing are just fucking idiotic. Nebuchadnezzar (talk) 23:28, 24 August 2011 (UTC) - Yeah, I'm far left of Obama, who is a moderate conservative, but even I recognize that it's about getting the best possible President in a practical sense, and that shouldn't be sacrificed to some hypothetical perfect candidate. Of the possibilities, Obama really is the best - the best just doesn't happen to be very good because it continues the extension of executive power and the security state, and only half-heartedly fights Austrian economic nonsense and the Judeo-Christian dominionist crowd.--talk 23:54, 24 August 2011 (UTC) - Ah, you see, that's the brilliance of the Democrats -- get elected, ignore your base, then come next election, point to the GOP candidate and go "Look, do you want this batshit crazy wingnut instead?!" Wash, rinse, repeat. It helps even more now that the 'baggers will essentially primary out all the "RINOs." Also, even the wingnuts aren't insane enough for the Austrian school stuff except for a few, and crediting them with having any knowledge of economic theory is probably giving them too much credit. Nebuchadnezzar (talk) 00:46, 25 August 2011 (UTC) - He is blackstill collects taxes, therefore he is a douche. That's all his opponents will be thinking. Balls to what actual stuff he has managed to get through the fragmented clusterfuck that passes for government in the US. ADK...I'll admonish your noseblower! 12:27, 25 August 2011 (UTC) - I really don't think Obama is the problem here. If he had the majorities he would do great things for America - the thing is he doesn't. And so all he can do is push has hard as he can, whch considering that he has batshit insane opponents that would go so far to shut the whole country down and then blame it on him. I mean the whole debt seiling deal made it pretty clear, you have wingnuts that make up half of the other party pushing for less spending and being basically completely unreasonable in their demands, on the other side you have a guy who really isn't an agenda pusher and neither is he equally insane. I think if I would be in his position I would have long ago quit office and tell America they can fuck up their own country if they insist so much. The man is basically caught between a rock and hard place, so even if I'm much much more left then he is (hell I'm left wing in Europe, they'd probably call me a radical socialist in the US), I try to go easy on the guy because he didn't actively create these insane idiotsthe other side. - I think the only thing that could help right now is a huge propaganda deal of the progressives using the same style as the Teabaggers, forcing the Teabaggers to go completely off track - basically trying to turn the othe side into raving lunatics that even in the midwest loose all grounds, until the left wing of the Republicans either splits up or strikes out their Rs and change into Ds - which would resonate in the Republicans splitting their base and the Democrats winning elections because the other side isn't in any form for contest. But then again, that isn't the style of liberals. So basically, the guy is fucked no matter what he does. --★uːʤɱ constructivist 13:57, 25 August 2011 (UTC) - I love obama, cause i love smart, sharp people. so understand that when I say this, it's while sobbing in my cereal. He HAD the majority, for 2 years. and the party (and i too do not blame obama, i blame all of them) acted like pussies, just wallowing in their own incompetence over simple disagreements. And they wouldn't do anything if they did not have 60% and they were SO FUCKING SCARED of the voters. The republicans do something that I both despise and admire. they say, plain and simple "vote with us, or get the fuck out cause we will spend every time we have replacing your sorry ass". they threaten within their own party, and end up with a line that is all but lock step. (a few too-powerful-to-remove descenters like Olympia Snow are still in the Senate). We need to learn to do that. but we like to be so inclusive and all. ;-)En attendant Godot 14:39, 25 August 2011 (UTC) - They had the majority, but also staggering levels of obstructionism that continue today. Despite that, they passed the Affordable Care Act, which alone makes him the most successful recent Democratic president. It's not a perfect bill, but it is pretty great and provides a good foundation for later further reforms once it (hopefully!) starts to see real results in 2014 and 2015.--talk 13:01, 26 August 2011 (UTC) - In reference to the OP, that site has a link to a clean version, if you want to link to it somewhere with profanity restrictions. άλφαTalk 12:42, 26 August 2011 (UTC) You're driving down the road late at night...[edit] what would be the scariest thing to see on the side of the road? An alien, a guy in a hockey mask, or a clown?--Thanatos (talk) 05:18, 25 August 2011 (UTC) - Ed Poor. ГенгисRationalWiki GOLD member 06:46, 25 August 2011 (UTC) - - We need a description of the alien.--BobSpring is sprung! 06:58, 25 August 2011 (UTC) - I agree with Bob, it depends on the alien. The other two I can likely take.The unbusinesslikeman of business 21:12, 25 August 2011 (UTC) - If it's a proper Stanisław Lem alien it's going to be totally incomprehensible. Like, maybe there are forty things that look like cat-sized floating pyramids, and they're painstakingly disassembling a tree into component atoms. As you slow down, six of them float over to you, project a holographic image that vaguely resembles an octopus, dematerialise the car stereo and your glasses, then vanish. If it's not stranger than any dream you've ever had, it's not a proper alien. The Clown and Mr Hockey Mask are just people, whatever they do is at least going to be largely consistent with your previous understanding of the world. 82.69.171.94 (talk) 07:54, 26 August 2011 (UTC) - Well, there have been attractive aliens out there. Osaka Sun (talk) 06:20, 27 August 2011 (UTC) 1421 exposed![edit] For anyone interested in Chinese history, I just happened to come across this site. Apparently some crank is claiming that China discovered the entire world in 1421. Nebuchadnezzar (talk) 07:09, 25 August 2011 (UTC) - "For anyone interested in Chinese history"... uh, I think maybe the Chinese would be interested in Chinese history! There's 1.3 billion of them and they have thousands of years of history behind them! Or don't you think they're smart enough to be interested in history? Are those Asians getting out of control and too uppity for you? Maybe they should go back to work building railroads? You are so racist. - This unjust accusation has been brought to you by the Department of Irrational Offense-Taking.--talk 08:58, 25 August 2011 (UTC) - That's really old news. No offense, nebby.--User:Brxbrx/sig 15:36, 25 August 2011 (UTC) - I must confess, however, that both books were a fairly interesting read, in a Fingerprints of the Gods way. --PsyGremlinSermā! 15:42, 25 August 2011 (UTC) - I remember reading about 1421 in a Chinese history class I took in secondary school, and my teacher was partly "this would be really cool if it were actually true!" but mostly "this is a load of crap, but it just goes to show you that anyone can make up/distort evidence." άλφαTalk 12:44, 26 August 2011 (UTC) Chillis![edit] Huzah! It's that time of the year again where I buy extremely hot chillis and get my arsehole burnt off. May consider sending seeds if anyone's interested? CrundyTalk nerdy to me 12:51, 25 August 2011 (UTC) - Arsehole seeds sound terrible.--talk 12:56, 25 August 2011 (UTC) - We're running short of arseholes here so it would be productive to grow a few more. I'm slightly concerned that in 2 out of my 3 latest SB posts the conversation has been more about my arse than the topic in hand :-\ CrundyTalk nerdy to me 13:03, 25 August 2011 (UTC) - Dorset Nagas at the bottom? What is it with you? BTW my own nagas from the seeds you sent me are pretty pathetic after 2 months of neglect because I was stuck on a coral reef in the middle of the Timor Sea and have only just got home. ГенгисRationalWiki GOLD member 13:31, 25 August 2011 (UTC) - Nagas are pretty hard to grow. They seem to be obsessed with getting as tall as possible rather than making good chillis. CrundyTalk nerdy to me 14:00, 25 August 2011 (UTC) - As a Jalapeño/Cayenne farmer, I'd love some seeds, I need something spicier. The unbusinesslikeman of business 21:13, 25 August 2011 (UTC) - OK, I'll start drying some seeds out. CrundyTalk nerdy to me 08:11, 26 August 2011 (UTC) Dear Potheads...[edit] Please report to your friendly local police station.... we need your help, we really do... to solve a murder.... Trust us! Yours Sincerely, Your Friends at Victoria Police. (((Zack Martin)))™ 13:37, 25 August 2011 (UTC) - It's a trap! CrundyTalk nerdy to me 07:58, 26 August 2011 (UTC) Very Special Epsiode[edit] I tucked this comment into the "moral panic" talk page, - but who knows if you all read the talk pages. heh. anyhow, do we have a page about "A Very Special Episode" under a different title? I linked to a non page, making a dreaded redline, and before i pull the link, i wanted to make sure it's not that I just mis-remembered what "a very special episode" meme is really called.En attendant Godot 16:25, 25 August 2011 (UTC) - It's the proper phrase from what I can gather [1] [2]. Any particular reason you need it? ADK...I'll toast your guru! 16:27, 25 August 2011 (UTC) - Don't know of it here (UK) but I don't watch much telly. Pippa (talk) 16:33, 25 August 2011 (UTC) - I'm trying to decide if i care to write it or not. (I loath stubs more than I loath redlines), but in effect it was this tagline added to mostly comedy 1/2 type shows (family focus shows) that dealt with "serious" topics. I remember it most from Different strokes when the littlest boy was approached by a (yes, gay) man with the intent of "touching" him. Before the show started, this deep, serious and grave voice announces "Tonight's Espiode of Different strokes is a very special episode." hence the name of the meme. All the shows did it in that era. Different strokes, Facts of life, Family Ties, etc. Drinking and driving, drugs, aggressive dates (never got as far as rape or anything, but you know, he pushed you and touched your boobie, or something).En attendant Godot 16:38, 25 August 2011 (UTC) - Totally out of fashion now. Thank fuck. ADK...I'll subvocalise your Honda! 17:34, 26 August 2011 (UTC) Job Hunt Update[edit] So far, so good. Three phone interviews so far, one has led to a definite in person interview next Monday. (That could get postponed, because some of the people have property that's in the path of Hurricane Irene.) With another one, the recruiter said there would be an in person interview, but two of the people I'd interview with are on vacation, so she's setting up another phone interview with one of their engineers. There's a third that's probably my favorite. The phone interview went very well. I'm still waiting to hear about a face-to-face for that one. This one is a little more difficult because I was contacted by a talent search company, not by the employer themselves. My suspicion is that it would probably be the lowest salary, but the commute is the best, and their 401K match... the term I've used for it is "jaw-dropping." (It's a financial services company. Which leads to another plus -- for the first time in my entire professional career, I would not be doing government work.) MDB (talk) 16:53, 25 August 2011 (UTC) - Excellent. En attendant Godot 21:27, 25 August 2011 (UTC) - Financial services doesn't have anything to do with mortgage-backed securities, does it? Anyway, good luck. Nebuchadnezzar (talk) 04:08, 26 August 2011 (UTC) - This is a large, diversified company, and one that seems to have come through the turmoil. I'd be in their data center anyway, not doing financial work myself. MDB (talk) 10:18, 26 August 2011 (UTC) A request for a favor.[edit] One of the facebook pages I am subscribed to posted a link to a MotherJones.com article titled something along the lines of "The Greatest 110 Words About Dick Cheney, Ever" or something like that. However, I can't even access MotherJones.com for some reason. Would someone please copy and paste the article into an e-mail and send it to me? THe comments on the post have me intrigued as all hell. Thanks in advance. The Foxhole Atheist (talk) 10:34, 26 August 2011 (UTC) - If. - Thanks, One. The Foxhole Atheist (talk) 10:48, 26 August 2011 (UTC) Project Blue beam[edit] Found this while rooting round the web. " This RationalWiki article has itself been redigested into a Romanian Wikipedia article (translation), which was translated back for English Wikipedia and then deleted.". Interest? Pippa (talk) 17:29, 26 August 2011 (UTC) - ??? Someone reposted one of our articles on a crank site? Nebuchadnezzar (talk) 17:31, 26 August 2011 (UTC) - Creative Commons, what can you do? But really, it looks like a spam blog to me. Things get copy/pasted by bots to try and link farm to other places for whatever purposes they want. You find all sorts of random stuff copied to them that it barely makes any sense. ADK...I'll wash your Suzuki! 17:37, 26 August 2011 (UTC) Links in long articles[edit] If i'm editing a long article, with lots of initial content links at the top, i tend to make linkable references several times in an article. ie., if a page on gay rights had 5 longish content (edit) sections, I will make "marriage" linkable the first time it's cited, but also one or two other times near the end of the article. To me, it seems more rational, but i wanted to make sure i wasn't stepping on toes doing it.En attendant Godot 19:05, 26 August 2011 (UTC) - I must admit that repeated wikilinks of common terms (like "marriage!) irk me. I'd tend to stick them all in the "see also" at the end,if at all. Pippa (talk) 19:10, 26 August 2011 (UTC) - You mean from article to article, or just in one article? And i admit that where i do this most is on Wiki, when talking a techinical issue about native americans, like a link to Wavoka or Paiute, where people actually say "what is that" or "who is that person", rather than links to "gay" or "marriage". but the habbit sticks. ;-)--En attendant Godot 19:16, 26 August 2011 (UTC) - I hate having to hunt down the first mention of something in long articles on WP just so I can click it. It's okay for common terms, but for more obscure stuff it should probably be linked more than once. -- Nx / talk 19:21, 26 August 2011 (UTC) - If the article has subsections which are directly linked to from elsewhere, then yeah. Otherwise, no. Occasionaluse (talk) 19:23, 26 August 2011 (UTC) - NX, me too. when i'm editing WP, i make sure that any somewhat obsure reference is lined in any sub "edit" section. (I don't know the technical name for it). the other reason i do this is a cop out. I edit by clicking on that sub section, and really have no idea if I'm using a word that has or has not been used before, so i wikilink it anyhow. Here, not as much, cause it's not generally as technical (or rather, where it's technical we are not likely to have an article and that's ok) and our sub sections are not as long. but yeah, i hate reading something I'm not well educated in (oh, the history of boullibase) and finding some ingredient i've never heard of, and having to look it up higher on the page.En attendant Godot 19:29, 26 August 2011 (UTC) - Is the policy there to link the first mention in each section, or am I imagining that? People there also seem to adhere to rigid protocols at times when it comes to things like that. Really common words shouldn't be linked, such as "time", so people will remove such links even when the article is on some time-related concept, apparently believing that policy dictates the time article should be an orphan, which is ridiculous. DickTurpis (talk) 19:31, 26 August 2011 (UTC) - MOS: "Link the first time a term is used (unless it's in a header), not every time." Pippa (talk) 19:34, 26 August 2011 (UTC) - That is a rule I see lightly enforced at WP. I have probably been guilty myself once or twice, but I do it with my eyes open. If it is in long article and the previous link was more than a pageUp away, I am willing to link it again. In this case, being considerate to the reader trumps rigid sticking to rules. Sprocket J Cogswell (talk) 21:16, 26 August 2011 (UTC) - The more complete WP becomes as an encyclopedia, the less well it is served by conventional hyperlinks internally. Before the web came along and distorted everybody's idea of how to do hypermedia, it was very common for hypermedia systems to provide so-called "generic links" where the user can select any arbitrary thing and get links to related material. So you see that WP's entry for "King Arthur" mentions something about "knights" and you can select that and get a dictionary definition of the word 'knight' or the WP article on knights without some editor having to manually specify this for that particular instance of that particular word. Sadly the web doesn't really provide generic links, and attempts to retro-fit them have met with little success. In the early days of WP this was good because manually authoring links causes "red links" that helped editors find useful work to do. But today the red links are mostly for nonsense, or the most obscure things possible e.g. "Popularity of beverages in Southern Australia" and so generic links would be way better. 82.69.171.94 (talk) 21:54, 26 August 2011 (UTC) - Do I understand you? Generic unfiltered ambiguous links are not what I go to Wikipedia looking for. I go to WP looking for information and hyperlinks that have been selected as relevant and useful, selected by a crowd of editors who, for the most part, are knowledgeable enough about their subject to choose relevant reliable sources. The process is transparent enough that sources of bias are mostly visible, and most silliness is swiftly reverted. The manual specification of the appropriate link for each instance of a particular word, taken in context, is the value that crowd adds, and I am not sure I would want it any other way. Sprocket J Cogswell (talk) 00:34, 27 August 2011 (UTC) - I'm not sure, did you miss the word internally in what I wrote I above? Because what you're describing sounds like it might be useful or relevant for external links, but I don't think it's really "value that crowd adds" within Wikipedia itself. Sure, a generic link isn't going to pick up the fact that "All Tomorrow's Parties" in one context is a reference to the song, in another context it's a reference to the festival. But situations where that's a major problem are the exception rather than the rule, in the ATP case they're a disambiguation page away and nothing stops WP from still having manually authored links, just they shouldn't be the burden they are now. 82.69.171.94 (talk) 05:45, 27 August 2011 (UTC) - Yes, I meant internal links as well. (By the way, in the ATP example, there is also Gibson's 1999 novel, the last one in the Bridge trilogy.) I watch slightly fewer than two thousand pages on WP, and a fair bit of my minor editing has to do with targeting wikilinks more accurately, in aid of building the web. Based on that experience, I cannot agree that "situations where that's a major problem are the exception rather than the rule." A "disambiguation page away" is still a miss, in my estimation. Worse cases happen with words like "property," where describing something as a physical property can link to an article on real estate. - Manual linking more burdensome than generic? I think you are greatly underestimating the magnitude of the task of vetting and fixing an encyclopedia's worth of inaccurately targeted machine-generated links. Smartening up the link-generating algorithm to a usable standard would be even more Sisyphean. - In the WP context, I still prefer hyper-links selected for usefulness by human editors. Sprocket J Cogswell (talk) 13:30, 27 August 2011 (UTC) Posting nudity/pornography on other's user talk pages[edit] Seriously, I can't be the only one here that finds this objectionable. If people want to see that stuff, they can post it on their own talk page all they want. But, putting it on another user's talk page, when you know they don't want to see it there, surely others would object to this. I am particularly interested to hear the opinions of our female editors, since I suspect many of them may have a somewhat different perspective on this issue from what many of our male editors do. (((Zack Martin)))™ 11:32, 27 August 2011 (UTC) - If you KNOW that the other editor doesn't want it there it's harassment. If it happened to me I'd just remove it and block the other editor for 5 minutes to send the message. Rinse and repeat until HCM. Senator Harrison (talk) 12:33, 27 August 2011 (UTC) - I personally don't find it offensive, but if a user says he or she finds it offensive and the other user doesn't stop it - it's trolling. I would only delete hardcore pornography from my pages, but that's me. --★uːʤɱ soviet 12:45, 27 August 2011 (UTC) - The images are not displayed by default, they are turned into links (which now have warnings), you have to either click the link or enable display of filtered images. Both of those actions count as wanting to see it -- Nx / talk 12:50, 27 August 2011 (UTC) - (EC)Well, the issue for me is not just whether I personally feel uncomfortable with the image, I want others who might find such images make them uncomfortable to feel welcome on my talk page. So I don't want to have those images displayed, or linked to without any fair warning of their content. Different things offend different people, but discomfort at nudity or pornography are common enough that such discomfort deserves some respect. You don't have to agree with the people who feel that way feeling that way, but please show them some respect. (((Zack Martin)))™ 12:50, 27 August 2011 (UTC) Priest Church employee. Pedophile. Lather, rinse, repeat.[edit] Ho-hum. B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 15:34, 26 August 2011 (UTC) - Jesus. Because of these people (disclaimer: it's the Mirror - it might be horseshit), it's almost getting to the stage now that you're automatically suspected of being a paedophile if you want to work with children. Sorry state of affairs. Ajkgordon (talk) 15:41, 26 August 2011 (UTC) - I've just finished "Beyond Belief" by the excellent David Yallop. I'm not sure which is worse - the scope of the abuse, or the way in which the church has covered it up for so long. Either way, it's horrific. --PsyGremlin講話 15:47, 26 August 2011 (UTC) - The church cover-up is a result of that noted Christian doctrine, "forgiveness;" a good deal of the hysteria over the abuse scandal is aggravated by wretches who want to have their cake (be forgiven their debts) and eat it also (not forgive their debtors). ListenerXTalkerX 15:53, 26 August 2011 (UTC) To be fair, this guy is C of E, not RC. Has four kids of his own, and the C of E seems to be co-operating with the po-pop more than the Catholics have, historically B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 15:54, 26 August 2011 (UTC) - The article says he is a Catholic. ListenerXTalkerX 15:57, 26 August 2011 (UTC) - Here Pippa (talk) 16:09, 26 August 2011 (UTC) - Is there a project anywhere that keeps a tally on the number of reported paedophiles with religious connections (priests and so on) compared to the number of reported paedophiles with no specific religious connection (i.e. they may be religious but they aren't a member of the clergy)? X Stickman (talk) 16:50, 26 August 2011 (UTC)d - Joe.my.god does not keep tallys, but he does do a week by week "over view" of the religious (including sexual) crimes done by religious people. En attendant Godot 17:40, 26 August 2011 (UTC) So ListenerX is right, we are talking Catholic here. I skimmed the article really quickly and saw the guy was married with four kids and therefore assumed he wasn't RC. He was an RC employee, not a priest. B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 21:01, 26 August 2011 (UTC) - And there are plenty of abusers out there with no connection with religious groups. I'd even say the majority of abusers have no links to religious groups. Obviously, if abusers are everywhere in society, you'll find them in religious groups too. People seem to me here to be picking up on the Catholic church connection even though it is irrelevant. It would be relevant if this was a case of the church trying to cover up this man's offences, but in this case, there is no evidence it has done so. And, even though the Catholic Church is guilty of covering up abuse, so are to my knowledge Anglicans, Jews and Buddhists, and probably quite a few other religious groups I'm sure, and secular organisations also. Many people, including those in authority, religious or secular, find it easier to discredit or hush up abuse allegations than to actually acknowledge them publicly. I know someone who was abused as a child by a family member, and the rest of her family refuse to accept it happened, and so she has just given up on that — just like church cover ups, except on a smaller scale. (((Zack Martin)))™ 22:54, 26 August 2011 (UTC) - The Catholic church has always touted itself as a moral arbiter. For them to knowingly conceal such behaviour is much worse than a single person, or family, doing so. Hypocrisy in the extreme. Alright, they haven't hidden this guy but they facilitated him in the past and one would suspect that if this had come to attention of the church ten years ago we'd never have heard about it. True, everyone's as fallible as everyone else but we can't all hide it. Pippa (talk) 23:07, 26 August 2011 (UTC) - PS. Marathing: you're a total idiot. Pippa (talk) 23:09, 26 August 2011 (UTC) - The Catholic Church being hypocritical? Nothing new there. Plenty of cases of that going back centuries that have nothing to do with abuse. I don't deny the Catholic Church has done a lot of wrong things, both involving this issue, and many others. I just can't agree with people who want to paint it as some kind of problem exclusive to the Catholic Church, when other denominations/religions, and secular institutions, are guilty of the same things. And, it is sad that you feel the need to resort to personal attacks, it is a poor substitute for discussing the issues. (((Zack Martin)))™ 23:13, 26 August 2011 (UTC) - " I just can't agree with people who want to paint it as some kind of problem exclusive to the Catholic Church." Okay, name one other/employees. B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 23:27, 26 August 2011 (UTC) - EC) Not a personal attack: a statement of fact. I cannot think of one word that you have written on this site that would dissuade anyone from agreeing with me. You are an overeducated simpleton. Pippa (talk) 23:29, 26 August 2011 (UTC) - @BBMaj, in terms of covering up abuse, other religious groups have problems too - see e.g. the Rabbi who is opposed to reporting abuse revelations to the police. See what I wrote on Talk:Anti-Catholicism. Pointing out the Catholic Church's wrongdoings while ignoring those of other churches/religions is a form of Anti-Catholicism. (((Zack Martin)))™ 23:33, 26 August 2011 (UTC) So, Maratrean, than you can't name a/employee, then. So there is something particularly noteworthy about Catholic sexual abuse then. Thanks. B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 23:58, 26 August 2011 (UTC) - Yes, the Catholic Church is bigger and wealthier and more centralised than other religions/denominations. And it has the same abuse coverup problem the others do. You are pointing out things that make the Catholic Church special, not what makes its abuse coverup special. It's abuse coverup is not essentially different from that of Anglicans or Jews or Buddhists or other religious groups. (((Zack Martin)))™ 00:00, 27 August 2011 (UTC) - Let me add, it is only in more developed Western countries that people feel free to bring up these sort of issues in the open. I'm sure in lots of third world or less free countries, there is lots of abuse that gets covered up (both by religious and non-religious authorities), that never sees the light of day. Do you think, if an imam in Saudi Arabia is abusing kids, will it get covered up? Quite possibly. Will you ever hear about the coverup? Probably not. Do you think that Roman Catholic priests are more likely to abuse children than imams in Saudi Arabia? Who could know? We certainly hear more about the misdeeds of Roman Catholic priests than those of imams in Saudi Arabia, but that could well be because in the Western cultures in which the RCC is having this problem, these kinds of issues are more likely to become public. (((Zack Martin)))™ 00:18, 27 August 2011 (UTC) "You are pointing out things that make the Catholic Church special, not what makes its abuse coverup special." No, those are the things that make the abuse coverup most odius. Men will always abuse children, I get that. But most men do not enjoy the protection, if not the facilitation, of a wealthy, transnational organization that provides them with easy access to potential victims, stymies law enforcement efforts, and uses its moral imprimatur as a way to keep the dogs at bay. You're argument about other religions has no evidence whatsoever to support a contention that a similar kind of coordinated, centralized decades-long pattern repeated itself with another group that is plugged in to hospitals, schools, social services and other target-rich environments. B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 00:31, 27 August 2011 (UTC) - The Catholic Church isn't a single organisation anyway. It is a whole collective of many different organisations. It isn't as centralised as you think. In many ways, it is less centralised than many other religions, due to factors such as the enormous proliferation of religious orders. Do the Franciscans take orders from the Jesuits? Or the Sisters of Mercy from the Sisters of Charity? Has there been one big coverup? There have been lots of little coverups, independently arrived at. Sure, the Vatican has in some cases made policy decisions that would made these coverups possible, but its not like there is some secret Coverup Committee deep inside the Vatican calling all the shots. - Are you ignorant of the long and odious history of Anti-Catholicism? (((Zack Martin)))™ 02:46, 27 August 2011 (UTC) - Most anti-Catholicism was nothing more than a cover for ethnic animosities, as in Ireland after the Cromwellian conquest, or in the U.S. during the large waves of Irish immigration. ListenerXTalkerX 03:36, 27 August 2011 (UTC) - There is an element of truth in that statement, but it is more complicated than that. Look at the history of persecution of the English recusants — a history of native English Protestants persecuting native English Catholics. Or consider the Anti-Catholicism of Jack Chick, which has nothing to do with ethnic conflict that I can see. (((Zack Martin)))™ 10:00, 27 August 2011 (UTC) - Yeah, bashing the Vatican for the failings of its sub-units is like bashing corporate Shell for its record in Nigeria (where SPDC is 55% owned by the Nigerian government). It's not at all fair. ГенгисRationalWiki GOLD member 10:10, 27 August 2011 (UTC) - Don't know enough about Shell to comment about the validity of that comparison... but when you bash the Catholic Church, you are bashing all Catholics, a lot of whom actually strongly disagree with the Vatican. Most of the Catholics in my family strongly disagree with the Vatican — and that includes religious brothers/sisters in my extended family... actually, the majority of lay Catholics disagree with the Vatican on many issues (like contraception)... some religious orders are well known for being a thorn in the Vatican's side... e.g. a lot of well known Jesuits, like Father Frank Brennan, are much too liberal for the Vatican's liking. I've seen Fr. Brennan, on national television, speaking positively of a lesbian relationship — although he was careful not to go so far as to openly endorse same-sex marriage, which was the topic, but he wasn't very strident in his opposition to it either... — I really doubt the Vatican would be keen on his endorsement of a lesbian relationship, or the meekness of his opposition to same-sex marriage, but the reality is the Vatican can't control him, because the Catholic Church is not actually as hierarchical/authoritarian as many non-Catholics believe it to be, or as many conservative Catholics wish it was. Most Catholics understand the difference between Catholicism and the Vatican, something which many non-Catholics don't get. (((Zack Martin)))™ 10:20, 27 August 2011 (UTC) - I'd suggest that if you don't agree with what the Pope says then you'd be better off leaving the Catholic Church and starting your own religion; then you don't get to be associated with them. ГенгисRationalWiki GOLD member 14:55, 27 August 2011 (UTC) - Which is exactly what I've done... but unlike me, the vast majority of Catholics don't see things that way. (((Zack Martin)))™ 14:57, 27 August 2011 (UTC) - My experience of Catholic flocks is that the style has a lot to do with obedience to authority. Some of them know how to party as well, but the reflexive obedience is still there when Fr. Riordan or Fr. Vespucci shows up. I would suggest that a sane course for a recovering Catholic is not to make up another set of hymns and prayers of their own, but see if the local Unitarian-Universalist congregation is at all simpatico. When my children were in grade school, we went to the UU church on Sunday, for some civilizing influence on the little savages, and some hymn-singing for Dad. The fellowship was supportive too. Sprocket J Cogswell (talk) 16:25, 27 August 2011 (UTC) Richard Dawkins - Beware the Believers (Expelled promo)[edit] I present to RationalWiki this old but hilarious video, which was released sometime in 2008 as promotional material for Expelled. But according to PZ Meyers, it was made by Michael Edmondson, who apparently didn't care too much about Stein's message and just wanted to make something funny. Is it a parody of the New Atheists? A parody of creationist critiques of the New Atheists? Or is it a parody of a parody? Who knows! Tetronian you're clueless 21:25, 26 August 2011 (UTC) - I've seen that, I always thought it was an attempt to capitalize on the popularity of MC Hawking. Nebuchadnezzar (talk) 02:11, 27 August 2011 (UTC) - MC Hawking? Nah. Epic Rap Battles of History is how you do it. Osaka Sun (talk) 06:34, 27 August 2011 (UTC) - Two things: 1) Why does he sound more like David Attenborough? 2) I am never going to be able to look at Eugenie Scott in the same way again. ADK...I'll reiterate your businessman! 14:35, 27 August 2011 (UTC) - ADK, your #2 was pretty much what I thought as well. I'm still a bit unnerved by the way they portrayed her. Tetronian you're clueless 18:46, 28 August 2011 (UTC) - Generally everything in that video is unnerving. ADK...I'll revolt your fact tag! 00:23, 29 August 2011 (UTC) Any Haitians in the house?[edit] Or anybody who speaks Haitian Creole (Kréyol)? B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 03:12, 27 August 2011 (UTC) - Not here. ГенгисRationalWiki GOLD member 10:13, 27 August 2011 (UTC) The poor get poorer and the rich get pumped full of Vitamin C[edit] I have been looking through *hangs head in shame* Fox News, when I happened through this: Now, I get, kind of, why someone would like to turn himself into a low-entropy popsickle for the unlife after, but what is the rational dirt with the intravenous B-12, magnesium, vitamin C? Is it bull as suspected or have I been missing out in a whole lot of fun to be had with needles and oranges? Sen (talk) 11:54, 28 August 2011 (UTC) - I've heard people say that taking large amounts of vitamin C can help you recover from small illnesses like the common cold faster than you would otherwise (though I've never actually tried it). I don't know what the effects of taking it every day would be though. Tetronian you're clueless 12:05, 28 August 2011 (UTC) - Ah, here we go. Tetronian you're clueless 12:12, 28 August 2011 (UTC) - That's the Ray Kurzweil diet. Sounds like old Simon has fallen for his bullshit hook, line and sinker. --JeevesMkII The gentleman's gentleman at the other site 13:22, 28 August 2011 (UTC) - It won't do much besides darkening your urine. And it's all Linus Pauling's fault. Nebuchadnezzar (talk) 17:06, 28 August 2011 (UTC) - It was a plot point in House that vit C was supposed to cure TB. I won't spoil it, just in case, but suffice to say the punchline is "it's total bollocks". ADK...I'll pull your ox! 00:22, 29 August 2011 (UTC) - No, it was a plot point on House that large doses of vitamin C had once been shown to cure TB but that the study had never been followed up because nobody rich cared any more. The point of the episode was that the chosen method of gaining support for testing the hypothesis was so outrageous that even House wouldn't support it. –SuspectedReplicant retire me 00:26, 29 August 2011 (UTC) - The House episode was about curing polio with vitamin C, not TB. Still really good though. - "You gotta get over here. [The CIA's] got a satellite aimed directly into Cuddy's vagina." Osaka Sun (talk) 04:02, 29 August 2011 (UTC) Yes or No on RW-Tan.[edit] There. I kept it simple. Now whether or not you like it...is none of my concern. --Dumpling (talk) 23:05, 25 August 2011 (UTC) - That... That… looks like a victim of pedobear. Also that's the RWW logo... --★uːʤɱ structuralist 23:09, 25 August 2011 (UTC) - HAHAHAHA! XD Well, it was mentioned before (The RWW logo, I mean, not the pedobear victim). The logo can easily be changed. And minor edits I can do. Starting from scratch is a no. Unless I have more free time.--Dumpling (talk) 23:11, 25 August 2011 (UTC) - I don't usually comment on such things but I feel it necessary now: Fuck no. The whole concept of a 'tan' is just so much arse. (Very nice work none the less) AMassiveGay (talk) 23:12, 25 August 2011 (UTC) - Yes. HollowWorld (talk) 23:15, 25 August 2011 (UTC) - Eh. I don't really care if there is/isn't a 'tan'. I just drew on command. (Thank you though.)--Dumpling (talk) 23:19, 25 August 2011 (UTC) - WHOO! HOO! Now I can knock this off my "shit to draw" list! ADK...I'll revolve your igneous protrusion! 17:32, 26 August 2011 (UTC) - OHDEARGODWHATISTHATTHING? The unbusinesslikeman of business 15:00, 29 August 2011 (UTC) Different idea[edit] How about this "Tan"? I have zero art skills though. --★uːʤɱ atheist 23:23, 25 August 2011 (UTC) - That can be done rather easily. Any debate as to what color the goat should be?--Dumpling (talk) 23:25, 25 August 2011 (UTC) - Actually that was a joke. --★uːʤɱ digital native 23:26, 25 August 2011 (UTC) - This one cannot sense sarcasm very well and is very gullible.--Dumpling (talk) 23:28, 25 August 2011 (UTC) - You can't be gullible - the word has been removed from the Oxford English Dictionary. --PsyGremlinKhuluma! 12:00, 28 August 2011 (UTC) - This one too — the gullible at least. --★uːʤɱ anti-communist 23:35, 25 August 2011 (UTC) - No, no, I really like the idea of having a manga-style goat as our tan...~SuperHamster Talk 23:30, 25 August 2011 (UTC) - YAY! Me too actually! I much rather prefer a cute goat. Unless you're being sarcastic as well...NO MATTER! I'm not.--Dumpling (talk) 23:32, 25 August 2011 (UTC) - Why is a tan needed or why is a tan even desirable? AMassiveGay (talk) 23:34, 25 August 2011 (UTC) - People that comment in this section really should say if they are serious or not, 'cause I really can't tell. --★uːʤɱ libertarian 23:35, 25 August 2011 (UTC) - I'm very much serious. And to answer your question (AMassiveGay)...It isn't. Or at least I don't think it's needed, but it'd be something interesting to have.--Dumpling (talk) 23:41, 25 August 2011 (UTC) - I"m 40. i'm slow, old, and get off my lawn. What the fuck is a "tan".En attendant Godot 23:47, 25 August 2011 (UTC) - Aw~ You're not slow or old. And Yes ma'am! Anyways, a "tan" is basically like a Japanese-manga drawn mascot that a lot of wikis have.--Dumpling (talk) 23:48, 25 August 2011 (UTC) - By 'manga', read 'hideously generic'. They are an unnecessary abomination. AMassiveGay (talk) 23:52, 25 August 2011 (UTC) - I don't think we'll be officially adopting any tans, like via a vote, but if you make a cute goat one, then that can just be the RW tan. It doesn't have to be an official thing or anything and it's interesting to have. Awesome work by the way!--talk 00:06, 26 August 2011 (UTC) - Fine by me. :3 And...thanks.--Dumpling (talk) 00:11, 26 August 2011 (UTC) - Not even knowing what a TAN is used for, if it's cute, and it's a goat - i'll vote. but only if it's cute. like this but in goat shape.En attendant Godot 00:20, 26 August 2011 (UTC) - Its the cuteness that I find so displeasing. Also, that parrot isn't cute. It is a rapist AMassiveGay (talk) 00:26, 26 August 2011 (UTC) - Yes, but Mark was clearly all for it. I mean he went out of his way to make sure he had a parrot scar teh scene before. Little did he know that the cute guy would try to rape him. and Fry wasn't about to help, he was dying of laughter (as were my husband and I). En attendant Godot 17:43, 26 August 2011 (UTC) - I'll voat for a gote if it is sickeningly cute. I'm talking massive-eyes cute. ONE / TALK 11:01, 26 August 2011 (UTC) - How about this shit? It's something called "Pleasant Goat" (ʞlɐʇ) ɹǝɯɯɐHʍoƆ 18:40, 26 August 2011 (UTC) - Is this maybe a case of Wikipedia Jealousy Complex (WJC)? I disapprove about every Manga-crap except ɹǝɯɯɐHʍoƆ's proposal, which is so incredibly amateurish as to qualify as a parody. Rursus dixit (yada³!) 09:52, 27 August 2011 (UTC) - I must be getting old. Tan?--BobSpring is sprung! 11:23, 28 August 2011 (UTC) - Cute anime-esque mascot. WP has one. CP has one, courtesy of ED. The "tan" is a childish honourific from Japan. Supposed to be really cute, comes from small kids who apparently can't say "san". Teddy bears are kuma-tan. So our mascot - when not being rogered by Pedobear - would be Rational-tan. Or something. - And I would oppose having a goat as our tan until my dying breath. Jerboas on the other hand basically define the word "cute". My dictionary even says (ok, in my handwriting) "See jerboa" under "cute". --PsyGremlinSermā! 11:57, 28 August 2011 (UTC) - How about a girl with goat horns? The unbusinesslikeman of business 15:00, 29 August 2011 (UTC) The difference between policy and enforcement (or, crap political arguments)[edit] PolitiFact slips up a bit here, as anyone who's been following the creationist movement knows the "analyze and critique" language is just an attempt to slip creationism in through the cracks. The article notes that to some extent at least, but glosses over it. Assuming law and reality are consistent needs to be its own political fallacy. It tends to lead to idiocy like this. Hey, murder can never happen because it's illegal! Nebuchadnezzar (talk) 21:47, 27 August 2011 (UTC) - Reminds me of an old Monty Python sketch - If you want to bring down the number of crimes you just need to reduce the number of offences. ГенгисRationalWiki GOLD member 08:15, 29 August 2011 (UTC) Crossword help[edit] Stuck on one clue on the everyman crossword in the Observer. 22 Lot, husband of biblical character (4) _ E _ H. I think those letter are correct but I could be wrong. I have no clue as the answer. AMassiveGay (talk) 03:24, 28 August 2011 (UTC) - Perhaps 'Leah' who was a biblical character. Lot & lea are both words used to describe land, with 'h' for husband. RagTopGone sailing 03:43, 28 August 2011 (UTC) - May be something useful in here. Also, is that what crosswords are like in the UK? They could use a Real Man's Crossword. Nebuchadnezzar (talk) 03:47, 28 August 2011 (UTC) - UK crosswords are prettier. And the you linked appeared to be a concise crossword. They are for pussys AMassiveGay (talk) 03:52, 28 August 2011 (UTC) - And you can get half the answers just by solving the other clues. You only need to do half of it. AMassiveGay (talk) 03:55, 28 August 2011 (UTC) - Yeah, Leah is right. ГенгисRationalWiki GOLD member 10:22, 28 August 2011 (UTC) - Also yes, once Torquemada's cryptic crosswords appeared all the non-cryptic ones should have vanished except from puzzles aimed at primary school children. It's as if instead of Poker, some people played "Go Fish" for money. Or there was a "pro gamer" league playing Pong instead of Starcraft for cash prizes with a live audience. 82.69.171.94 (talk) 21:53, 29 August 2011 (UTC) The evolution of Republicans[edit] [3] What paper is this from? - David Gerard (talk) 22:15, 28 August 2011 (UTC) - I did a tineye.com search and then looked around on Google... must be some student newspaper or something.--talk 03:37, 29 August 2011 (UTC) - It's an old joke, "the descent of American presidents from George Washington to Ulysses S. Grant was enough to discredit the theory of evolution." First appeared in the 1870s about the second Republican president. Henry Adams, U.S. Grant, and Evolution: Practicing History in the Age of Darwin. [4] nobsI am a fugitive from an ideological fever swamp 03:39, 29 August 2011 (UTC) Ah, if Lincoln was alive to see what's happening to his party. Osaka Sun (talk) 04:05, 29 August 2011 (UTC) - Here is a highly amusing quote from a Southern crank in support of the Dominionist Michael Peroutka, 2004 Constitution Party candidate (capitalization in the original, emphasis mine): - ListenerXTalkerX 06:21, 29 August 2011 (UTC) - Pardon me for asking a dumb question, but isn't the Constitution Party not the Republican Party? nobsI am a fugitive from an ideological fever swamp 16:31, 29 August 2011 (UTC) General site news[edit] I just noticed on Rc: (Intercom log) . . Blue (Talk | contribs | block) sent a message to General site news (Vote closing soon). What is this "General site news" and where may it be read? Pippa (talk) 04:12, 29 August 2011 (UTC) - Click on "message" -- Nx / talk 05:49, 29 August 2011 (UTC) - Yeah, but if I don't happen to notice it on Rc, what's the point? Seems silly to me. Pippa (talk) 05:58, 29 August 2011 (UTC) - I'm not sure if you're aware of this, but intercom messages appear at the top of the page, similar to the "you have new messages" orange box, so you'll probably notice them. However they also have an expiration date, after which they won't appear there. In this case there's no point in bothering you with the message if the vote is over. -- Nx / talk 06:02, 29 August 2011 (UTC) - (EC) Go to the Intercom page, click on the "Configure groups" link there, and make sure you are a member of the "General site news" group. ListenerXTalkerX 06:03, 29 August 2011 (UTC) - Thanks LX, Probably worth telling newbies about that, or making "General site news" also default. Pippa (talk) 06:12, 29 August 2011 (UTC) - "Urgent" appears to be the default. The unbusinesslikeman of business 15:02, 29 August 2011 (UTC) Fat too much time on their hands[edit] The SCP Foundation For when TV Tropes gets boring. --PsyGremlinZungumza! 14:50, 29 August 2011 (UTC) - Maybe we should slip this ( into Andy's homeschool classroom.........--Lefty (talk) 18:40, 29 August 2011 (UTC) - I've loved the SCP site for years now. My favourites are this one (especially the testing logs at the bottom) and this one, again because of the test log, even if that does go against the spirit of the site I guess. Word of advice, though; *seriously* think through *any* ideas you possibly have for SCPs if you plan on trying to add one to the site. The community will completely and totally rip your second asshole a new asshole (your first asshole will have had a second asshole ripped in it when you try to join the site in the first place, unless they've changed it recently) when criticising your attempts. It's how they keep the site relatively well written and interesting and make sure it doesn't turn into a huge list of SCPs like "Stickman, The Man Who Gets All The Women And Is Totally Awesome All Of The Time". Oh! Also for fun, TV Tropes has a page for the foundation and the foundation has an entry for TV Tropes. X Stickman (talk) 19:25, 29 August 2011 (UTC) - WARNING!! Don't read uncensored SPC reports. You will never sleep again. They all have something in common. It isn't what you think, and it is about 10 times worse than the average Nightmare Fuel in horror movies.--Lefty (talk) 20:51, 29 August 2011 (UTC) - "Fat too much time"? You've been spending too much time with Kenny-baby, Psy. ГенгисRationalWiki GOLD member 21:36, 29 August 2011 (UTC) Hiding comments in "recent changes" view[edit] I know we can hide things like "m" or group all of the changes to a document into one - but is there any way to hide (for a given user, like, oh - me) from having to have particular pages or people listed? There are some trollspeople I'd rather not read, if only cause i can't control myself and have to say "are you frigging kidding me? Science does not work like this, and i'm not even a scientists!". ;-)En attendant Godot 18:33, 29 August 2011 (UTC) - You can filter a namespace, but I don't think you can filter users. Тytalk 18:36, 29 August 2011 (UTC) - shucks. I have no impulse control (says the obese woman who is sitting here eating chocolate). En attendant Godot 18:42, 29 August 2011 (UTC) - Don't use Rc: use your own, editable, "watchlist" and check Rc once a visit or every hour? Pippa (talk) 18:49, 29 August 2011 (UTC) - Smart woman, that pippa. even though she makes me think of "pippi?" longstocking. :-)En attendant Godot 19:05, 29 August 2011 (UTC) - There is also watchuser... Тytalk 19:09, 29 August 2011 (UTC) - That script serves the opposite function as she inquired about, though it could easily be modified to accommodate hiding a particular user's edits from RC as well. Blue Talk 19:15, 29 August 2011 (UTC) - I know, I was wondering if that was possible. Тytalk 19:20, 29 August 2011 (UTC) - If I had that script on hand (the follow user), i'd not make one useful edit on this page. I'd just follow those I deem stupid enough to deserve my vitriol, making whiny comments. ;-)En attendant Godot 19:22, 29 August 2011 (UTC) - Some people have talked of a script or something to ignore a certain editor at Conservapedia. I think Nx might be able to help.--User:Brxbrx/sig 19:42, 29 August 2011 (UTC) - I think it's Night Jaguar's, but I have a feeling it might need to be updated. Occasionaluse (talk) 19:56, 29 August 2011 (UTC) - This may or may not work. It's hardcoded to hide Theemperor, so you have to change that. -- Nx / talk 20:07, 29 August 2011 (UTC) - Completely off topic, but when are browsers going to support tag selectors? Occasionaluse (talk) 20:14, 29 August 2011 (UTC) News?[edit] BBCBreaking BBC Breaking News Judge temporarily blocks a tough new immigration law in the US state of #Alabama after challenge from the #Obama administration. That's all I've got off Twitter. Anyone got any more? Pippa (talk) 20:20, 29 August 2011 (UTC) Stoned lemurs[edit] Sounds like one of Punky's bands, but it's true. Yo, man, gonna get me some 'pede man... --PsyGremlinSpeak! 16:49, 29 August 2011 (UTC) - I had a friend that would say "Do bugs, not drugs!" He would then follow by taking up a sleazy sounding voice you'd imagine coming from a drug dealer or pusher and say "I've got centipeeedes..." Centipedes was on a higher note than the rest of the sentence. This friend of mine never failed to make me laugh.--User:Brxbrx/sig 03:53, 30 August 2011 (UTC) - You should read 'Naked Lunch'. People are getting high on centipedes all the time in that. AMassiveGay (talk) 10:05, 30 August 2011 (UTC) - I started the movie, but I got bored and I stopped watching--User:Brxbrx/sig 11:27, 30 August 2011 (UTC) - The film is not like the book at all. It is still good though, you should give it another try. The book is cool too. AMassiveGay (talk) 13:10, 30 August 2011 (UTC) All the woo you want[edit] The Quickening - your recommended annual dose of woo in one easy package. My brain hurts. Everything you ever wanted to know about the end of the Myan calendar... which is Oct this year, not Dec 2012, complete with Comet Elanin, collective consciousness and god knows what else. All narrated by a stoned chick, over repetitive visuals. Why can't woo-meisters make interesting movies?? It's like Terrance McKenna - just listening to 5 minutes of him speak and you want to jab fondue forks in your ears. --PsyGremlinSprich! 15:31, 29 August 2011 (UTC) - What's worse? They copied their name from one of my favorite action movies. Lord of Reckless Noise Hooray! I'm helping! 16:35, 29 August 2011 (UTC) - Whats even worse is is that you list Highlander II as one of your favourite movies. For Shame AMassiveGay (talk) 10:40, 30 August 2011 (UTC) The Conspiracy Files[edit] For the Brits in the house who can get iPlayer, BBC2 is showing The Conspiracy Files with a special on 9/11 ten years on. ADK...I'll hurt your squibble! 23:04, 29 August 2011 (UTC) - Really, how are people this stupid?!!? ADK...I'll stride your liquid goo! 23:42, 29 August 2011 (UTC) - I saw that program. It doesn't matter how much evidence/proof you provide, they will always think it was conspiracy. They've already made up there minds and they are not budging. AMassiveGay (talk) 10:16, 30 August 2011 (UTC) - Also, the chap who made that 9/11 conspiracy film, keep saying he and his friends were just civilians, but kept refering to them with psuedo military terms. He also had a big picture of Christ with the caption 'employee of the month'. I always find strange to see young people with what I assume to be strong religious conviction. AMassiveGay (talk) 10:19, 30 August 2011 (UTC) - Those Loose Change guys promised me a version narrated by Charlie Sheen. I am disappointed. Nebuchadnezzar (talk) 11:51, 30 August 2011 (UTC) - The Bullshit! episode on conspiracies (I think it was 9/11 specifically) had a guy and this open-mic night for conspiracy theorists who uttered the immortal line "no one can convince me [that the government wasn't involved]". No one can convince me. No one can convince me. No one can convince me. If you want proof that conspiracy theorists are full of shit, look no further than that one little phrase. ADK...I'll stride your kumquat! 15:17, 30 August 2011 (UTC) - Yeah, I think the basic structure of all conspiracy theories can be boiled down to the equation: Morton's fork + paranoia. Nebuchadnezzar (talk) 15:25, 30 August 2011 (UTC) Something I stumbled upon in my readings of stuff[edit] I found this as a citation on Wikipedia- actually, the citation was for Fox News, which had a summary and linked to the Daily Mail for the complete article. Naturally, an anti-union piece pimped by both the Daily Mail and Fox aroused my suspicions. Can anyone offer some insight into the context of the controversial comment in question? Thank you, RationalWiki--User:Brxbrx/sig 06:49, 30 August 2011 (UTC) - The article itself seems confused as to what it's about. Both the article and the alleged quote use an example of an 18 yo sixth former but in reality an 18 yo is an adult, and the law they're talking about (the article itself eventually explains) only covers minors. Obviously it wouldn't be unusual for a school to fire a teacher who has sex with older pupils, but that's a long way from them being convicted of a crime, or even arrested let alone put on the sex offenders list. But anyway, it's a press release to generate interest in a commercial TV show. 82.69.171.94 (talk) 09:08, 30 August 2011 (UTC) - There was change to the law in 2000(?) with the Sexual Offences (Amendment) Bill (1999-2000)/Age of Consent and Abuse of Trust Bill which makes it an offence for professionals in education and social care who regularly come into contact with people 'under the age of 19' to engage in a sexual relationship (which includes taking 'indecent' photographs) with those under their care. This is a link to a parliamentary briefing paper but I have been unable to actually find the bill's exact wording. So yes, it is a crime but whether it merits being put on the sex-offenders register is a different matter. ГенгисRationalWiki GOLD member 10:26, 30 August 2011 (UTC) - Where does this under the age of 19 that you've quoted come from? It clearly doesn't come from the Bill itself, since you admit that you were somehow unable to find that. Here you can read the relevant text for yourself starting here: -- so, no, as I already explained it's not a crime for a teacher and a consenting 18 yo pupil to have sex. 82.69.171.94 (talk) 11:34, 30 August 2011 (UTC) - "1)Subject to subsections (2) and (3) below,.". So anyone below under 18. AMassiveGay (talk) 13:08, 30 August 2011 (UTC) - Working with persons 'under the age of 19' actually refers to the Education Reform Act 1988 which defines who is covered by the legislation. While AMG has pointed out that the law applies to sexual activity with persons under 18 the Secretary of State for Education has powers to enforce regulations that apply to the wider abuse of positions of trust which would not be restricted to the lower age limit and relevant institutions are expected to have internal rules governing this. However, this would then be disciplinary issue rather than a criminal one. ГенгисRationalWiki GOLD member 13:59, 30 August 2011 (UTC) - BTW the Mail article doesn't even cite the case of an 18 year old it is just a hypothetical scenario so it appears to be another bit of scare-mongering. ГенгисRationalWiki GOLD member 14:05, 30 August 2011 (UTC) Hurricane freakin Irene[edit] I'm right in its path (so is the ASchlafly). There was a time where I loved stuff like this and wanted it to happen but now I'm anxietying out over losing power for a week or my workplace blowing away or something. If I don't post for a week after this Sunday afternoon, I either died or lost power. On the plus side, the Conservapedia server might get flooded. Senator Harrison (talk) 01:21, 26 August 2011 (UTC) - Yep, it's going to be interesting. Can't be as bad as Floyd was back in 1999, though. My whole town was knee-deep in water for a few days. Tetronian you're clueless 02:18, 26 August 2011 (UTC) - I think it's supposed to be worse than Floyd. They're also making evacuations in Cape May county mandatory. Senator Harrison (talk) 03:33, 26 August 2011 (UTC) - I'm in central Maryland, between DC and Baltimore. When the leaves are off the trees, you can see I-95 from my front yard. I'm under a tropical storm warning, though I think I saw I-95 is the extent of the tropical storm conditions. I've got bottled water and food I can cook on my gas stove. - If someone asks nicely, I'll tell you how the last hurricane (Isabel, I think) to hit this area prevented me from meeting Sarah Ferguson. MDB (talk) 10:17, 26 August 2011 (UTC) - Oh, and as far as Andy being in the path of the storm -- Andy, if you're reading this... we make fun of you here, we insult you, but no one here wants to see you harmed. Keep you and your family safe. MDB (talk) 10:29, 26 August 2011 (UTC) - I'm sure that he's praying to God and when he, his family and his property emerge unscathed it will all be down to the power of prayer. ГенгисRationalWiki GOLD member 10:35, 26 August 2011 (UTC) - I remember Katrina and Gustav. Massive power-outage for about 2-3 weeks. Everyone in the neighborhood started gathering their meats and such from the freezers and started to BBQ. It was hot. Humid. Mosquito-infested. And only very few people would actually have electricity...or even internet.Good luck. D:--Dumpling (talk) 15:17, 26 August 2011 (UTC) - I guess we'll be seeing a stream of Lead Belly references in the headlines soon. Nebuchadnezzar (talk) 17:38, 26 August 2011 (UTC) I'll keep you all updated until my power goes out which I fully expect to happen. When it does I'll post from my phone if I can but I want to conserve the battery obviously. And yes I hope that Andy and his family make it through just fine, I just won't be shedding any tears if the server doesn't. Senator Harrison (talk) 21:01, 26 August 2011 (UTC) - Well, I doubt it will be worse than Floyd was for me. That one knocked over a tree that smashed a transformer, causing fireballs to shoot out of it and set our lawn on fire. No shit. Nebuchadnezzar (talk) 02:38, 27 August 2011 (UTC) - Fireballs shooting all over your lawn in way cooler than the drain backing up and flooding your basement, which is the only kind of disaster we get around here. Doctor Dark (talk) 03:34, 27 August 2011 (UTC) - Or a horse flying through your living room window. Senator Harrison (talk) 12:34, 27 August 2011 (UTC) - I hope that everybody is all right. It occurs to me though that if this one is big enough to climb the entire east coast of the US without seeming to lose a great deal of energy then it'll presumably still have some life left in it when it crosses the Atlantic and hits the dear old United Kingdom. (Otherwise know as "England".)--BobSpring is sprung! 09:37, 28 August 2011 (UTC) - Reading some of the tweets on the BBC reminds me that I was in NY when Agnes hit in 1972. I don't remember much in the way of wind but a hell of a lot of rain. ГенгисRationalWiki GOLD member 10:48, 28 August 2011 (UTC) - In my town (central western NJ), we had minor wind damage but major flooding. Most of central NJ is flooded. Rt 1 is under six feet of water. Senator Harrison (talk) 02:21, 29 August 2011 (UTC) My home has been without electricity since sometime between 2:30 and 6:00 AM Sunday. Believe me when I tell you it is a challenge trying to make sure you're clean-shaven for a job interview when the only light you have is flashlight and candles. MDB (talk) 10:26, 29 August 2011 (UTC) - Power was out here in Cape Cod, Massachusetts (easternmost part of the US) until about 10:30 PM Monday. We have a generator, but the power really needs to be filtered better before we put electronics on it. Howard C. Berkowitz (talk) 22:33, 30 August 2011 (UTC) Gay Nazis[edit] So I've seen this masterpiece being cited to back up the "gay Nazi" meme. But has anyone read it/know anything about it? I have to say, I'm rather tempted to read it if I could find a free copy. Nebuchadnezzar (talk) 12:48, 30 August 2011 (UTC) - You can probably find a torrent of it some whereAMassiveGay (talk) 12:55, 30 August 2011 (UTC) - hereAMassiveGay (talk) 12:56, 30 August 2011 (UTC) - No seeds. Anyway, stop posting communism. Nebuchadnezzar (talk) 15:44, 30 August 2011 (UTC) - Viva revolution, comrade AMassiveGay (talk) 16:09, 30 August 2011 (UTC) - Try this - looks tiny tho - 15k. Also here here and here --PsyGremlinParla! 16:18, 30 August 2011 (UTC) - The online versions don't have any images which is why they are quite small but nearer 920kb than 15kb. I looked at the review quotes at "The Pro-Family Resource Center" (Abiding Truth Ministries) and ... well the name of the site should probably tell you all you need to know. ГенгисRationalWiki GOLD member 16:54, 30 August 2011 (UTC) - Why does 'pro-family' invariably mean 'anti-gay'? AMassiveGay (talk) 21:43, 30 August 2011 (UTC) - Why does a bear shit in the woods? Anyway, thanks for the links, quite awesome. Nebuchadnezzar (talk) 05:05, 31 August 2011 (UTC) Holy shit, Obama makes a good advisory appointment![edit] As WIGO'ed. And Galt almighty, he's not a total Wall Street hack (cf. Larry Summers, Bob Rubin, Gene Sperling). Cue wingnut outrage at the SOCIALIZMZ of the Card and Krueger studies. Nebuchadnezzar (talk) 15:41, 30 August 2011 (UTC) - Yeah, he's pretty good. An appointment to be happy about, in the face of the swelling ranks of unfilled positions, and the judgeships staffed by strangely elderly appointees.--talk 04:39, 31 August 2011 (UTC) Links to hate sites[edit] Some of what I edit deals with ultra-racist or otherwise hateful bilge. I was just wondering if there's an official policy on this. It seems like it's mostly older articles that have links to these sites broken up by spaces, hyphens, etc. Nebuchadnezzar (talk) 06:39, 29 August 2011 (UTC) - I am not sure about written policy, but precedent is probably on your side: at one time we had a vandal, "Fred," who kept getting blocked for linking to Fred Phelps's site from the article on Phelps. He wound up creating about 70 separate accounts, but when we later allowed the link to Phelps's site in the article, he stopped vandalizing. ListenerXTalkerX 06:48, 29 August 2011 (UTC) - No official policy - just use your own good judgment. If you think linking to a site will do more harm than good, don't do it.--talk 06:50, 29 August 2011 (UTC) - I think one of the reasons for that semi-policy was that people thought it would improve their pagerank. But external links are all nofollow, so don't worry about that. -- Nx / talk 06:56, 29 August 2011 (UTC) - Ah, I see. Call me crazy, but I've always been of the opinion that people can't truly understand hateful bullshit if they aren't actually allowed to, you know, read it. Nebuchadnezzar (talk) 07:14, 29 August 2011 (UTC) - A lot of the more rabid advocates for censorship of hate-propaganda (Searchlight in the U.K., for example) are openly communist. Such people often view themselves as locked in a propaganda battle with a fascist/capitalist machine that pulled the wool over the eyes of non-communists, partly through the use of "fascist" propaganda. Unfortunately, these censorship policies have the double effect of giving the propaganda "forbidden fruit" status and giving the spewers of it something legitimate to gripe about. ListenerXTalkerX 07:30, 29 August 2011 (UTC) I think you should be allowed to link to whatever you want, so long as it is somehow relevant. If a site is a legitimate target of criticism, then it is legitimate to link to it for the purposes of that criticism, no matter how odious its content. (((Zack Martin)))™ 10:28, 29 August 2011 (UTC) - ORLY? NDSP 10:55, 29 August 2011 (UTC) - NDSP, personally I have no qualms about linking to stuff if I feel doing so adds value, but I know Philip etc. have a different perspective, so I try to show some respect for that... (((Zack Martin)))™ 10:57, 29 August 2011 (UTC) - I seem to remember us having at least two full-scale debates about this, during which I was down and out with a case of IDGAF... I don't see a problem with linking to hate sites, as long as there's a little NSFW-type warning. Blue Talk 10:47, 29 August 2011 (UTC) - Maybe mostly a "will make your skin crawl" warning. NSFW as well because I suppose that your boss may not view you browsing StormFront too kindly.--User:Brxbrx/sig 11:55, 29 August 2011 (UTC) - Yeah, I try to put NSFW warnings on that kind of stuff anyway, or it's something that's pretty obvious, like a ref to White Power magazine. Nebuchadnezzar (talk) 17:35, 29 August 2011 (UTC) - This does pop up occasionally because the ruling is only informal and mostly maintained as more a community meme than an actual law. The rationale against linking directly basically revolves around depriving such sites of their hits and search engine rankings through links, and not on grounds of censorship and not wanting to link to offensive things - as Neb rightly says, how can you understand it without reading it? Screen grabs help with this (as well as recording any potential dynamic changes), and this is what we have capturebot for. But this has never been an official or written policy. The Fred vandalism pretty much put and end to the informal ban on linking to Westboro Baptist. Stormfront is also now linked to directly as a result, but Metapedia still mostly consists of screenshot links and no directly links. ADK...I'll erect your railing! 00:38, 30 August 2011 (UTC) - But nofollow makes that irrelevant, right? Nebuchadnezzar (talk) 15:29, 30 August 2011 (UTC) - Pardon me for stepping in doo doo (I just love the feel of shit squishing between my toes), but what is a hate site? Are the wp:American Enterprise Institute, the wp:Bradley Foundation, and the wp:Ludwig von Mises Institute hate sites? nobsI am a fugitive from an ideological fever swamp 03:18, 30 August 2011 (UTC) - Don't be obtuse, Rob. You'll know it when you see it.--User:Brxbrx/sig 03:35, 30 August 2011 (UTC) - The term "hate" as used in "hate group" and "hate site" does differ from the usual sense a bit. It generally refers only to hatred based on some immutable characteristic (usually ethnicity, or a religion that is the external representation of that ethnicity). Also, it only applies to hatred of those groups designated as underdogs (cf., "persons of color cannot be racists") — unless the hate is too obvious to be swept under the rug, as with Farrakhan's Nation of Islam. ListenerXTalkerX 05:31, 30 August 2011 (UTC) - ^What he said. If you want to get pissy about definitions, that's fine, but as this is only an informal rule and casually applied very haphazardly partly out of tradition, partly because the individual examples came up and people rolled with it, and certainly not a hard and fast legally binding Law, then "if I think it's a hate site then it's a hate site" is adequate justification. Same reason that the political statement "I know what pornography is when I see it" is fine when someone is installing Net Nanny or whatever, but not when prosecuting and jailing people for possessing it. ADK...I'll withstand your paper! 15:23, 30 August 2011 (UTC) - Unless you want to link to some absurdity in a sort of FSTDT way then I can never see a need to. Those who want further clarification can use Google or whatever to go and look for themselves. If I say to you (I just made that up, btw) is a hate site against those with red hair then that's all most people want to know. The curious, should they desire, can google it. Bob Soles (talk) 15:32, 30 August 2011 (UTC) - wouldn't be a hate site. It would be purely factual. It is why judas is always depicted with red hair.AMassiveGay (talk) 16:07, 30 August 2011 (UTC) - True, but <ref>JFGI</ref> is rather poor form at the very least. When we're talking about linking to sites we're really talking about the intellectual honesty to prove what one is saying is true. That's true whether a politician has said something or someone has said something on a forum post and whether it's easy to find or quite obscure. If I was to cite a scientific fact, I would put the authors, journal, date and page/volume numbers in the footnote, not instructions on what key words to stick into Web Of Knowledge to find the right thing. Making any kind of work for a potential read, to make them jump through hoops to understand you, is no different than what multiple creationists and conspiracy theorists do on forums all the fucking time where they say "there's plenty of evidence if you Google it!!!11". The same standard of citation should be expected regardless of the content of that citation. So these full URLs should be given. Additionally, in an examples I have just recalled, we had the case of Christopedia where I failed to include the URL in the first version of the article (indeed, that place was worse than Metapedia by a good order of magnitude) and subsequently someone mistook it for a different Christopedia which was an obvious parody site and the article was mashed up between the two for a time. Now, that's a very specific example that is unlikely to be repeated, but shows the ambiguity that can occur if we use "JFGI" as an actual policy against linking. ADK...I'll curate your cuddly toy! 17:03, 30 August 2011 (UTC) - The example given is taken from the true life files of Wikipedia. According to the reputable and verifiable Southern Poverty Law Center, the Bradley Foundation is a hate group, meaning because of its extremist nature, the Bradley Foundation, like Stormfront, can only be used as a source about itself and in no other mainspace article. While it's interesting that the PBS's News Hour has been sponsored by a hate group, no one would dare challenge the integrity and scholarship of a reputable and verifiable source like SPLC, especially now because BLP, as well. nobsI am a fugitive from an ideological fever swamp 19:33, 30 August 2011 (UTC) OT. but still wrong. Not on the list. Seems like the only mention of Bradley on SPLC is criticism of their funding of The Bell Curve. Nebuchadnezzar (talk) 19:48, 30 August 2011 (UTC) - Bingo. You're right. But Wikipedia did suffer growing pains earlier. Simply cause the SPLC designates something a hate group, does that qualify Wikipedia using "an authoritive" source, like the SPLC, and citing it likewise? As you've rightly shown, Wikipedia does not. nobsI am a fugitive from an ideological fever swamp 23:17, 30 August 2011 (UTC) - Wait, what? My point was that SPLC doesn't classify it as a hate group. Nebuchadnezzar (talk) 18:08, 31 August 2011 (UTC) - The National Review covered this: If they’re too promiscuous with the “hate group” label, they would lose what little credibility they have left... as they reserve the designation mainly for groups that at least sound scary — Aryan Nations, Supreme Ferret of the Ku Klux Klan — even if they’re just P.O. boxes with no members, they can get away with it. But labeling AEI, for instance, or the Bradley Foundation as “hate groups” would strain the credulity of even a lot of gullible lefties...instead, the SPLC includes such targets ... in [lists] of those “spreading bigotry,” or whatever, along with others they have decided to label “hate groups,” secure in the knowledge that the SPLC’s allies further down the leftist food chain will apply the label for them... - and you'll recall, this discusion began not about "hate groups", but about "hate sites". nobsI am a fugitive from an ideological fever swamp 19:40, 31 August 2011 (UTC)
https://rationalwiki.org/wiki/RationalWiki:Saloon_bar/Archive118
CC-MAIN-2022-21
en
refinedweb
Python multiprocessing PicklingError: Can't pickle <type 'function'> Here is a list of what can be pickled. In particular, functions are only picklable if they are defined at the top-level of a module. This piece of code: import multiprocessing as mpclass Foo(): def work(self): passif __name__ == '__main__': pool = mp.Pool() foo = Foo() pool.apply_async(foo.work) pool.close() pool.join() yields an error almost identical to the one you posted: Exception in thread Thread/lib/python2.7/multiprocessing/pool.py", line 315, in _handle_tasks put(task)PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function failed The problem is that the pool methods all use a mp.SimpleQueue to pass tasks to the worker processes. Everything that goes through the mp.SimpleQueue must be pickable, and foo.work is not picklable since it is not defined at the top level of the module. It can be fixed by defining a function at the top level, which calls foo.work(): def work(foo): foo.work()pool.apply_async(work,args=(foo,)) Notice that foo is pickable, since Foo is defined at the top level and foo.__dict__ is picklable.. from pathos.multiprocessing import ProcessingPool as Pool p = Pool(4)class Test(object): def plus(self, x, y): return x+y t = Test() p.map(t.plus, x, y)[4, 6, 8, 10]class Foo(object): @staticmethod def work(self, x): return x+1f = Foo() p.apipe(f.work, f, 100)<processing.pool.ApplyResult object at 0x10504f8d0> res = _ res.get()101 Get pathos (and if you like, dill) here: As others have said multiprocessing can only transfer Python objects to worker processes which can be pickled. If you cannot reorganize your code as described by unutbu, you can use dills extended pickling/unpickling capabilities for transferring data (especially code data) as I show below. This solution requires only the installation of dill and no other libraries as pathos: import osfrom multiprocessing import Poolimport dilldef run_dill_encoded(payload): fun, args = dill.loads(payload) return fun(*args)def apply_async(pool, fun, args): payload = dill.dumps((fun, args)) return pool.apply_async(run_dill_encoded, (payload,))if __name__ == "__main__": pool = Pool(processes=5) # asyn execution of lambda jobs = [] for i in range(10): job = apply_async(pool, lambda a, b: (a, b, a * b), (i, i + 1)) jobs.append(job) for job in jobs: print job.get() print # async execution of static method class O(object): def calc(): return os.getpid() jobs = [] for i in range(10): job = apply_async(pool, O.calc, ()) jobs.append(job) for job in jobs: print job.get()
https://codehunter.cc/a/python/python-multiprocessing-picklingerror-cant-pickle-type-function
CC-MAIN-2022-21
en
refinedweb
On a Wednesday in 2020, Michal Privoznik wrote: >Functions that create a device node after domain startup (used >from hotplug) will get a list of paths they want to create and >eventually call qemuDomainNamespaceMknodPaths() which then checks >whether domain mount namespace is enabled in the first place. >Alternatively, on device hotunplug, we might want to delete a >path inside domain namespace in which case >qemuDomainNamespaceUnlinkPaths() checks whether the namespace is >enabled. While this is not dangerous, it certainly burns a couple >of CPU cycles needlessly. > >Check whether mount namespace is enabled upfront. > >Signed-off-by: Michal Privoznik <mprivozn at redhat.com> >--- > src/qemu/qemu_domain_namespace.c | 39 ++++++++++++++++++++++++++++---- > 1 file changed, 35 insertions(+), 4 deletions(-) > Reviewed-by: Ján Tomko <jtomko at redhat.com> Jano -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <
https://listman.redhat.com/archives/libvir-list/2020-July/msg01681.html
CC-MAIN-2022-21
en
refinedweb
RationalWiki:Saloon bar/Archive119 Contents - 1 Michele Bachmann is certifiable - 2 Whooping cough - 3 Increase my viewcount! - 4 Right wing attack on Elton, odd laguage - 5 Cracked's 5 Embarrassing Failures History Class Turned Into Victories - 6 Something a little less controversial - 7 Tawny Port - 8 Bombadier beetles - 9 Math & font help - 10 Music, politics, and endangered forest species - 11 Magnetic fields - 12 Action T4 - 13 Tumble weeds at it again - 14 UN Story - 15 About the Star Wars Blu-ray edits - 16 Tropical storm Lee - 17 Abortion UK style - 18 The label "anti-science": a rant - 19 An end to the Tories in Scotland - 20 Google Doodle Freddy Mercury thing - 21 skipcapcha - 22 Keys to the White House - 23 Anonymous offshore hosting? - 24 Cafeteria religion - 25 Alan Jones - 26 Libertarians for Dictators - 27 Vestigal body parts can cause pain - 28 grubs that eat their mommy from teh inside out - 29 Classes in France use twitter to teach reading and writing. - 30 That explains a lot: - 31 Unintentionally sexual church signs - 32 Thought - 33 The future of funspace - 34 Swings and roundabouts… - 35 blub - 36 Absorbing Actions Through Handshakes - 37 Illegal Library - 38 An interesting nugget - 39 The specious reasoning behind the 15 questions for evolutionists.... - 40 any cognitive scientists in the house? - 41 The Pitch - 42 Of interest - 43 Dear Europe, I love you - 44 Anyone up for some crank-review? - 45 +1 - 46 Gay Homophobe countdown clock - 47 Rubgy - 48 bionic - 49 Diaspora - not dead yet - 50 Washing Hands could save a million lives a year - 51 Vancouver 'quake - 52 Obama's new stimulus package - 53 Vegan black metal chef - 54 You see… Michele Bachmann is certifiable[edit] Apparently, New York earthquakes and hurricanes are signs from god that he wants reduced government spending (4th to last paragraph). How can someone get on stage and say these things and not be booed and pelted with rotten fruit? --JeevesMkII The gentleman's gentleman at the other site 20:31, 29 August 2011 (UTC) - Laugh all you want, but there has never been (and never will be) a single hurricane or earthquake during a Bachmann presidency. Occasionaluse (talk) 20:35, 29 August 2011 (UTC) - Sooo, Katrina was a sign from God too?--User:Brxbrx/sig 21:01, 29 August 2011 (UTC) - According to some extremists, Katrina was a sign from God condemning homosexuality. For some strange reason, everything that is malevolent is interpreted by religious fundamentalists as being a condemnation of homosexuality. Pat Robertson said that gay people caused 911.......--Lefty (talk) 21:14, 29 August 2011 (UTC) - Obviously Robertson hasn't spend enough time on 4chan. Then he'd know jews did WTC. --The Emperor Kneel before Zod! 21:17, 29 August 2011 (UTC) - On Bachman - well, you know... i guess when her presidency fails, she can say "it's all The Gay's fault." As for the right, what I love is that places that are hot spots for gay activity are never trashed by god... but the "bible belt" frequenly is, by Tornado Alley. sheesh.En attendant Godot 21:24, 29 August 2011 (UTC) - Classic example of "By saying "God did it!" only when you've been blessed with a baby girl, and just-not-thinking "God did it!" for miscarriages and stillbirths and crib deaths, you can build up quite a lopsided picture of your God's benevolent personality." hat tip Sickeningly, in Bachmann's case the equivalent of being blessed with a baby girl is a city fully of morally reprehensible people being destroyed by a hurricane. Tetronian you're clueless 21:43, 29 August 2011 (UTC) - Putting aside the religion part of it, and accepting her explanation that this was an obvious joke. How tasteless can yo uget? Does she really think disasters that kill fellow human beings (remember, she's pro-life) are so hilarious? SirChuckBCall the FBI 21:50, 29 August 2011 (UTC) - Yes. It's easy for us humans to dehumanize The Other to the point where their lives aren't worth the same as a "real" person's. After 9/11, I remember people saying that the hijackers were "cowards" and "evil" and that they deserve to be tortured - it's not much different. Tetronian you're clueless 00:16, 30 August 2011 (UTC) - On that note, you must have to have some considerable chutzpah to call someone who would knowingly board an airplane and fly it into a building and certain death (planned and known years in advance, may I add) a "coward". Crazy, yes, insane, almost certainly, but we must other be living in a world where "cowardice" doesn't mean what I think it means! ADK...I'll litigate your fib! 00:27, 30 August 2011 (UTC) - My memory is hazy, but I believe the speaker (my uncle) meant that they were cowards because they attacked the US using covert/terrorist tactics rather than openly declaring war. This is, of course, an incredibly stupid thing to say, but it was a few days after the attack and everyone was letting their emotions and cognitive biases do their thinking. Tetronian you're clueless 00:32, 30 August 2011 (UTC) - Bachmann is more of a shyster than a loony, I think. When she was in the State Senate she was grandstanding by pushing boilerplate wingnut bills like the "Academic Bill of Rights." ListenerXTalkerX 00:36, 30 August 2011 (UTC) - How quick everyone forgets, Michael Moore claimed Hurricane Gustav was proof there is a God in heaven. nobsI am a fugitive from an ideological fever swamp 03:44, 30 August 2011 (UTC) - Then Michael Moore is not much better than Michelle Bachman in this respect.--User:Brxbrx/sig 03:48, 30 August 2011 (UTC) Michael Moore is a private citizen and not an elected official. Nobody cares what he thinks. B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 03:51, 30 August 2011 (UTC) - The point is, McCain even proposed delaying the RNC Presidential nominating convention in 2008 and it was opened with a big prayer rally for Gustav victims. That's how gun-shy GOPers are about getting blamed for natural disasters. Irene showed how scared politicians are of being "Katrina'd". It soon to be the boy who cried wolf: politicians order evacuations, but when the hurricane takes another track, people will ignore it next time. nobsI am a fugitive from an ideological fever swamp 04:00, 30 August 2011 (UTC) - Errr no, the point is Bachmann thinks god is punishing the US due to Government spending. Aceof Spades 04:08, 30 August 2011 (UTC) - RobSmith, do you have any idea what this is even about? You're trying to defend Ms. Bondage by comparing her to a harmless fat guy who uses sarcasm once every five minutes. Osaka Sun (talk) 04:23, 30 August 2011 (UTC) - @Rob I am a left leaning liberal. Please do not make the mistake of assuming that Michael Moore speaks for me. Hell, I'm probably closer even to Obama's politics than to Moore's :). DamoHi 09:55, 30 August 2011 (UTC) - That goes both ways, Damo. Though I don't believe you've made any such implications, maybe Rob doesn't like Michelle Bachman?--User:Brxbrx/sig 11:24, 30 August 2011 (UTC) - God punished ancient Eygpt for overspending (or overconsumption) when Pharoah dreamed of 7 skinny cows eating 7 fat cows. Or maybe all that stuff about Joseph being Grand Vizier is just fairy tales, huh? nobsI am a fugitive from an ideological fever swamp 23:25, 30 August 2011 (UTC) - Given the lack of historical evidence for the seven plagues outside of one certain book - I'm with the fairy tale brigade. Bob Soles (talk) 23:30, 30 August 2011 (UTC) - That pre-dates the plagues by... what, a few hundred years is most dating. And Exactly when did God sending 7 years of Great harvest, a man who could tell you about that and what you should do when the seven years of famine come along = a judgement?--Mikalos209 (talk) 23:35, 30 August 2011 (UTC) - 7 fat cows and 7 skinny cowes is the boom-bust cycle; Joseph's plan was a big government solution that required reduced consumption and forced national savings for the long run outlook. nobsI am a fugitive from an ideological fever swamp 20:09, 31 August 2011 (UTC) - If it was a judgement god would have sent 7 years of straight famine, or 14, or not sent Joseph to interpret the dream. Telling the Pharaoh that he was going to get 7 years of awesome and 7 years of suck (which is mitigated by having a guy who knew what to do to make the 7 years of suck ok)is anything but. Also, the implication that not dying of mass starvation is bad because it required "Big government plans and rations" is hilarious. --Mikalos209 (talk) 23:44, 31 August 2011 (UTC) Whooping cough[edit] Anyone have any cures for a cough that may or may not be whooping cough? AMassiveGay (talk) 22:38, 30 August 2011 (UTC) - Are we talking about a small child here? Bob Soles (talk) 22:44, 30 August 2011 (UTC) - NHS Direct. Of course, universal vaccination.... Bob Soles (talk) 22:45, 30 August 2011 (UTC) - No children involved. My flat mate has had a particular severe cough for the last month, and now i have a nasty cough. Ithink the vaccination boat has already left. Besides, I had whooping cough as a child so I thought I was immune. Apperently it's not a lifelong immunity. AMassiveGay (talk) 22:59, 30 August 2011 (UTC) - I would like to avoid going to the Docters if I can avoid it. AMassiveGay (talk) 23:00, 30 August 2011 (UTC) - Given that it would seem to require antibiotics - then that might be your only course. Mrs Soles tends to suffer from lingering coughs until she finally gives in and goes to the docs. Of course, IANAD. Bob Soles (talk) 23:18, 30 August 2011 (UTC) - Yeh thats the impression I get, regarding antibiotics. I'm not convinced that it is whooping cough because there are no other symptoms - I don't feel ill and neither does that my flatmate. Its just the length of time he's had the cough, and where he probably picked it up (a festival for kids we attended with his neice and nephew). I think maybe his immune system is pretty shit - his is not an especially healthy lifestyle AMassiveGay (talk) 23:29, 30 August 2011 (UTC) - And what does IANAD mean?AMassiveGay (talk) 23:36, 30 August 2011 (UTC) - My guess is I Am Not A Doctor. But that's just a guess. DickTurpis (talk) 23:40, 30 August 2011 (UTC) - That's the bunny. You're best off not relying on the medical advice of some guy on t'internet. Bob Soles (talk) 23:42, 30 August 2011 (UTC) - Umm, IANOD, but bronchitis, especially if your flatmate's immune system is on the west-end of the bell-curve. Keep an eye on it. A lot of feeling shit when ill is the abuse your immune system is giving your body. If your immune system isn't in a good place then you could actually have something like pneumonia or bronchitis and feel pretty good, apart from coughing up bis of your lung, of course.-- Spirit of the Cherry Blossom 00:04, 31 August 2011 (UTC) (undent) Guaifenesin, which is over the counter in the US, can be effective for a chronic "productive" (i.e., lots of secretions) cough. Dextromethorphan can suppress the cough process itself, but you may be coughing for a reason. There are a few other prescription drugs that can help exhaustion from coughing. It really sounds like something that needs to be examined, and probably to get throat and sputum cultures. Some antibiotics can reasonably be prescribed before the culture, based on presentation. There's a good deal of local variation, however, in bacterial sensitivity, so the choice really is something for a local clinician. Chicken soup does have its role. Howard C. Berkowitz (talk) 08:52, 31 August 2011 (UTC) - I think I was too hasty in my initial self diagnosis. My cough has eased up considerably today, as has my flatmate's month long coughing fit. AMassiveGay (talk) 00:47, 1 September 2011 (UTC) Increase my viewcount![edit] Ok, I'm going to get right to the point. When I do video rants on youtube, I get few page views. Like, less than 10. I just did one on Glenn Beck causing the hurricane and earthquake that hit the united states last week, in jest mind you, and I thought I would post a link here Enjoy, and be sure to comment. I'm also thinking of doing a weekly blog when I start college next week, so feel free to swing on over and check it out. (Yes, I'm aware no one watches video blogs, but I do this to help with my public speaking.) --Thanatos (talk) 21:09, 30 August 2011 (UTC) - Are you worried they're just not any good, or are you just trying to spread awareness of a genuinely good product that you think is just being overlooked? If the latter, I suggest doing what I try to do (sparingly): linking to your personal work only when it is pertinent to a discussion.--talk 04:37, 31 August 2011 (UTC) - Get lost Terry, we don't want you pimping your blog on our site. ГенгисIs the Pope a Catholic? 15:13, 31 August 2011 (UTC) - Oh wait, you're Thanatos not Temlakos. ГенгисIs the Pope a Catholic? 15:14, 31 August 2011 (UTC) - The Thanatos of Freudian analysis? That guy has something very specific in common with Temlakos: he makes you really, urgently, desperately want to stab someone in the eye. Angry Blue (talk) 15:35, 31 August 2011 (UTC) - I'm not really good at talking to new people. I figured if I can talk into a camera and put it up on the net for strangers to see, it might help. I have been socially isolated in a small village for the last 3 years. Although I do tend to get along with people a good bit older than me rather than people my own age.--Thanatos (talk) 17:03, 31 August 2011 (UTC) - I'm not sure that talking to your computer is the best way to overcome social awkwardness.--talk 00:02, 2 September 2011 (UTC) - Your probably right, but I find I haven't been freezing up as much anymore as well as having less long pauses and repetitive usage of words lately. Now I don't do retakes because of 10 second long pauses but because my mic didn't work.--Thanatos (talk) 03:18, 2 September 2011 (UTC) - Yes, making videos will probably make you better at making videos. And there might be some peripheral skills that translate, like elocution. But the best way to learn how to talk to new people is to talk to new people. Join a club.--03:33, 2 September 2011 (UTC) Right wing attack on Elton, odd laguage[edit] So, it's a right wing, Christian Life rag. But what the heck. OBTAINED? like you went to the store to obtain the right parts to repair your car? "The Harps Food Inc. location in Mountain Home, Arkansas covered the photo of Elton John, his same-sex partner, and the baby they recently obtained using a surrogate mother after receiving complaints from customers last week. " I don't know if it's some intentional put down, or (more likely given the rest of the writing) just incompetent use of the English language. En attendant Godot 18:23, 30 August 2011 (UTC) link - Considering it is Elton John, I think 'obtained' is probably the right word. Mr John is a terrible human being. AMassiveGay (talk) 18:29, 30 August 2011 (UTC) - And his music makes my ears bleed. AMassiveGay (talk) 18:30, 30 August 2011 (UTC) - Yo AMG, I'm really happy for you and I'mma let you finish but Kanye West is the worst musician of all time. OF ALL TIME! HollowWorld (talk) 04:53, 31 August 2011 (UTC) - "Obtained" may well be an appropriate word in some cases. I'm pretty sure you could say that with Madonna, in particular. ADK...I'll terrorize your escape pod! 23:29, 1 September 2011 (UTC) Cracked's 5 Embarrassing Failures History Class Turned Into Victories[edit] The one about the Tet Offensive is a little bit off to me.Ryantherebel (talk) 14:34, 31 August 2011 (UTC) - The one about Tet seems about right to me. The one about Dunkirk is stupid. Angry Blue (talk) 15:06, 31 August 2011 (UTC) - The Dunkirk thing is, to quote one of my favourite films, "Never give up, never surrender!" At a time when, yes, we had just been thoroughly beaten, we needed every boost available. Nobody was dumb enough to know that we hadn't lost, and, yes, the troops came off the beaches will hand luggage only, but they came off, and that was the key thing. We didn't give up, we went across and got them in anything that would float. Bob Soles (talk) 15:36, 31 August 2011 (UTC) - Yeah, that's exactly what bugs me about the Dunkirk part. They make it sound as if Dunkirk was an unmitigated disaster, couldn't have possibly been any worse, and anyone who saw any silver lining in it was just deluded. BZZZT WRONG. Angry Blue (talk) 15:39, 31 August 2011 (UTC) - Depends which way you look at it. The dunkirk evacuation itself was a boost for morale and a pretty good thing by itself, but the events leading up to it were a failure. No matter how inspiring or uplifting the idea of anyone with a boat slogging across the channel to pick up soldiers is, at the end of the day, the entire british army got kicked the hell off the continent and left behind a fuckton of equipment that almost crippled them. An inspirational retreat is still a retreat. X Stickman (talk) 15:58, 31 August 2011 (UTC) - The Dunkirk one ends with "The only saving grace is that it could have been much worse", so I disagree with Angry's description. The truth is that Dunkirk was the last stage of a really, massive and humiliating defeat. If it wasn't for Rommel reporting that he was being attacked by "hundreds" of enemy tanks at Vimy Ridge, causing a big delay while the German high command collectively shat its pants and awaited a huge flank attack, the entire Allied army would have been captured. Even with the delay, the memorable thing about Dunkirk is the fleet of civilian ships that came to assist rather than anything to do with the armed forces. Even Churchill called Dunkirk an escape. –SuspectedReplicant retire me 16:03, 31 August 2011 (UTC) - (fucken EC) Yes, but the Germans would have completely annihilated the whole force if Hitler hadn't listened to Göring. Remember there was a huge German tank army there that was ordered to come to a full stop because Göring wanted to demonstrate how casually he could finish off the Brits with his handful or two of assault airplanes. Whatever Dunkirk was or was not, it was incredibly much better than what could have been. That's why I'm skeptical when Cracked implies it couldn't have possibly been any worse. Angry Blue (talk) 16:09, 31 August 2011 (UTC) - Cracked doesn't say it couldn't possibly have been worse, like SR said, the last line of the article is "The only saving grace is that it could have been much worse". Also the impression I get from the article is not so much that the dunkirk evacuation itself was bad, but the events leading up to it and immediately following it are. The army got beaten back so badly that they required heavy civilian assistance to evacuate before being destroyed, and they had to leave behind tens of thousands of vehicles, heavy guns etc... That is a humiliating military defeat. That the only real way it could have been worse is "the entire army got killed/captured" is pretty revealing. X Stickman (talk) 16:15, 31 August 2011 (UTC) - Ah, yes. You're absolutely right about those things. Angry Blue (talk) 16:33, 31 August 2011 (UTC) - Dunkirk is not about celebrating victory. We knw we lost. It's like that bit in every boxing movie that's ever been made where the fighter has just taken a massive blow and is lying on the canvass bleeding heavily and his little boy shouts out "Dad! Dad! Get up Dad!" - and he does. That's what it felt like. We were flat on the canvass bleeding heavily but we struggled back to our feet. What we celebrate in "The Dunkirk Spirit" is not rolling over when you've been thoroughly and humiliatingly beaten. OK, so to survive we needed a great deal of luck and, eventually, when they bothered to turn up, the help of our colonial cousins but, right there, right then, we felt that we stood alone against an unstoppable force. That's why the "we will fight them on the beaches" speech is so important, so much part of who we are and it's deeply tied in with The Dunkirk Spirit. In short - we know we lost. We celebrate not a victory but national character in defeat. Bob Soles (talk) 16:34, 31 August 2011 (UTC) - If I may interject, it sounds like you guys seem to be taking personal offense to an article on a comedy site. Cool down the patriotism a bit. HollowWorld (talk) 16:55, 31 August 2011 (UTC) - I don't think anyone's taking offense as such - I'm certainly not. On the other hand, I've heard people in the UK talk about the "victory" at Dunkirk, and that does annoy me. Bob Soles, the phrase "Dunkirk Spirit" describes the fleet of little ships, not the battle itself. I've already said that this was the most memorable thing about the battle. –SuspectedReplicant retire me 18:35, 31 August 2011 (UTC) - The title of the Dunkirk section 'the Miracle of Dunkirk' kind of defeats the premise of the piece. No one claims it was a miracle because we had won anything, it was a miracle because we weren't all slaughtered on the beach. As Bob says, we are not celebrating victory the national character in defeat. Similar to the 'Spirit of the blitz' - keeping calm and carrying on in the face on continual aerial bombardment (why nations that we bomb the shit out are not perceived to have this 'Spirit', i don't know). Similarly. Galipoli WWI is seen as formative nation building in Oz and New Zealand, and that was an unmitigated disaster. I think events such as Dunkirk help former imperial powers like Britain mature as nations and dissuade us from the notion that we are masters of all that we surveyAMassiveGay (talk) 00:16, 1 September 2011 (UTC) - The Scott one to me is odd. If Scott had succeeded, he'd be just (relatively) as Amundsen, or the guy who got to the north pole (who without looking on wikipedia, I cannot name). The are thousands of explorers who pretty discovered all kinds of places who remain obscure to most people. Scott is not remembered for victory of any sort, nor does any use spin that way. He is remember because he failed spectacularly. Tragedy makes for a better story compeling story. The article its self makes this point. Scott didn't just set out into the wilderness and was never seen again, his body was found, along with his journal so we are able to piece his last days adds to the tale. The story of Amundsen is just not as interesting. I think Scott is seen as a heroic failure, and in my mind that makes a better story. This is why it has endured. And with Captain Oates going for a walk and taking his time about it, you have herioc sacrifice added to heroic failure. AMassiveGay (talk) 00:44, 1 September 2011 (UTC) - Dunkirk, for what it was which was a rapid and difficult retreat after a severe ass-whooping, was a victory. It's all relative, really. D-Day ended up with thousands of people dead on the beaches before the invasion even began properly, therefore it was quite a heavy blow to the allied forces. Japan surrendered after being nuked saving millions of Japanese lives by avoiding a potential decade long shitstorm, therefore it was a victory for them. So Dunkirk as a mission to save 300,000 lives worked brilliantly, the events leading up to it as a campaign for the BEF to fight back the blitzkrieg, less so. Countless little defeats and little victories make up history and it's only once the dust has settled we dare to construct any kind of narrative about it. Indeed, the whole concept of victory and defeat in war is remarkably recent, if I remember Time Commanders properly. The results of battles used to be viewed in far less subjective and emotive terms than "victory" and "defeat", as if ancient civilisations recognised that such things are far more complicated than we care to admit these days. ADK...I'll edit your classified ad! 00:18, 2 September 2011 (UTC) - Blitz spirit is a "die hard" thing. So a country which surrenders, probably at the sole discretion of its military leaders, after a few weeks of bombing, is not exhibiting "Blitz spirit". The belief was (and now there's no way to ever test) that the British would fight on to the bitter end, if the Americans wouldn't come, if the Irish wouldn't stand up and fight, if Russia fell too, that there would be British civilians in the rubble of London when the tanks rolled in still determined to "take one with you when you go" as the propaganda posters put it. It's typically British to focus on what they signed up to but never had to actually face, while the far side of the channel some people really did keep fighting in the face of certain death, knowing that occupying German forces would use torture and burn whole villages to stop them. 82.69.171.94 (talk) 10:01, 2 September 2011 (UTC) - I think you are confused. The 'Blitz spirit' was not at all some kind of die hard death or glory sentiment, it was about pulling together, keeeping calm, and carrying on. 'Take one with you when you go' is a new one on me. Would seem to me counter productive as propaganda to tell folk to remind people of impending death during an air raid. AMassiveGay (talk) 13:34, 2 September 2011 (UTC) - I probably did get a bit carried away there, indeed for the average Londoner the Blitz was more about "carrying on" despite it all. However "Take one with you..." is real British wartime propaganda, I've seen the posters. It's from the same dark period as "We shall fight them on the beaches", when a German invasion seemed credible, even imminent. Today we have the Operation Sea Lion plans and we can see they were never close to fruition, but Churchill did not have this luxury. 82.69.171.94 (talk) 16:02, 2 September 2011 (UTC) - Yes, the French resistance was pretty hardcore and certainly the surrender of France doesn't make the place worthy of the "cheese eating surrender monkey" reputation, but I don't think that has anything to do with the whole "Dunkirk Spirit" or "Blitz Spirit" as it's known. We know some of Churchill's plans in case of invasion, and they were pretty fearsome, but who knows how they would have gone down if it came to it. ADK...I'll bamboozle your copy-paste! 19:23, 2 September 2011 (UTC) Something a little less controversial[edit] Unfortunate pictures. ГенгисIs the Pope a Catholic? 17:31, 31 August 2011 (UTC) - The rifleman has wood! CrundyTalk nerdy to me 22:49, 31 August 2011 (UTC) - The guy who photoshopped the Rooney/Ronaldo one could have at least 1) removed the black outlines around Ronaldo 2) cut out the parts between his arms and 3) though I say this only as a pedant, corrected the colouring, grain and depth blur for both images to match and then burned a few of the shadows so the light sources matched up. Other than that... ADK...I'll rinse your noun! 23:23, 1 September 2011 (UTC) - If only we could photoshop real life. CrundyTalk nerdy to me 08:59, 2 September 2011 (UTC) - You know, Content-Aware Fill could actually do most of that... ADK...I'll construct your arc welder! 23:47, 2 September 2011 (UTC) Tawny Port[edit] Discuss. Junggai (talk) 19:01, 31 August 2011 (UTC) - This, right?--User:Brxbrx/sig 20:42, 31 August 2011 (UTC) - When I was seventeen, I loved the $8 Tawny port... many a memorable evening was had as a result. (((Zack Martin)))™ 06:56, 1 September 2011 (UTC) - Ah yes, the memories... sunset over the old quarry, campfire and bumwine... Angry Blue (talk) 09:43, 1 September 2011 (UTC) - I had never really taken port seriously until a friend of mine gave me a set of five miniatures, which includes some actual good stuff. Fortuitously, I started reading Graham Greene's The Human Factor, in which one of the characters collects vintage ports. "Vintage ports?" I thought. It seemed like a contradiction in terms. So I started drinking a glass of port in the evening while sitting down with Agents Davis and Maurice Castle, and grew a liking for it. - I was just curious if anyone's tried any of the fine stuff, and if it's worth taking money away from the single malt fund. Junggai (talk) 19:16, 1 September 2011 (UTC) - Wouldn't know; never had any upmarket port as far as I can remember. We bought cheap ports and bottled sangria because we were kids and didn't have any money. The local Mondo would sell you a 700 cc bottle of Chateau Migraine fortified paint thinner for under öS 10. One bottle was enough, except if you had a date for the quarry, in which case one bottle was way to much. Angry Blue (talk) 19:45, 1 September 2011 (UTC) - Just so long as it wasn't Sturm, eh? Junggai (talk) 06:29, 2 September 2011 (UTC) - Nah, we just didn't have any sturm in late spring to early summer. If memory serves the heurigen in the area would typically start selling sturm in early October; much too cold and dark for this kind of party. Angry Blue (talk) 07:03, 2 September 2011 (UTC) - Maybe it was just a cold summer, but they've actually started selling it here already. Junggai (talk) 07:48, 2 September 2011 (UTC) - This is either seriously unusual or I was seriously misremembering things. Blue So Angry It's Basically Purple (talk) 07:53, 2 September 2011 (UTC) - My suspicion is the former, after a whole summer's worth of October-like temperatures. Some of the trees even changed colors in July. Junggai (talk) 08:09, 2 September 2011 (UTC) - Crazy. Here in the Balkans it was actually fairly hot most of the time. Did just the chestnuts turn red, or did everything? If it's just the chestnuts, it's parasites. Blue So Angry It's Basically Purple (talk) 16:40, 2 September 2011 (UTC) - For sure not everything changed. The ones I saw whose leaves had changed were a kind of maple tree. Of course, parasites can't be ruled out with those, either. Junggai (talk) 19:45, 2 September 2011 (UTC) - I've got a case of '83 Dow Portofino. Can't give the shit away. Occasionaluse (talk) 19:47, 2 September 2011 (UTC) - Is it really that bad? Junggai (talk) 19:49, 2 September 2011 (UTC) - Heavy sediments, extremely rich and sweet. You've got to strain it. It's good for a sip and then people lose interest or get sick. Occasionaluse (talk) 19:55, 2 September 2011 (UTC) Bombadier beetles[edit] It looks like Creationists regularly misrepresent those little beetles, here,s Iron Chariots on Creatures that Defy Evolution and see Bombardier Beetles and the Argument of Design. Proxima Centauri (talk) 11:31, 1 September 2011 (UTC) - There was one creationist, I can't remember which one, who believed that hadrosaurs breathed acidic "fire" and were therefore the dragons mentioned in the Bible. He liked to cite bombardier beetles as precedent. We probably have an article on the guy if anyone can remember his name. --JeevesMkII The gentleman's gentleman at the other site 18:16, 1 September 2011 (UTC) - Google says Duane Gish and RW seconds the motion. Though he's crazy enough, I could swear he wasn't the one I was thinking of. --JeevesMkII The gentleman's gentleman at the other site 18:23, 1 September 2011 (UTC) - Dragons you say? Reminds me of the video in which a creationist hypothesizes that dragons were actually apathosauruses whose relatively small nostrils caught fire when breathing in the post-Flood oxygen deprived atmosphere due to air friction. Behold. - I fucked the girl in Hanson (talk) 22:22, 1 September 2011 (UTC) - This is where I actually feel embarrassed for these people. ADK...I'll duel your contradiction! 23:14, 1 September 2011 (UTC) - Embarrassed? Nonsense. Just ask PJR about dragons. --Horace (talk) 23:22, 1 September 2011 (UTC) - Good old PJR. He'll credulously accept it for you wholesale. --JeevesMkII The gentleman's gentleman at the other site 08:53, 2 September 2011 (UTC) Math & font help[edit] I just wrote a line about a planck time, which is 10 to the minus 43 seconds. But i have no idea how to write that in wiki-script such that i get the nice little superscript -43 part. The article is virtual particles, and the mention of planck time is in the refs, if anyone's willing to help.En attendant Godot 17:55, 1 September 2011 (UTC) - You can do it in LaTeX, Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): 10^{-43} , or in ordinary Wiki markup, 10-43. ListenerXTalkerX 18:04, 1 September 2011 (UTC) - Thanks, changed.En attendant Godot 18:13, 1 September 2011 (UTC) - All I see is "math math gobble gobble gee math math." I am opposed to formulas on a human rights basis, because they make me feel ignorant.--talk 00:01, 2 September 2011 (UTC) - Formulae are useful in recipes. Scaling a family dinner entree to feed a multitude is often non-linear. While "it's complicated" will sometimes pacify the math-averse, an occasion can go badly astray unless the chef has a better handle on things. Sprocket J Cogswell (talk) 12:34, 2 September 2011 (UTC) Music, politics, and endangered forest species[edit] Those valiant Republican Gibson guitar makers in the right-to-work state of Tennessee are being harassed by the minions of the Obaministration, according to Glenn Beck's loyal chorus line. Sprocket J Cogswell (talk) 20:31, 1 September 2011 (UTC) - I love how Glenn Beck's biggest source for his information on this article is, you guessed it, himself! Professor Chaos (talk) 10:43, 2 September 2011 (UTC) Magnetic fields[edit] I remember us having a creationist paper mentioning the Earth's magnetic field decaying so quick it must "prove" a young Earth. Anyone remember it at all? I'm reminded of it because this week's Horizon (iPlayer, if you can get it) is about the Earth's core and concludes on the field and how it decays, alters and reverses. Iron crystals 10 km long, periods where the Earth has two north poles, really fun stuff. ADK...I'll deceive your monkey! 23:11, 1 September 2011 (UTC) - A quick search on magnetic decay pulls up this and this. Of course there's Hovind. On TO there's this. Pippa (talk) 10:46, 2 September 2011 (UTC) - The thing is, they can't even get their stories straight in and amongst themselves. One lot think that you can extrapolate the rate of field strength decay back in to the past to get an idea of the age of the earth (snork!) and another lot think that field reversals are evidence of a young earth (double snork!) Any excuse will do when you're a creationist. --JeevesMkII The gentleman's gentleman at the other site 13:35, 2 September 2011 (UTC) - Actually, I have remembered and the one I was talking about was on the FSTDT forum, not here. But I think Jeeves is almost there with the right creation.com article, though it doesn't feature the hilariously butchered and cherry-picked graph that I was thinking of. ADK...I'll pass your Subaru! 19:14, 2 September 2011 (UTC) Action T4[edit] Fuck the Nazis. Fuck them all to hell. Every time I look back to history and hear of them it's always something monstrously abominable. I wish there was some supernatural afterlife so they could spend a few centuries worth of penance. I wish I could go back in time and hold their heads and make them look at their crimes. I wish I could go inside their minds and make them understand the suffering their victims felt. I read this article and I was filled with disgust and fury. May we never forget these inhuman monsters, and let us be ever vigilant towards similar perverts today and tomorrow.--User:Brxbrx/sig 18:01, 29 August 2011 (UTC) - And fuck the creationist assholes who will blame Darwin and "evilution" for it! 74.89.192.173 (talk) 18:04, 29 August 2011 (UTC) - "Every time I look back to history and hear of them it's always something monstrously abominable." No shit? And their demented offspring are still around. Nebuchadnezzar (talk) 18:09, 29 August 2011 (UTC) - See this speech of U2 in their 1990s Bowie phase, including probably the best anti-Nazi quote available. Osaka Sun (talk) 20:11, 29 August 2011 (UTC) - Translation of that poster on WP reads: "60,000 Reichsmarks is what this person suffering from a hereditary disease costs the People's community during his lifetime. Comrade, that is your money too." - Hmmm, so basically they're arguing against universal health care, right? Funny that. ADK...I'll construct your potato masher! 00:29, 30 August 2011 (UTC) - I'd disagree, that's an extrapolation; it's an argument for a big government solution, euthanasia. Nazi's never proposed cutting or eliminating single payer, in fact, they introduced it: The National Association of Sickness Fund Physicians . [2] - nobsI am a fugitive from an ideological fever swamp 03:35, 30 August 2011 (UTC) - It's Social Darwinism through universal healthcare. Thus, it serves the (stated) goals of neither modern American party--User:Brxbrx/sig 03:43, 30 August 2011 (UTC) - It should be also be noted, physicians (who are also scientists) "joined the Nazi Party in greater numbers than any other professional group." nobsI am a fugitive from an ideological fever swamp 03:52, 30 August 2011 (UTC) - Shame on them.--User:Brxbrx/sig 03:54, 30 August 2011 (UTC) - That's because they were white. --145.94.77.43 (talk) 00:45, 31 August 2011 (UTC) Something smells rancid here. Nice try. You're our token conservative here, right? And the Godwin's Law anti-science comment, I'd love to see Einstein's reaction to that if he were alive today. Considering that the Nazis forced him to reject pacifism and contact FDR urging to nuke the hell out of his home country. Even more so, he was a Jewish socialist. Oh, the paradoxes! Osaka Sun (talk) 04:02, 30 August 2011 (UTC) - Good cite. So it would be safe to say then, the world's first & oldest universal healthcare system at one time proposed (or actually implamented) a euthanasia program to trim costs (something akin to death panels), not so? nobsI am a fugitive from an ideological fever swamp 23:21, 30 August 2011 (UTC) Universal care[edit] - No. The first health care system inplemented in Germany was during the Reich (Kaiserreich, a.k.a. "German Empire"), 1883 to be exact. It was reaction against the rise of socialist, communist and social democratic forces tosave the aristocratic asses from being slayed by the masses. Guess what, the German health care system then and today are basically the same thing. This thing has worked for almost 130 years. Btw, not being able to pay for health insurrance at all because you don't have any provided is natural euthanasia also known as "natural selection". - Back to the original point - or at least in it's neighbourhood: In German schools we have the Nazis in history. Especially the Holocaust and their rise to power when the kids are around 13/14, in most schoolbooks there are pictures of killed Jews on piles, naked and nothing censored - believe me that shocks the living shit out of most people. - Because my aunt is mentally disabled (some virus messed her brain up, don't ask me for details), my grandfather was involved with several projects for these people - I have heard of these things before in detail. Yes, it's absolutely discusting. And the worst thing abput it was, even if you were strongly against it, you couldn't even say anything, because everybody could tell on you. --★uːʤɱ libertarian 23:47, 30 August 2011 (UTC) - You're right, save the part about "it's worked for 130 years" excluding the euthanasia program (also known as rationaling or death panels). And you've made a good point as well about these socialist programs being introduced (or imposed) by "the rich" and powerful aristocrats (not a workng class rebellion from below) and how it came about as a trade-off for basic citizenship rights and human freedom. nobsI am a fugitive from an ideological fever swamp 17:43, 31 August 2011 (UTC) - I wouldn't exactly say that a program with the only puropose to kill people was a "health care program", because well, killing people is pretty much the opposite of looking out for their health. I don't know how the American mentality is on this but over here nobody wants to be without health insurrance. I know for example that my father is currently paying 9€ (that's I think around 11 or 12$) every month for health insurrance for three people (!), and if we get seriously sick (cancer, tumors etc.) it won't cost us a dime. If I think about paying 9 bucks a month for almost fourty years (4320€ in working lifetime if you're an academic) and maybe having to pay 50.000 bucks for a whole round of treatment, my desicion is pretty clear. Have a referendum and most people will want it. --★uːʤɱ digital native 17:59, 31 August 2011 (UTC) - Yes, sounds good. But do you honestly think 4320 Euros (about US $3000) covers the actual or real costs over a lifetime? Where does the subsidy come from? the rich? corporations? Not really. It's paid by lower living standards, lost job opportunities, and no job opportunities at all for some of you fellow citizens as a part of the national income is mandated for expenses that individuals themselves either cannot pay, or refuse to pay. It's paid in a loss of competetiviness, by world standards. And the cost is not distributed evenly -- some citizens benefit quite well, while others pay dearly. Some make the equivlent of US $60,000 per year, and pay $12; others can never find a job (because of the loss of competetivieness), spend a lifetime on the dole and skid row, and pay $12. But all have equal access. nobsI am a fugitive from an ideological fever swamp 20:03, 31 August 2011 (UTC) - But Rob, that argument could be used for any service the state provides. OK, OK, so you're all for small government but, we Brits - and, indeed, most of the rest of the western world - feel that health care is as essential as, say, schooling. Maybe you feel that schooling should be optional. All those rich but childless persons subsidising those poor people who breed like rabbits. Nah, if they can't afford school then let them go to work down the pits. That'll learn them. Bob Soles (talk) 20:19, 31 August 2011 (UTC) - Bascially, what Soles said but much more refined. First of all there's an "that's worth it culture" in Germany. And if you actually look at the costs, it's not even that much, if a big company without these costs makes let's say 52 million a year and you take for example the costs of my father who makes around 1200€ a month of which 9€ go into health care from the companies side that is 0.75% of the costs, which would generate a costs increase of 390,000€ a year (or about that much as the amount to pay is a percentage of the income). And looking at the money they put in and out of companies each year 390,000€ isn't much. Especially if you work with profit margins of around 200% (and even that is very genuine as many go for the 400%-500% range). Through 0.75% you don't create jobs, just closets of purses more for the wife of the manager. The old "as more costs you have as less jobs you have" is a myth, because only a small percentage of what companies actually make goes into the creation of jobs - and jobs need demand. Companies are not going to create jobs until they can be sure that said jobs can be financed - that's why if people keep buying you can almost always say that everything will be fine in the economy (precisely what the Germans did when banks fucked it up a few years ago, people just kept buying because they almost knew they weren't going to be poor within a month). - Also there are other effects onto the market, you won't have so many people that are chronologically ill as the common insurrance can provide better treatment than a half-assed loan from a bank. People generally feel better (as least most people I know would) if they know that if something happens to them they wont have to sell their business, house, car of even more substantial things, they are more willing to invest money into the market and buy stuff - no matter how superficial that stuff might be. But then again if you have a bunch of crazy people in your country saying that all will end soon because a tax that effects 10% of the people might get increased 0.2% that has psychological effects than do much more demage than a tax increase ever could. - On a theoretical level, you are right, one can't be forced to pay for these things, but on a practical level you could annul all the state does with this logic (police, military, granting religious freedom, schools, roads, firemen, etc). Maybe it would be better to see certain laws like a law that forces motorcyclist to wear helmets (we have it over here, I have no clue if you have it in the US): it's a law because allowing it would do much more demage than banning it ever could. --★uːʤɱ pirate 20:56, 31 August 2011 (UTC) - So how much of overall healthcare costs in Germany are subsidized from other sources? the 9 euros a month may pay for one annual checkup with a general practitioner once a year, according to my estimates. But it never would pay any specialists, nor the salaries of dozens of others associated with the medical occupations, radiologists, pharmacists, nurses, receptionists, janitors, nor operating costs of facilities, improvements, replacement, or medical research. So the 9 euros is largely symbolic. It's intended to make a person feel they have a stake in the system, and even a right to demand benefits, while relieving them of the burden of responsibility. But it does little, if anything, to make the fruit of other people's labor (that is, those who work in medical fields) available to all. nobsI am a fugitive from an ideological fever swamp 23:29, 31 August 2011 (UTC) - Huh? Health Care in Germany is available to all. The 9€ is just what my father pays with his low income, insurrance class etc. pays - the real deal is percentage depending on what you earn and if you have kids. The 9€ also is only one part of the two halfes as in Germany the employee and employer cut it 50:50 so actually that's 18€ a month and 216€ a year. That's worth way more than a check up… But my father (and my mom and me with that) are insurred with the "public" common insurrance (AOK) that has 24 million customers and works on a income=outcome (if there's word for that please let me know), others have different insurrance companies that are more costfull but generally secure the further existence of the system - because they don't get rationalized that easy. Hospitals are run by cities, universities and companies - but none of those are looking for profit. There's also a mentalaty here that we don't let our insurrances pay for everything (aspirin, paracetamol, the newest nice looking vitamin pills), first of all because that would cost them millions and second because that costs us almost nothing. Also, we don't pay doctors that well, a German doctor could never afford a sports car. They get paid but there aren't any big bucks in the medical business here, except for the pills (they also don't have to pay 110,000$ in student loans, maybe 10,000€ if their parents weren't rich - because we also have state loans and state universities for that). To answer your question, I only know that the German state gives a certain amount of money into the system each year to buffer things out. But this is really only a buffer for the yearly uncertainties of the insurrance companies, behind closed doors the state isn't running things. --★uːʤɱ sinner 00:18, 1 September 2011 (UTC) - A German general practicianer averages US $123,000 per year (compared US stats), or about $60 per hour based on a 40 hour work week. The employer/employee premium of 216 euros translates to about US $150, or 2.5 billable hours for a German doctor. So by my reckoning, this pays about one annual checkup. As long as patient is healthy, there shouldn't be a problem. But if the checkup found a diagnosis & a referral to a specialists (at exponentially higher rates), the sliding-scale permiums would never cover the costs of treatment. (Is wp:sliding scale what you mean by income-outcome?). So the premiums a worker pays are largely cosmetic--a marketing gimmick, if you will, to create the idea that a worker has a right to services. The real costs are born by appropriations from parliament, the funding sources derived from a variety of things, most probably a vat tax or direct corporate income tax, I'd presume. This shouldn't be too hard to find out -- how much of the German healthcare sector is paid by premiums of employer/employees, and how much recieves direct subsidy or remibursement from government appropriations. And I agree, American doctors are grossly overpaid. It's what Milton Friedman calls a classic wp:Closed shop union -- by the medical profesion itself limiting the number entering the profession, they can keep competition down and pay high. And the idea that in a nation of 300,000,000 people, the US can't find enough people to educate as doctors, and we suffer shortages decade after decade which results in higher pay is just ridiculous, IMO. nobsI am a fugitive from an ideological fever swamp 20:10, 1 September 2011 (UTC) - What I meant wasn't "sliding scale" but non-profit, I think my brain stopped working there for a second. - So I researched that now and didn't even try to find an English version, anyway I'll be your translator for this post :) In 2006, according to this graph in this document from the Federal Statistical Office of Germany, 5.5% of the system is financed by the state - beware that "öffentliche Haushalte" doesn't mean the feds, but also the Länder (states), counties and cities pay here. Those 5.5% equal 13.4 billion € in the same year. In 2007 the overall budget was 1016.3 billion € - I'mway too lazy to calculate what the percentage is here but we both know it's rather small (around 1% I guess). The overall volume of the system is 245 billion €, with almost 70% coming from several insurances (which basically is a collective of patients that pay for each others costs commonly and a little bureaucracy doodled around the edges). If one considers further the backgrounds costs of such a system (education of doctors and nurses, making laws etc.) there might be even a bigger cost but considering the size of the budget that's all quite small. Anyways the German system is — as almost anything from Germany — unbelievably complex and bureaucracy driven. But still I would bet something that you won't simply find somebody on the streets here that thinks this system is generally bad and everything should be "privatized", seriously not even our laissez-faire guys believe that. - And kudos for staying on topic! Not being on CP seems to do you good! --★uːʤɱ sinner 21:58, 1 September 2011 (UTC) - This is very good information, and I'm reading it in Bing translator. I've heard (and I think Bill Clinton was the source) that German total healthcare costs are about 10% of GDP vs US where it's probably 15-17%. But this report also states Healthcare costs have risen 31% since 1995 vs only 16.5% consumer price inflation, so the German system is not immune to some of the same problems plaguing the US. The report also states total expenditure in 2006 were 245 billion euros (including the cost of buildings). So a total cost of 245 billion divided by 80 million Germans = 3062.5 euros per capita expense divided by 50% premium share provided by employers = 1531.25 euros per capita consumption divided by 12 months = 127.6 euros monthly, - minus the 9 euros you father pays = 118.6 per month subsidy of costs for himself, plus that of his entire family (127.6 x number of household members less the head of the household whom we've already counted). If my methodology is wrong in this analysis anywhere let me know. nobsI am a fugitive from an ideological fever swamp 17:41, 3 September 2011 (UTC) - Still way better than US healthcare--User:Brxbrx/sig 17:45, 3 September 2011 (UTC) Tumble weeds at it again[edit] Holy shit single largest day of incoming traffic ever at RW today. Tmtoulouse (talk) 07:57, 2 September 2011 (UTC) - Serious? Osaka Sun (talk) 08:06, 2 September 2011 (UTC) - Any idea why? Blue So Angry It's Basically Purple (talk) 08:07, 2 September 2011 (UTC) - "Scientific evidence of evolution being a hoax" is twittering madly. Pippa (talk) 09:40, 2 September 2011 (UTC) - Speaking of which: Rabbi Shmuley Boteach is shoving that "Evolution is only a theory!" crap again, I see [3]. Pippa (talk) 10:24, 2 September 2011 (UTC) - Its my fault, sorry. — Unsigned, by: 64.28.255.75 / talk / contribs - Again? It must only stop being funny when you've been staring at that article for three years straight. ADK...I'll scratch your amplifier! 19:11, 2 September 2011 (UTC) - Simon Singh just tweeted us [4] to 22,000 followers. Anyone want to extend and polish Galileo gambit really quickly? - David Gerard (talk) 17:34, 3 September 2011 (UTC) UN Story[edit] I normally don't go in for UN-bashing, since "the UN is horrible" is such a trope of the right, and I think the UN is, overall, worthwhile, at least in principle. This, though, is beyond disgusting. UN Peacekeepers in the Ivory Coast traded food for sex with underage girls. MDB (talk) 10:41, 2 September 2011 (UTC) - The UN is a talking shop. Giving nation states somewhere to talk, to find common ground where it exists, and to engage in debate and learn from each other is valuable and probably does prevent some unnecessary violence. Providing a forum in which non-state actors can address the nation states without having to painstakingly visit each one is also valuable. The UN's agencies on the whole are a force for good, and when they are not, every nation state, and in the democracies every individual through their state, can try to put that right. - But, at the end of the day individual peacekeepers are just soldiers, they're not answerable to the UN (the UN doesn't appear in an org chart above the head of state of the soldier's home country) but only to their commanding officers. I'm afraid I was actually slightly heartened to see that this was a trade. The soldiers got sex, the locals got food. Things could be a lot worse in a warzone. In thinking about this story, it's worth considering why exactly these girls and their families resorted to this. Would we be equally disturbed to read "People in war-torn African state starve to death" rather than "UN peacekeeps traded food for sex with underage girls" and if not, why not? 82.69.171.94 (talk) 12:32, 2 September 2011 (UTC) - You are saying teenage girls were receiving money for sleeping with able-bodied men in uniforms? --Mack Coster (talk) 12:45, 2 September 2011 (UTC) - MDB cited an article, which says that in the war-torn Ivory Coast some of the UN peacekeepers agreed to give underage girls food in exchange for sex and that the local command had been ineffective in preventing this (probably because to them this was a relatively minor infraction). So: teenagers, probably; money, no. It's really easy to prevent soldiers giving prostitutes (underage or not) money, you just don't let them have any, that's what scrip is for. 82.69.171.94 (talk) 13:09, 2 September 2011 (UTC) - The UN is composed of nations, hence the name, and not an independent nation with it's own people, ideas and culture. This applies to the armed wing equally, which draws from member states but just happens to give them shiny white and blue logos for their uniforms. I don't think you could bash the UN with this, per se. ADK...I'll forage your lollipop! 19:05, 2 September 2011 (UTC) - It's no better and no worse than, for example, criminal acts carried by US soldiers serving abroad.--BobSpring is sprung! 07:31, 3 September 2011 (UTC) About the Star Wars Blu-ray edits[edit] I haven't minded most of the changes over the years, but seriously? NOOOOOOOOO Osaka Sun (talk) 19:59, 2 September 2011 (UTC) - Agreed, that's fucked up. Occasionaluse (talk) 19:59, 2 September 2011 (UTC) - As they say in Hitchhiker's Guide to the Galaxy, don't panic.--Lefty (talk) 20:02, 2 September 2011 (UTC) - Nooooooo!--Mikalos209 (talk) 20:12, 2 September 2011 (UTC) - I think the most pathetic thing about it is imagining George Lucas sitting in a screening room watching that scene of Return of the Jedi for the millionth time and saying to his crew, "You know what this needs? Darth Vader should yell 'NOOOOO!'" Junggai (talk) 20:13, 2 September 2011 (UTC) - George Lucas is a parodist. Does the Blu-ray include this button? Nebuchadnezzar (talk) 20:18, 2 September 2011 (UTC) - Or this. Osaka Sun (talk) 20:21, 2 September 2011 (UTC) - I wonder, who would actually Have this reaction to this change, besides GL?--Mikalos209 (talk) 20:33, 2 September 2011 (UTC) - This is such ridiculous crap from Lucas. He's trying to justify the flaws of the new trilogy by forcing a parallel into the old trilogy.--talk 01:34, 3 September 2011 (UTC) - Makes you wonder how much credit he actually deserves for the original trilogy. Tetronian you're clueless 03:07, 3 September 2011 (UTC) - Probably does this so people will buy the pricey new version instead of the old versions in the bargain bin. Kinda the opposite of when supermarkets put the old meat on top of the new meat.--Thanatos (talk) 03:31, 3 September 2011 (UTC) - I'm just not even bothering to get the new films now. Lucas could announce that he's doing a decology based on the books where one of Han and Leia's children goes all darkside and needs to be put down like Ol' Yeller, and I'd just tell the guy to fuck off. Seriously, it's the books and the games that are the only things giving the Star Wars name any quality these days.-- Spirit of the Cherry Blossom 10:02, 3 September 2011 (UTC) - He's trying to make money. --145.94.77.43 (talk) 13:42, 3 September 2011 (UTC) You are all a bunch of hideous nerds. DogP (talk) 15:41, 3 September 2011 (UTC) - LOL, just watch the old Return of the Jedi, then compare it to the new ending. Osaka Sun (talk) 16:59, 3 September 2011 (UTC) - Or, just watch the old Return of the Jedi and stop there. Tetronian you're clueless 17:03, 3 September 2011 (UTC) - Actually, when you're wondering how much credit he should take for the originals, the answer is "a modest, but not total amount". He didn't direct, he didn't edit and he didn't write most of it, he's just a fantastic ideas man and the original three (or at least the very first one) was a case of people clashing heads with Lucas constantly - and such friction and strife in production is what many good films are made of. Contrast this with the prequel trilogy where Lucas had total domineering control of everything. It was his ideas, and don't get me wrong the overall story arc of Star Wars including the prequels is good, but it was his writing, directing, editing, design work. Look at some of the Red Letter Media reviews where Plinkett shows some behind-the-scenes shots of the prequels and Lucas is standing there and no one wants to tell him he's full of shit and should shut up, they were standing there, dozens of members of the production crew, in fear of the guy. Back in the 70s there were plenty of people willing and able to tell Lucas to go shove it up his arse if he came up with a bad idea. The scene with Han saying "I know" when Leia says "I love you" was Harrison Ford telling Lucas that Solo as a character would never say "I love you too". And lo, we get a great insight into a remarkable character second only to him shooting a bounty hunter first rather than second - something we wouldn't get if Lucas had his way. ADK...I'll receive your sheep! 18:09, 3 September 2011 (UTC) Tropical storm Lee[edit] Ho hum. So far just large amounts of needed rain. Тytalk 13:55, 3 September 2011 (UTC) - Just wait, Katia is going to kill off the rest of the survivors from Irene, who were the survivors of the earth quake. Senator Harrison (talk) 15:08, 3 September 2011 (UTC) - Hurricane Katia reminds me of this song. COMRADES! δλερνερ διαλέγομαι | συνεισφέρω 17:13, 3 September 2011 (UTC) Abortion UK style[edit] Has this been mentioned here? "Nadine Dorries, a Christian MP, wants women to see ‘independent’ counsellors before they have an abortion, not go to abortion providers like Marie Stopes International or the British Pregnancy Advisory Service because they have (she says) a vested financial interest which she compares with pension mis-selling. She, along with Frank Field MP, is proposing an amendment to the Health and Social Care Bill on September 6th to ensure this happens"[5] We also have our nutters! Pippa (talk) 10:32, 2 September 2011 (UTC) - She's a pretty nasty piece of work. But her seat is safe, that region (Tory since the 1930s) will vote in the Tory candidate whatever despicable things they've been up to. Everyone in parliament knows what Nadine stands for, so her proposing yet another anti-abortion or anti-sex education amendment achieves nothing. They also already know she's a liar and that she's permanently got her hand in the till, but unless you can blow it up into a major scandal with her name on it, she won't be de-selected. 82.69.171.94 (talk) 11:28, 2 September 2011 (UTC) - TBH, she has a point (if what she said is actually how it really happens or could happen). Not having the companies that make the abortions do the councelling on the issue seems rather rational. On the other hand, what exactly is "an indepedent"? You will hardly find anybody who is neutral about the issue… --★uːʤɱ kant 12:15, 2 September 2011 (UTC) - This is what plays as the Planned Parenthood argument in the States. It works on the principle that abortionists must be in it for the money. The BPAS is a registered charity. From their web site - Not exactly an example of Mammon. Bob Soles (talk) 12:23, 2 September 2011 (UTC) - I heard her on the radio the other day and there was a piece in yesterday's Indie. The main issue to my mind is that "independent" is not the same as "impartial" and most of these independent ones are faith driven. One woman who was referred to a faith-based abortion advice service was shown pictures of baby clothes and badgered to have the baby. ГенгисIs the Pope a Catholic? 14:01, 2 September 2011 (UTC) - Yeah, they try to pull the same shit in the US -- force the woman to go to some Christian quack outfit that peddles the "abortion causes breast cancer, depression, etc." nonsense. Nebuchadnezzar (talk) 15:30, 2 September 2011 (UTC) - "Independent" =/= "Impartial", I like that point. But as it's all done on the NHS at minimal cost, how is there any profit to be made from endorsing it, exactly? ADK...I'll model your virus! 19:09, 2 September 2011 (UTC) - I'm curious - in Oklahoma and South Dakota, it's "forced" counselling. you must get it. and in both cases they must be licensed. and the only licensed that have been given out are for religious centers. My question is, why must a woman have counselling in the first place? I can understand OFFERING it, cause many women do want someone to help them through their decision. But is this law she wants to enact, making it mandatory? I truly wish the US would keep our right wing loonies to ourselves. En attendant Godot 19:20, 2 September 2011 (UTC) - I'm not too worried about the likes of Nadine Dorries. Like the BNP, she is almost a necessity. There are quite a few nutters in all three mainstream parties but they are rarely taken seriously. They are there as a check on our sanity - almost a "what would Dorries do?" type weather check to which the reasonable answer is almost always the opposite. - The British have a very pleasing character trait which is, while they often look like they might be little Hitlers, the majority definitely aren't and reject ideologies that are strident and unreasonable. For all our faults, we're pretty relaxed. Ajkgordon (talk) 19:59, 2 September 2011 (UTC) - Out of interest: what would these faults be? When I was over there I saw the British as one of nicest, kindest and most open kind of people I ever had the honour of meeting. --★uːʤɱ kant 20:08, 2 September 2011 (UTC) - If I had to give a fault, I'd say we're not interested enough in our own history. There's so much of it and quite a lot of it involves beating the French and seeing the world, so no reason not to be interested. EddyP Great King! Disaster! 20:25, 2 September 2011 (UTC) - I take issue with your claim that most brits don't care about (talking about) beating the french. It's essentially the national sport. X Stickman (talk) 09:39, 3 September 2011 (UTC) - There's a wonderful line in Yes, Minister where it's let slip that the main foreign threat is not the USSR, it the French (hacker has just got his hands on the red button - horrors!). Of course, Yes, Minister was a purely fictional comedy with no relationship whatsoever to reality. Bob Soles (talk) 22:13, 3 September 2011 (UTC) - For those who are too young or too foreign [6]. Bob Soles (talk) 22:17, 3 September 2011 (UTC) - Yes (Prime)Minister is a classic, no doubt. There used to be a (not particularly funny) joke: Person A - One of my ancestors died at Waterloo. Person B - Really? Which platform. Given educational standards these days... it's even less funny than it ever was. –SuspectedReplicant retire me 22:57, 3 September 2011 (UTC) - @Soles: Next time you post a link to YT make sure it's watchable in other countries (goat, sometimes I hate the BBC for doing such things to us non-English natives). - So those are your faults? Notoriously undereducated people that have no clue of their country's history? Try a genocide, a world war in which 55 million people were killed and whinning about the fact that you are whinning way too much. (Sheesh, you have problems…) --★uːʤɱ structuralist 01:21, 4 September 2011 (UTC) - Wait, which of the world wars was our fault? I mean, sure, if we'd quietly sat on our island and not accumulated an Empire maybe we'd have been able to stay out of WWI, but it's hard to see how not choosing to do so makes it our fault that things kicked off in central Europe. And at the start of WWII Britain stood back and did nothing, which is not exactly an aggressive stance. Sure, genocide, we had an empire, imperialists murder indigenous people to get their stuff. Show me a country that didn't do this in centuries past and I'll show you a country that lacked the means. We were pretty horrible to our own citizens too, back in the day. 82.69.171.94 (talk) 10:25, 4 September 2011 (UTC) The label "anti-science": a rant[edit] - Moved to Talk:Anti-science#The label "anti-science": a rant at 19:26, 4 September 2011 (UTC) An end to the Tories in Scotland[edit] could be in the offing. Any of the resident Brits (do we have any resident Scots?) think they'll have any better chances under a new name? (I hope not!) (((Zack Martin)))™ 10:58, 4 September 2011 (UTC) - To me it looks like it'd just wind up as a mkii Scottish Conservative party with a clashing ideological mix of British Unionism and Scottish identity. I'm more concerned about when England's going to get her fair share of devolution as we're unfairly represented in Westminster. SJ Debaser 11:21, 4 September 2011 (UTC) - I feel that the phrase "Conservatives carry too much baggage in Scotland and claims a new centre-right party would attract more voters" summarises what is fundamentally wrong with politics. It's just a popularity contest about swaying people to you rather than offering the population a legitimate chance to express an opinion or desire. ADK...I'll sniff your virus! 11:39, 4 September 2011 (UTC) - Of course it's a popularity contest, they're politicians, they just want power and everything they do is motivated by that desire. They don't give a fuck about people. SJ Debaser 16:01, 4 September 2011 (UTC) - I'm not sure that's a fair characterisation. Career politics at the highest level just isn't rewarding enough to justify this belief. Leadership is physically draining. If US presidents were still allowed to stand for more than two terms, the third or fourth would probably kill most of them - that's quite a sacrifice. No, it's cynical of us to assume everyone who sets off down this path is on a ruthless quest for power. The Scottish Conservatives face a real problem, no matter what policies (Scottish or nationally) they espouse, they are associated with the party of 20+ years ago. Rebranding can help them fix that, and make it possible to get a Scottish voter to consider right of centre policies without the baggage of "Maggie's party". 82.69.171.94 (talk) 17:45, 4 September 2011 (UTC) - But the high level politicians are recruited from the lower ones, where you get power that is significantly less draining and a higher ratio of reward to stress. By the time they've moved up, the meme has set in and they're prepared to take the higher jobs otherwise it makes their entire lives meaningless - and don't underestimate the shit people will put themselves through to prevent that. ADK...I'll fly your noun! 18:46, 4 September 2011 (UTC) - Thing is the party's being (theoretically) spearheaded by a Scottish Tory, so would it not likely carry similar economic/social policies to the Conservative party, and the same general membership group, MSP candidates etc? Dropping the label of "Conservatives" may play to their advantage if to disassociate themselves from past Toryism, but I don't know how many people consider the Conservatives past actions when it comes to present day elections. Obviously they lost hundreds of thousands of working class voters in the 80s. Would a rebrand be enough to make them forget everything? SJ Debaser 19:47, 4 September 2011 (UTC) - Depends how stupid you think the average voter is. I certainly don't avoid voting Tory purely because of Thatcher. ADK...I'll riot your virus! 19:49, 4 September 2011 (UTC) - I'm sure there plenty of things Cameron is doing that will make (decent) folk avoid voting tory. AMassiveGay (talk) 03:39, 5 September 2011 (UTC) - You mean like privatising the NHS, cutting spending on everything from police to schools, axing EMA, hiking student fees to unaffordable amounts, losing tens of thousands of people their jobs and allowing parts of England to fall to protests and riots at least three times in the last twelve months? Yeah, I can see how that would make one unpopular. SJ Debaser 18:24, 5 September 2011 (UTC) Google Doodle Freddy Mercury thing[edit] Made me smile. Open google and enjoy. AMassiveGay (talk) 03:36, 5 September 2011 (UTC) - +1 Osaka Sun (talk) 04:06, 5 September 2011 (UTC) - I've never been a Queen fan, but I was touched by Google's loving depiction of Mercury riding around through the clouds. Junggai (talk) 14:58, 5 September 2011 (UTC) - Glorious. - I fucked the girl in Hanson (talk) 19:36, 5 September 2011 (UTC) skipcapcha[edit] Can I have skipcapcha? I promise I'm not a robot. Honest. --Rskle (talk) 18:04, 5 September 2011 (UTC) - Wait a bit, make edits, comes automagically after a bit. Or someone might do it for you (?) Pippa (talk) 18:08, 5 September 2011 (UTC) Keys to the White House[edit] I saw this Lichtman guy getting touted in the news recently as the guy who created a model that predicted every election of the 20th century. Nate Silver has a good debunking of this. Nebuchadnezzar (talk) 05:59, 6 September 2011 (UTC) Anonymous offshore hosting?[edit] Hello, thought there might be someone here who can help me with this: I have some politically contentious material I want to put on the web. I live in a country in Eastern Europe with authoritarian tendences. I don't want my name attached to the web site because it will anger a number of people with money and political connections. I don't want to host my material in my country because there is no anonymous hosting here and our hosters delete web sites as a matter of course if some government official "asks" them to. Parameters: - It's a few 100 Mbs of text. No images, no media files, just text. - I don't expect a lot of traffic. Bandwidth requirements should be trivial. - Except for a thin layer of indexing/commentary the site consists mostly of mail, letters, etc. written by others. The material could probably be construed as violating someone's copyright. In the US and in most EU nations it would probably be easy to get the material deleted using some kind of takedown notice. To defend the material against the takedown notice I would have to file counter-notices or involve the courts. This would require me to give up my anonymity. So I would like to be in a country where they don't have these easy takedowns and it takes some work/some money/a court decision to disappear a web site. I've googled for anonymous offshore hosting but the providers I find are very expensive (because they largely market to gambling, porn, and trading sites) or are at pains to point out they will dislose my identity it I get slapped with a notice. Money is an issue for me. Any suggestions? Hateboy (talk) 09:17, 1 September 2011 (UTC) - If it's just a leak of some kind then hand it to wikileaks or post it on pastebin and announce on twitter. Otherwise I'm sure you could find a chinese reseller host who will give you some cheap space. CrundyTalk nerdy to me 09:24, 1 September 2011 (UTC) - Run it on tor. --145.94.77.43 (talk) 09:59, 1 September 2011 (UTC) - Freenet? (((Zack Martin)))™ 10:00, 1 September 2011 (UTC) - Thanks for the suggestions, but it's got to be a web site. If it's on Tor or Freenet you don't find it unless you already know it exists and specifically go looking for it. Basically, Dr. Evil needs to know that this thing is part of what people will find if they google him, otherwise it doesn't have the political effect I'm hoping for. Which means web site. Hateboy (talk) 10:34, 1 September 2011 (UTC) DNS[edit] America pretty much controls the DNS names of the world, even if you got a cheap web server in china that was anonymous and had the domain well whoever does not like your content could still get the DNS name provider to release your domain name and then all you have is an IP address which is not very human friendly. I think the pastebin/torrent and twitter announcements suggestions above are best to keep your identity secret and information leaked. - The US does not "control the DNS names of the world". The US controls ICANN, which makes political decisions like the creation of .xxx and .museum. The non-political administration of DNS is done by the root server operators, only some of which (e.g. the US Army) are controlled in some sense by the US government. The resolution of gotchafucker.com is controlled by a US corporation named Verisign who run the registry for .com but you could easily obtain an address from one of hundreds of other registries that are not controlled by Americans, if that's who you're afraid of. A brief Google should also find you plenty of web hosting services where they do everything on your behalf, they receive money anonymously (the same way bad guys do when you fall for a 419 scam) and simply don't know who you are, so they can't tell if they wanted to. Obviously everything has an "off" switch. If your adversaries are powerful enough (e.g. the US government) they do have the option of staging a small military invasion (think Bin Laden compound raid) just to press the "off" switch. But most people who think they're that important just aren't. 82.69.171.94 (talk) 10:36, 2 September 2011 (UTC) - Firstly, the US government isn't going to give a shit about me and neither is any other foreign nation. The affair is purely domestic. Secondly, even if my domain did get yanked it would be trivial to replace. Thirdly, I don't really need a domain. Google wouldn't care so why should I. I'm not trying to build a brand here. Fourthly, the way you usually disappear sites you don't like is takedown notices. Snatching domains is harder. So, all things considered, I'm not worried about domain name services being suspended. I'm worried about my hosting services being suspended. Incidentally, the fact that I'm worried mostly about the hosting is the reason I asked for ideas regarding the hosting. Hateboy (talk) 07:15, 3 September 2011 (UTC) - Then just host with a provider outside of your country o.O 64.28.254.95 (talk) 15:33, 6 September 2011 (UTC) Conservapedia[edit] This might sound like a completely off the wall suggestion but how about Conservapedia? Bearing in mind FOIA and Bert Schlossberg you may be able to develop your own topic if it doesn't conflict with CP's other goals and you haven't been a vandal/parodist. ГенгисIs the Pope a Catholic? 11:34, 2 September 2011 (UTC) - Lawl, that's actually a cool idea. Bold. Problem is, one the one hand, it's just much too much material. A few 100s of MBs, that's probably 10 times the mass they have now. No way I can sneak this in undetected. On the other hand, the fuckups that FOIA and Bert go on about are fuckups that involve Americans. Even better, they involve Americans that have dies at the hands of evil commies. In my case, nobody has died, and the only people who got raped and scarred for life are from eastern Europe. Andy wouldn't be interested. Hateboy (talk) 07:27, 3 September 2011 (UTC) Other ideas[edit] Wikileaks seems like the obvious suggestion. Isn't this exactly what they're supposed to be for?--talk 15:49, 1 September 2011 (UTC) Fuck hosting it. If you really have decent information, just email it to the appropriate parties. Let them do the rest, because chances are no one is going to find your broke dick site anyway. Use an anonymous remailer like mixminion. Occasionaluse (talk) 19:50, 2 September 2011 (UTC) - Asking questions on the Internet... you don't know if you'll get an answer but you can be sure there will be fifteen people solemnly informing you the question is stupid. I need hosting. I know I need hosting. The fact that I know I need hosting is the reason I asked for hosting. If you see someone telling you that they need hosting, don't you think the possibility that they need hosting might be, I don't know, a sensible first working hypothesis? Sorry, nothing personal. Just had to vent. Hateboy (talk) 07:37, 3 September 2011 (UTC) - Maybe there is no hosting to be had for several hundred MBs in a country that treats copyright lightly that is not expensive. That might be why you got suggestions for alternatives rather than an answer. If you ask for a unicorn to ride, people will suggest a horse instead. Wikileaks, man.--talk 09:09, 3 September 2011 (UTC)--talk 09:09, 3 September 2011 (UTC) - No, I think you're probably just retarded. You don't need hosting and you probably don't have info worth dick. Occasionaluse (talk) 14:34, 3 September 2011 (UTC) Wikileaks seems to be so burnt out with infighting and Daniel Domscheit-Berg and so on, I'm not sure if you gave them anything now, it would ever be released. Another suggestion — make sure you keep your anonymity, for your own safety, then dump it on Google, e.g. Google Sites. Google probably won't take it down, and if they do, you've just bought yourself some free publicity for your cause, see Streisand effect. (((Zack Martin)))™ 10:41, 4 September 2011 (UTC) - I was going to advise against Wikileaks yesterday, a few hours before they blew themselves out of the water releasing the unredacted cables, then I forgot. One blogger I follow had been covering the catfight in some depth. I sorta knew these drama queens were going to fuck it all up royally at some point. Actually, I knew they were going to fuck it all up ever since that exasperating womanizing trainwreck last year. If you're going to have to rely on someone's sense of discretion, common sense, and steadiness of character you don't go tie some pathetic PUA around you neck. Blue So Angry It's Basically Purple (talk) 13:20, 4 September 2011 (UTC) Cafeteria religion[edit] An interesting read on Alternet Pippa (talk) 20:00, 4 September 2011 (UTC) - "Progressive Religious Believers' Big Hypocrisy: Cherry-Picking the Parts of Religion they Like and Ditching the Rest" Film at eleven. Nebuchadnezzar (talk) 22:44, 4 September 2011 (UTC) - Actually I find that one of the more acceptable interpretations of religion. At least then people are free to ditch the shit parts (racism, sexism, homophobia, generally being a cunt) and if they do partake in that, they accept responsibility for doing so rather than offsetting the blame for their beliefs and behavior to scripture. ADK...I'll abandon your random string of characters! 22:55, 4 September 2011 (UTC) - That's noted in the article, though. Nebuchadnezzar (talk) 22:59, 4 September 2011 (UTC) - Yeah, it's pretty much in line with what I think. Though perhaps I don't think it's as hypocritical or as bad as the article seems to suggest, just that it's entirely self defeating because it destroys the moral absolutism required for religions to function and maintain any authority. ADK...I'll balkanize your hovel! 09:40, 5 September 2011 (UTC) - It does get into that territory when they start claiming that the anti-gay crowd or the rapture ready nuts aren't "real Christians," though. Nebuchadnezzar (talk) 16:27, 5 September 2011 (UTC) - "At least then people are free to ditch the shit parts (racism, sexism, homophobia, generally being a cunt)" - ah, if only they did. I also agree with Mondy's point that about cherry-picking being self defeating. The absolutists at least have the virtue of some sort of consistency; the pick and mixers, particularly of the Catholic variety who reject large swathes of dogma but still think that the RC church needs to command respect and that the Pope should be treated as someone special, are generally on shaky ground because their rationales for continued belief are generally irrational while their rejection of certain ideologies are often selfish. ГенгисIs the Pope a Catholic? 08:07, 6 September 2011 (UTC) - People can believe in a deity without believing in any sort of revealed religion. One can be a deist, or even some sort of philosophical theist, and not accept any particular scripture. She assumes that the purpose of God is to tell us what is right and wrong and true and false. She assumes the order must be "belief in God" therefore "ideas about morality/reality", maybe the order is "ideas about morality/reality" therefore "belief of God", and the purpose of God is something else? She assumes a context of revealed religion, but not all religion need be revealed. (((Zack Martin)))™ 10:13, 6 September 2011 (UTC) Alan Jones[edit] What do our Oz colleagues know of this guy? I ask because I note that he (or someone of the same name - correct me if I'm wrong) is the "patron" of the Galileo Movement, an Australian Anti-AGW crowd. He seems, as far as his WP article goes, to be the sort of guy I'd pay to stay away from any organisation I was involved with. Also, what is it with engineers? The site (Galileo Movement) was started by two and is now run by three engineers. Could be worth an article? Pippa (talk) 21:55, 4 September 2011 (UTC) - I don't know anything about Alan Jones, but I think the Galileo Movement is an outlet for some of the more high-profile Australian deniers such as Andrew Bolt, Ian Plimer, and Bob Carter. Nebuchadnezzar (talk) 22:37, 4 September 2011 (UTC) - I can confirm that Alan Jones is a prize tool. He is a loud-mouthed talk-radio lowbrow. And yes, it is the same Alan Jones who is involved with the Galileo Movement. They have links to a number of his rantswell thought-out opinions. --Horace (talk) 03:31, 5 September 2011 (UTC) - Of Sydney talk radio hosts, the only one I dislike more than Alan Jones is John Laws. Or maybe I dislike Jones more than Laws. I can't remember. Mike Carlton was a far saner choice, although I hadn't realised until just now he's left the airways a couple of years ago now (been a few years since I last lived in Sydney...) (((Zack Martin)))™ 10:23, 6 September 2011 (UTC) Libertarians for Dictators[edit] Good piece in Salon about the anti-democratic streak in the libertarian movement. Some of this stuff matches the leftist apologias for communist states back in the day. Hoppe's defense of monarchy is particularly amusing, though Hoppe is still viewed by many within the movement as a crank. Nebuchadnezzar (talk) 23:26, 4 September 2011 (UTC) - Except that the libertarians do not pretend to have any fondness for democracy (their cardinal virtue is liberty), while the pinkos use the term so often that it makes their vocabularies look smaller than they are. ListenerXTalkerX 23:58, 4 September 2011 (UTC) - A little biased, but something that needs to be sent around. The flock of libertarians that run around all over the Internet (Ron Paul!!1!) may exclaim how groundbreaking their theories are, but once they go into the real world everything gets incredibly more complicated. No high-class free society has ever had a libertarian government. The closest thing to what they want is probably Hong Kong, which in itself has a crapload of problems (ever heard of the "cage people"?). And the hatred of democracy (it's collectivist!), spewed out by many of them makes it that much more hilarious. - And yeah, doesn't it seem like this presence of libertarianism has spiked since the Obama administration (I'd like to see some evidence otherwise), when during the Bush years (with the things he did with the state) there should have been a more relevant response? It pretty much makes the simple left-right political spectrum more valid than people say it is. Osaka Sun (talk) 03:25, 5 September 2011 (UTC) - It started to take off during the late Clinton years, and steadily grew during the Bush administration. During the Bush administration, though, libertarians could find very little outlet among established media and channels, because their preferences typically aligned much more strongly with the GOP, but they also voiced sentiments absolutely opposed by the GOP establishment, such as a vastly decreased defense budget and withdrawal from intervention and legalization of drugs. With Obama, though, the GOP is eager to voice any possible criticisms, so the libertarian movement is suddenly viewed with a lot of sympathy. Enemy of my enemy, and all that. And with the subsequent sanctioning of the legitimacy of the libertarian viewpoint, that means that it's also actually persuaded a greater number of people who feel free to voice their views, in a steady cycle. - My brother is a libertarian, and I used to be one. It has the charm of a wildly simplified worldview, a sort of absolutism that remains enticing to people in an uncertain world. That's much of the charm of Christian fundamentalism, to give another example of the allure of a black-and-white world. To a certain extent I agree with the ideals, just not with the implementation. Government should definitely seek minimalism as a goal, but it shouldn't be the only goal - that's just unproven ideological blindness.--talk 03:59, 5 September 2011 (UTC) - I do not beleive we have Libertarians in the UK. AMassiveGay (talk) 04:04, 5 September 2011 (UTC) - Came across this tangentially related piece by libertarian Will Wilkinson on some of these inconsistencies. Nebuchadnezzar (talk) 05:19, 5 September 2011 (UTC) - We have people who call themselves libertarians, but they tend to be indistinguishable in any practical sense from business Tories. c.f. Guido Fawkes. - David Gerard (talk) 12:51, 6 September 2011 (UTC) - Libertarians can be grossly divided into two categories. - Stoners that want drugs to be legal - people that want no regulations or taxes so they can make more money - The truth is, they could care less about humans and humanity. Particular the second kind.--. 18:40, 5 September 2011 (UTC) - The praises for Pinochet were exceedingly difficult to read for me as I was in my mother's womb when she and my dear father were imprisoned by Pinochet for spreading subversive pamphlets, as I have watched a game of football in the very stadium on whose field the great poet Victor Jara was executed. Indeed, a violent anger kept me from reading any further, but I suspect I got the gist. - I fucked the girl in Hanson (talk) 19:33, 5 September 2011 (UTC) - Many leftists were/are apologists for Castro and Kadaffy. Cuba's transition to democracy will likely be harder than Chile's. Not all Chileans opposed Pinochet. Lysander Spooner (if I understand correctly) supported Confederates against the Union, but also supported slave insurrections. "Democracy is no excuse. Democracy is two wolves and a lamb voting on what to have for dinner."205.189.194.208 (talk) 19:34, 6 September 2011 (UTC) Vestigal body parts can cause pain[edit] So when I went skating about three weeks ago, I ended up tripping and falling where I assume the coccyx to be. Since then I've been having pain when sitting up or sitting down and it's damn annoying when I go skating. Anyone else have this happen to them? HollowWorld (talk) 03:32, 5 September 2011 (UTC) - Sure. It's pretty common to bruise your tailbone. All bruises on bone take a long time to go away and give you that deep, dull ache that's so bothersome.--talk 04:02, 5 September 2011 (UTC) - Ouch. D: Feel Better Dear!--Dumpling (talk) 08:01, 6 September 2011 (UTC) - Last time I had that it took months to get better. Patience is your friend.--BobSpring is sprung! 19:49, 6 September 2011 (UTC) grubs that eat their mommy from teh inside out[edit] Watching BBC's Life, and this segment is about a particular insect grub that under particular conditions causes it's own *unfertalized* eggs to hatch as perfect clones. the 30 or so eggs start eating at the mother's body from the inside out, till they eat their way out, leaving the "mother" just a sausage casing... And I whine about pushing a bowling ball out of a water bottle sized hole. Oh... now they are saying shark babies eat eachother in the shark's body. nice... sighs....--En attendant Godot 16:35, 5 September 2011 (UTC) - OMNOMNOMNOM.--Dumpling (talk) 07:50, 6 September 2011 (UTC) - Now that's the kind of thing to shove under a creationist's nose (the grub, I mean, not the bowling ball/hot water bottle thing) - why would God make a creature that eats its own mother from the inside out? Oh yes, the same god who kills children to teach a king a lesson... silly me. --PsyGremlinPrata! 16:03, 6 September 2011 (UTC) - YEah, or floods the whole world cause his own creations did what he *knew* (given he's all knowing) they would do. nice guy.En attendant Godot 16:33, 6 September 2011 (UTC) - Circle of life, dudes and dudesses. I think it may have been in one of Stephen Jay Gould's splendiferous books that I read about a viviparous acarine mite that always has a litter of eight females. It seems that the hatch is always nine individuals, and the eight sisters devour their brother in utero after mating with him. Not much cross-fertilization going on in that line. Sprocket J Cogswell (talk) 16:36, 6 September 2011 (UTC) Classes in France use twitter to teach reading and writing.[edit] I have no idea what to say about this... [7] -- cept "it's 140 characters". what can you say in 140 characters???--En attendant Godot 16:50, 5 September 2011 (UTC) - Usually how fantastic Justin Beiber is AMassiveGay (talk) 17:10, 5 September 2011 (UTC) - A Vendre: Chaussures bébé, jamais portées.-- Spirit of the Cherry Blossom 18:32, 5 September 2011 (UTC) - At least 140 characters puts a stop to "sentences" which refuse to end because the child has learned that they can string an unlimited number of phrases together, thus: I went on holiday to Corfu and we saw a plane and my sister was scared and I got my own room with a bed and there was a swimming pool and t 82.69.171.94 (talk) 07:22, 6 September 2011 (UTC) - "Voulez-vous coucher avec moi?" Less than 140 characters and rather...to the point. I suppose that would lead to learning more than just French. Hm. I feel like watching that movie now.--Dumpling (talk) 08:08, 6 September 2011 (UTC) - Perhaps we should reduce SB comments to the twitter limit. (In some cases this would be a plus.)--BobSpring is sprung! 18:42, 6 September 2011 (UTC) That explains a lot:[edit] "So much falls into place with the revelation that Tony Blair became godfather to one of Rupert Murdoch's two young daughters and attended their baptism on the banks of the river Jordan last year"[8] Pippa (talk) 17:04, 5 September 2011 (UTC) - Baptism in the River Jordan? WTF! ГенгисIs the Pope a Catholic? 18:25, 6 September 2011 (UTC) - Yes, I don't really know which part of the sentence is the most jaw-dropping.--BobSpring is sprung! 18:39, 6 September 2011 (UTC) Unintentionally sexual church signs[edit] Good for a chuckle --PsyGremlinHable! 19:50, 6 September 2011 (UTC) - Well, that is face-slappingly entertaining. "Sexual Exploitation of Children Workshop" being my favourite. ADK...I'll prove your hadron! 20:23, 6 September 2011 (UTC) Thought[edit] Is there a toy in the market that will let you speak into it and modify your voice so it in effect "Schlaflizes it" and makes you sound like Aschlafly, almost how the darth vader mask makes you sound like darth vader? — Unsigned, by: Rskle / talk / contribs - Just hold your nose. Tetronian you're clueless 03:15, 5 September 2011 (UTC) - And gargle lemonade and salt. HollowWorld (talk) 03:33, 5 September 2011 (UTC) - Tilt your head back. - Go "HLAGH HLAGH HLAGH HLAGH HLAGH" like you're imitating the blowjob sound effect from Jerk City. - Talk in that voice. - - David Gerard (talk) 12:53, 6 September 2011 (UTC) - Something like "talking tom cat" on your android phone might be what you want.--BobSpring is sprung! 19:51, 6 September 2011 (UTC) - HeySpeak (quick voice messaging service) has a (paid) add-on that runs your voice through sound effects. Who are you leaving death threats for? CrundyTalk nerdy to me 08:02, 7 September 2011 (UTC) The future of funspace[edit] As we seem to be generally improving the quality of articles, etc., around the Wiki, it might be a good time to discuss the future of the "Fun" namespace ("funspace," for short). Funspace, as people probably know, was set up to hold pages that were considered off-mission but amusing enough to merit keeping. It has, in my opinion, degenerated from this purpose, now serving as a dump for several hundred pages of eclectic cruft and nonsense, some of them put there as a measure of expediency, the least bothersome way to get them out of mainspace. I think we should initiate some action to take out this four-year-old trash heap. Measures that we could (eventually) take include, in order of severity: - Moving any pages that do not really belong there to some other namespace. The Conservapedia poetry contests, for example, could go into the Conservapedia namespace, while Fun:RationalWikiWikiWiki could go into the project namespace. - Deleting redirects and links from mainspace into funspace, as we have been doing to links from mainspace into Conservapedia space. - Removing the worst of the cruft from funspace. Putting a ban on the creation of new pages in funspace, leaving those already existing as historical relics. Decommissioning the namespace altogether and deleting all pages remaining in it. Discuss. ListenerXTalkerX 05:59, 5 September 2011 (UTC) - some of the articles in fun space are genuinly imaginative, like creationist argument bingo, which further our mission whilst being amusing and creative. I wouldn't like to see that end. Pimobile (talk) 08:28, 5 September 2011 (UTC) - We need a bucket where we put stuff that doesn't belong anywhere else. This is how I see funspace. Part of what RW is, for me at least, is a place where we can be a bit irreverent as well as the serious stuff. - A classic case is the Two Cows thing. It's off mission and totally irrelevant and, mostly, not that funny, but I think it's very much part of what we are. I would hate to see that go. If not funspace, where? - Another issue is who is it that decides what goes and what stays. I'm sure there are some that would consider Two Cows to be exactly the reason why funspace should go. Do we vote on each one - of course not. - So, in conclusion, I'm for sticking with the status quo. Bob Soles (talk) 08:52, 5 September 2011 (UTC) I'm just going to go ahead and say that I've been wanting to see a massive cruft deletion spree for a long time. It's time to make funspace worthwhile to have around. We tried making a list of the worst of it a few months ago (I can't seem to find it now), and it all should go. We need to establish a baseline for quality in funspace articles. Blue Talk 09:07, 5 September 2011 (UTC) - Category:Things you should imagine Mei is pointing at? -- Nx / talk 12:12, 5 September 2011 (UTC) - I'm not adverse to deleting the unfunny stuff or anything too short to be worthwhile, but wouldn't go as far as decommissioning the entire space or preventing new articles from being created. ADK...I'll putrefy your gelato! 09:32, 5 September 2011 (UTC) - I feel the same way. Just because we're sorting some things out doesn't mean we need to lose the fun nonsense.--talk 10:03, 5 September 2011 (UTC) - This was my last proposal which I still like. Rename it to make it more useful. The present name "fun" is not really appropriate.--BobSpring is sprung! 13:56, 5 September 2011 (UTC) - You can take my Long-eared Jerboas from my cold, dead hands. --JeevesMkII The gentleman's gentleman at the other site 00:42, 6 September 2011 (UTC) Summary[edit] To summarize, it looks like most responders would have no problem with the first three courses of action, retaining a leaner funspace to hold articles such as Fun:You have two cows. Consequently, I have struck out those two as possible courses of action, and I suggest moving ahead with the other three. We should probably start by getting up a list of those funspace pages that should definitely not be deleted, and then seeing which of them can be moved into another namespace. ListenerXTalkerX 06:08, 6 September 2011 (UTC) - Imagine what great fun it would be to be able to pick through an ancient Roman brothel's trash heap. What great and mundane things we would be able to learn? - The entire point of the Funspace is that we do NOT know what will be viewed as neato in the future. Consider collectibles, quack medical devices are always a good buy but not because they were ever useful for their stated purpose but simply for their novelty, for the "thought" behind the device. Such is Funspace, it is neither necessary nor practicable; to paraphrase George Carlin, goofy shit is its reason to be. - Should this wiki ever become so large that the cost savings of not having the namespace outweighs it's existence then we should think about getting rid of it then...but for now just leave it, says I, since tomorrow's minds need to know what drives and amuses us now. 16:42, 6 September 2011 (UTC) C®ackeЯ - There's too much of the "clean up brigade around. Pippa (talk) 16:50, 6 September 2011 (UTC) - Alas, there's too much of the "shitter brigade" around, too.--ZooGuard (talk) 17:12, 6 September 2011 (UTC) - It's not as if anything there is actually doing anything bad to us.--BobSpring is sprung! 19:47, 6 September 2011 (UTC) - We have category "things you should imagine Mei is pointing at" (or something like that) that we could use for tagging and reviewing it. It's not that it's directly harmful, it's just not very good to have a load of shit gathering dust because it looks so shabby to have a completely disorganised network of pages that are just full of nonsense. ADK...I'll taste your DJ! 20:30, 6 September 2011 (UTC) - I seriously doubt that most of the cruft in our funspace will ever have the same historical value as a quack medical device. What is to be done with the stuff in "Things you should imagine Mei is pointing at"? ListenerXTalkerX 02:48, 7 September 2011 (UTC) - Let's not discount the sheer absurdity, pointlessness, and unfunniness of a number of funspace pages. It's like every bit of creativity rejected by good taste and the common man forms the sewage amidst which floats some few genuinely funny pages.--User:Brxbrx/sig 02:53, 7 September 2011 (UTC) - - (EC) If you'd like I'll go through tomorrow and slap the delete template on them like last time. Тytalk 02:55, 7 September 2011 (UTC) - That would be good. Is there any way to direct any talk from the deletion proposals to the category's talk-page or some other central location? ListenerXTalkerX 03:10, 7 September 2011 (UTC) - Create a new namespace "Shite:". Move most of the "Fun:" articles there - David Gerard (talk) 14:14, 7 September 2011 (UTC) - This place isn't fun anymore. Shitcan the funspace. Occasionaluse (talk) 14:30, 7 September 2011 (UTC) Swings and roundabouts…[edit] Well, just had a new combi-boiler fitted courtesy of the Housing Association, and they're planning to fit a shower as well, so that's all good. On the negative side, the engineers who fitted the boiler just condemned my cooker, so takeaways for me until my new one arrives Thursday and gets fitted Friday.-- Spirit of the Cherry Blossom 12:33, 6 September 2011 (UTC) - I had a new combi fitted about two years ago. Downside: no airing cupboard (the hot water tank's gone!); seem to take forever for hot water to reach the bathroom (boiler's in the kitchen). Upside: definitely cheaper bills. Pippa (talk) 13:08, 6 September 2011 (UTC) - Places that aren't in America are so strange. Occasionaluse (talk) 18:56, 6 September 2011 (UTC) - Places that aren't in Americaare so strange. Seriously, the day we can vape ourselves into some kind of netrunner reality and leave this ball of rock to the avatar-controlled chimp mechanics, the better. P.S. The Co-op does a fine 15 year old single malt.-- Spirit of the Cherry Blossom 23:31, 6 September 2011 (UTC) - Is it 'gud with fud'? ГенгисIs the Pope a Catholic? 18:20, 7 September 2011 (UTC) - It is good in a glass whilst watching Big O (SFW if anyone is wondering). Avatar-controlled chimp butlers are an addition, but not a necessity.-- Spirit of the Cherry Blossom 22:38, 7 September 2011 (UTC) blub[edit] There was a picture of a sign here somewhere once that said "no retards or people with deformities". I need this picture. Where is it? Blue So Angry It's Basically Purple (talk) 15:15, 6 September 2011 (UTC) - File:Aceshouse.jpg . NDSP 11:21, 7 September 2011 (UTC) - Awesome. Thank you kindly. Blue So Angry It's Basically Purple (talk) 14:53, 7 September 2011 (UTC) Absorbing Actions Through Handshakes[edit] This is totally on mission and not an excuse to show a video of 1000 women being felt up. Honest. So errr... let's have a serious discussion about absorbing vibes and passing them on through handshakes then. –SuspectedReplicant retire me 09:37, 7 September 2011 (UTC) - Sort of a reiki thing?--talk 10:49, 7 September 2011 (UTC) - Strictly hush hush but I'm expecting a visit from Vlad in about a week's time. I'll post pictures if it comes off. ГенгисIs the Pope a Catholic? 15:03, 7 September 2011 (UTC) Illegal Library[edit] OK so this is three years old, but I only just found it. Fucking awesome! The Twilight comment made me lol CrundyTalk nerdy to me 13:36, 7 September 2011 (UTC) An interesting nugget[edit] Through A Glass, Darkly. Worth the 11 page read. ĵ₳¥ášÇ♠ʘ duuudddeee... 17:11, 7 September 2011 (UTC) - A good article, though 5 years old. I wonder how Romans 13:1 is working out for them now that Obama is in the White House. Junggai (talk) 19:48, 7 September 2011 (UTC) The specious reasoning behind the 15 questions for evolutionists....[edit] Firstly we all know evolution does not, and doesn't pretend too, deal with the origon of life - only its development. But those sneaky creationists appeal to an authority and say The General Theory of Evolution, as defined by the evolutionist Kerkut, includes the origin of life. However a search for "General Theory of Evolution brings up solidly creationists sources. So who is this Kerkut? He was noted British zoologist who talked about the Special Theory of Evolution (microevolution) and the General Theory of Evolution (macroevolution). Note though that none of this deals with the origin of life, that micro and macroevolution are long since discarded terminology and there is no "General Theory of Evolution". So, tl;dr version - the 15 questions campaign is bullshit from before the first question is even asked. Aceace 04:31, 7 September 2011 (UTC) - Well they have to include at least some sort of midleading component to it or else they can't really "challenge" evolution. Sam Tally-ho! 04:53, 7 September 2011 (UTC) - They cannot even manage to challenge what they call "evolution" (i.e., origin by Big Bang + abiogenesis + evolution). ListenerXTalkerX 04:55, 7 September 2011 (UTC) - It's just how creationists operate. Find one guy, just one, no matter how nutty or outdated his opinion might be and project his opinion on to the population of working scientists. --JeevesMkII The gentleman's gentleman at the other site 12:02, 7 September 2011 (UTC) - I'm trying to think of an appropriate place to write up this general and special thing. Article on Kerkut or keep it in the mirco/macro articles? Don't want to give it any legitimacy, though. ADK...I'll coach your spoon! 23:51, 8 September 2011 (UTC) any cognitive scientists in the house?[edit] We have three articles, Clustering illusion, Pareidolia, and Apophenia, that are all stubs, and all saying similar things. Can someone who has a clue look at them and help decide if they should be merged? And if they should not be merged, we probably need to clean them up so simple minded folk like me can understand the difference. En attendant Godot 21:13, 7 September 2011 (UTC) - Pareidolia and the clustering illusion are contained within apophenia. I think they should stay separate, but I'll try to clean up a bit. Nebuchadnezzar (talk) 23:57, 8 September 2011 (UTC) The Pitch[edit] The Gruen transfer is an Australian TV program about advertising. Regular segment, The Pitch, offers advertising agencies an opportunity to try and sell a controversial idea. RagTopGone sailing 23:37, 7 September 2011 (UTC) - I remember this from the Fat Pride thing. Fascinating stuff at times. ADK...I'll revolve your cod! 21:45, 8 September 2011 (UTC) Of interest[edit] Hilarious UK Homeopath Squirms after being confronted about giving bad advice. It's a bit old, but I just dredged it up on youtube and thought the folks here might enjoy it! The Noisy Orchestra Oi! Oi! Oi! 10:37, 8 September 2011 (UTC) - Wow, she went pretty fast from "Well, there haven't been any studies" to "the first homeopathic cure was for malaria."--talk 10:43, 8 September 2011 (UTC) Dear Europe, I love you[edit] While the American right wing calls for public slaughtering of Assange and calls whistleblowers terrorists, in Germany some left-wingers in the lower house are trying to give whistleblowers more job-safety (English translation) and get criticized right away ... for not giving whistleblower enough safety (English translation). The best thing about this? That bill has the legal backing of a ruling from the European Court of Justice. --★uːʤɱ anti-communist 18:47, 8 September 2011 (UTC) Anyone up for some crank-review?[edit] A little old, but we still have a chance to infiltrate the Journal of 9/11 Studies! Nebuchadnezzar (talk) 05:47, 9 September 2011 (UTC) - :D :D Eye on the ICR talk, or type, or whatever... 05:56, 9 September 2011 (UTC) +1[edit] Call me churlish, but I hope there's a special place in hELL for people who are going to append Google+'s "+1" to everything they like. Right next door to people who say "I wish this place had a "like" button." --PsyGremlinParla! 15:28, 5 September 2011 (UTC) - +1AMassiveGay (talk) 17:12, 5 September 2011 (UTC) - I hate you all. --PsyGremlinZungumza! 17:32, 5 September 2011 (UTC) - +2 Nebuchadnezzar (talk) 17:38, 5 September 2011 (UTC) - +3.14159265358979323846264338327950288419716939937510 -- Spirit of the Cherry Blossom 18:42, 5 September 2011 (UTC) - +i Тytalk 23:26, 5 September 2011 (UTC) - Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): +e^0 Sprocket J Cogswell (talk) 23:54, 5 September 2011 (UTC) - Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): +0/0 Doctor Dark (talk) 00:35, 6 September 2011 (UTC) PS: "Churlish." You're welcome. - -6.1415926535897932384626433832795 Senator Harrison (talk) 00:36, 6 September 2011 (UTC) - +Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): R = \{ x \mid x \not \in x \} Tetronian you're clueless 01:23, 6 September 2011 (UTC) - (n 1 +) Тytalk 02:00, 6 September 2011 (UTC) - Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): +\aleph_{0} (((Zack Martin)))™ 10:17, 6 September 2011 (UTC) - Is there some sort of RationalWiki annual awards thing? This should be nominated for topic of the year. Osaka Sun (talk) 03:36, 6 September 2011 (UTC) - Also there are privacy implications that most people don't understand to these buttons. The provided buttons (that Facebook, Google, etc ask you to kindly incorporate into your web site) are designed so that Facebook, Google, etc. get details about every visitor to your site, whether they click a button or not, and whether they're currently "logged in" to Facebook or whatever or not. The British NHS got a bunch of heat from one of my colleagues because their STI information pages on the web had such buttons, ie Facebook was being told "Logged out Facebook user Barry Smith, who you know is in a relationship with Heather Jones, is looking at pages about Gonorrhea" which you know, maybe isn't what the NHS thought they were doing? It was surprisingly difficult to get NHS bods to grasp that they really were helping Facebook collect this data, and export it from the EU to a country where it can be sold for a profit... You can fix this either individually as a user (Sharemenot blocker software) or on your site (Sharenice stops the buttons tracking people unless they click them) but most people aren't even aware there is anything to fix. 82.69.171.94 (talk) 07:56, 6 September 2011 (UTC) - I just recently was let go from my place of employment (loss of funding to the project). My entire job was to write software to harvest data from facebook, twitter, linkedin, google, etc. This data was then analyzed to market to people better. For instance, you like a page on Ford's site(this is a specific example, but names and details changed) and they know who you are, what you interests are, and other things shared on FB. And since I now have your name and location, I can reference that to a national database, and see when your lease is up. Then I can prod you to come get a new lease on the Chrysler you like, since you only have a month in your lease. I felt a bit evil. And I hated writing in ASP.NET/Windows Azure. I was supposed to be writing in C# (still shit, but less so) but ended up doing more ASP.NET than anything else. ASP.NET deserves to be shot in the face. Quarugarbage bin - You can't explain that! 18:07, 9 September 2011 (UTC) - Nah, being shot in the face with anything heavier than a .22 is practically guaranteed to kill you very quickly. ASP.NET deserves to have its legs mashed with a tire iron and be dumped in the communal toilet trench. It can then choose if it wants to croak from the dehydration, the explosive diarrhea, or the gas gangrene. Should take a few days either way. It would be the best five or so dumps of my life. Mountain Blue (talk) 19:27, 9 September 2011 (UTC) - I have the servers that these buttons want to make my browser connect to shitlisted in my /etc/hosts file. (In fact, I have an interposer library that will shitlist specific hosts for specific processes, but for most people that's probably overkill.) Everybody can do this. Every operating system has an /etc/hosts file or a file just like it, even Windows. Blue So Angry It's Basically Purple (talk) 08:03, 6 September 2011 (UTC) - +ONE / TALK 10:07, 6 September 2011 (UTC) - +1 goes right back to the beginning of the internet, doesn't it? It's what they used to do before the like button withdrew the very last ounce of effort from showing appreciating for something online. ADK...I'll bescumber your person! 20:27, 6 September 2011 (UTC) - At the beginning of the internet "Me too!" stuff was frowned upon and seen as proof you didn't know the proper etiquette. Dendlai (talk) 02:20, 7 September 2011 (UTC) - I'll always be a "mega-dittos" guy myself. DickTurpis (talk) 11:58, 7 September 2011 (UTC) Gay Homophobe countdown clock[edit] 9 days and counting....cant be long now until another one pops out of the closet! DogP (talk) 02:11, 8 September 2011 (UTC) - Nice. That needs to be under Haggard's Law. Nebuchadnezzar (talk) 02:13, 8 September 2011 (UTC) - Whew... at lease they haven't caught me in my gay sex scandal yet..... er.... I mean.... The Noisy Orchestra Oi! Oi! Oi! 10:38, 8 September 2011 (UTC) - I find it kind of funny in a sad way that "gay homophobe" has been shown to not be an oxymoron. (And Reckless Noise Symphony, I'm pretty sure you just have a wide stance.) --GastonRabbit (talk) 23:38, 9 September 2011 (UTC) Rubgy[edit] With interest building in the sport before the Rugby World Cup, I thought this was an interesting article. I know Mercans play it around Boston traditionally because of the Oirish, but does it get much attention elsewhere? Ajkgordon (talk) 16:10, 8 September 2011 (UTC) - It's increasingly popular in high schools and colleges - the private ones, that is. Several of my cousins played rugby. Until I came to NZ, though, I didn't even know what shape the ball was, so the market penetration isn't so broad.--talk 23:24, 8 September 2011 (UTC) - NZers go fucking bananas over Rugby. I like watching the big matches but not what you'd call a "fan". Though tonight I am throwing a large RWC party. AD, you are welcome to attend. Aceace 23:26, 8 September 2011 (UTC) - Damn, that would be amazing! Sucks we're on opposite sides of this goddamn country. I guess I probably couldn't, anyway - the wife's coming back from the States tomorrow morning, so I have to get everything cleaned up and romantic.--talk 02:15, 9 September 2011 (UTC) - Romantic? Doesn't that just entail sporting a boner and jamming a rose up ya jaxy? Aceace 02:23, 9 September 2011 (UTC) - While singing soft ballads.--talk 02:28, 9 September 2011 (UTC) - Soft ballads? You fucking pansy - are you sure your married? No man, you need belt outa power ballad. The Final Countdown, Bat out of Hell or possibly Danger Zone from Top Gun. Aceace 02:33, 9 September 2011 (UTC) bionic[edit] Just got a droid bionic. Jesus. 20Mbs download speeds. Already forgetting about the way things used to be. Occasionaluse (talk) 18:28, 8 September 2011 (UTC) - I've had a Droid 2 Global for several months now and it unfortunately isn't that fast (and I don't really have any use for the Global part since passports cost so damn much). --GastonRabbit (talk) 23:21, 9 September 2011 (UTC) Diaspora - not dead yet[edit] Just received the following in my inbox: Will be interesting to finally get a peek inside. --PsyGremlinPrata! 20:42, 8 September 2011 (UTC) - I should have this in my inbox also....interesting. Aceace 20:43, 8 September 2011 (UTC) - Diaspora came up in a conversation the other day. Between Google+ and Facebook, there is no room for them whatsoever. I cringe at the thought of me being a bitch to facebook, and the idea of letting google control another part of my life disturbs me, but this will never (ever ever ever) take off. That's why I'm unwilling to join any of them. Occasionaluse (talk) 20:45, 8 September 2011 (UTC) - The whole "circles" thing has actually been on Facebook for ages, it's the friends list thing and only idiots could miss it. Even then, if you want to be private you simply don't release information to others (I've had that rant before, though). Diaspora did nothing new, neither did Google+ really - although it did moron proof it by effectively forcing you to use the feature rather than leave it as an option. Thing is, a large open-source social network just won't work on account of the fact Facebook and Google have masses of funds and the sort of combined nerdy engineering talent that could put men on the moon. Diaspora just was never going to work from the start, especially since they decided to make it distributed. Meaning that if you can't find someone nice enough to host a node for free you're fucked, and if that node goes down you're also fucked. Actually, this bit isn't even new because open-source social networking software has been around for ages - about four years ago I was going to install one on a local intranet for work purposes. Really, I'd almost describe it as a con, people who have given money to it have been scammed. ADK...I'll affiliate your xylene! 21:42, 8 September 2011 (UTC) - I don't know. To some the relative obscurity of the service is an upside, e.g. identi.ca is alive and well. --145.94.77.43 (talk) 22:57, 8 September 2011 (UTC) - If it's for organising events with and keeping track of the people you know, then it's not particularly good because no one is there for you. If it's just for whoring yourself out to random strangers then 1) why give a shit about privacy and 2) we've had message boards loooooooooooong before "social networks". After all, most people on Google Wave just used it to say "so... this is a wave... no one else is here. Ah well" and never used it again. ADK...I'll bamboozle your hotel! 23:38, 8 September 2011 (UTC) - meh Sen (talk) 23:49, 8 September 2011 (UTC) - For some work on an alternative to giving companies like FB & Google control of all your data, see Pashley (talk) 07:01, 9 September 2011 (UTC) - How about just not using social networks in the first place? - LucidFox (talk) 08:51, 9 September 2011 (UTC) - I've been off social networking for about 6 months now. It's amazing how much more narcissistic it seems when I see my friends do it. "You really felt that 500 people needed to know what you had for lunch?" Occasionaluse (talk) 13:28, 9 September 2011 (UTC) - Maybe I'm selective in my friends, but few of mine talk about themselves or what they did. most use it to share 1) cute animals, 2) serious articles on gay rights, women's rights, idiot republicans, or 3) "help, how do you do X" posts about techie things. I can't imagine reading "I was at the store today" or worse, "facebook wants you to know that i'm at latX longY using my mobil and uploading the location to play some game!"En attendant Godot 01:40, 10 September 2011 (UTC) Washing Hands could save a million lives a year[edit] Good video - just don't let Andy Schlafly see it. –SuspectedReplicant retire me 11:34, 9 September 2011 (UTC) Vancouver 'quake[edit] Anyone here in Vancouver? Pippa (talk) 20:40, 9 September 2011 (UTC) - No, but a lot of my people are. Apparently all is good. B♭maj7 “We are moving too fast for any label to stick.”-CLRJ 22:35, 9 September 2011 (UTC) - I'm glad no one was hurt. It's weird, I read this here piece just a few days ago. I think it was on boing or something. Almost makes the quake look like a good thing; people will probably sit up and take notice now. Mountain Blue (talk) 22:38, 9 September 2011 (UTC) Obama's new stimulus package[edit] What do you think? Most likely it won't be passed, but it feels like Japan's Lost Decade in almost every sense. Osaka Sun (talk) 07:33, 9 September 2011 (UTC) - When the economy does recover, it will probably be in a way no one expected. "Stimulus" measures can stop the economy going into a tail-spin, but fundamentally they do not really fix anything. ListenerXTalkerX 07:47, 9 September 2011 (UTC) - Nearly worthless with this output gap. Will get ripped up in the House, making it entirely worthless. Yes, I am filled with optimism. Nebuchadnezzar (talk) 07:48, 9 September 2011 (UTC) - It's pretty good - about the best I was hoping for, actually. I also liked the rhetoric - a return of 2008 Obama.--talk 10:18, 9 September 2011 (UTC) - Obama's problem is that he assumed the Republicans would negotiate in good faith. It's OK to get snookered the first couple of times so that you show you're reasonable, but he kept getting rolled when he should have said "OK assholes, here's how it's going to be" and run over top of them. Unfortunately he lost the Senate before he wised up (to the extent that he has wised up). Doctor Dark (talk) 01:07, 10 September 2011 (UTC) - It's hard to know where his strategy ended and incompetence began. I accept that originally the plan was to make the GOP seem radical and unreasonable, but they never got control of the messaging. They should have changed tactics a year ago.--talk 01:11, 10 September 2011 (UTC) - I find obama hot, (I like smart slick people) so any discussing of him and package... Never ever thought i'd say that about a president. lol. Seriously, i've held and held out for the "it's stratdgy", and in some ways I'm sold. look at gay rights. we are about to legalize gay marriage (through a very back door), and gays in the military. on the other hand, i keep waiting and waiting for economy to make sense (his policies)... but it never comes through. I no longer know what to believe. I will vote for him again, of course. cause even if he's disappointing -- he's not bush, or dear god, Bachmann.En attendant Godot 01:15, 10 September 2011 (UTC) - The economics are really clear to me: the stimulus was good, but we needed a second huge round of it. Look at China: they had a stimulus that was staggeringly big, and their economy only slowed a bit because of its effectiveness. Most reviews of the stimulus agree it was effective, and I'm glad we're having this second one now. - I give credit where it's due, but he deserves almost no credit for advancement of gay rights. That was pushed through at great effort and pain by a lot of people all up and down the ladder and in every area, and he demonstrated repeatedly that it was not a big concern for him as he put forward reform in such an achingly slow way. The only credit he deserves is for not standing in the way directly.--talk 01:19, 10 September 2011 (UTC) - "Obama's problem is that he assumed the Republicans would negotiate in good faith." Obama has always been a coalition-builder/reach across the aisle type, going back to his days at Harvard. I don't see him changing that anytime soon. Normally, that's the way things work, but the current GOP will vote against Obama no matter what ("You wanted a deficit commission? Okay, here ya go!" Filibuster'd!). Jonathan Cohn's words were accurate: It's the "new nullification." Nebuchadnezzar (talk) 01:30, 10 September 2011 (UTC) - I've also been wondering where strategy ends and where naiveté begins. On the one hand, he and his advisers couldn't possibly be stupid enough to still believe that the Republicans will really compromise on anything. That kind of learning disability would land you in a school for the handicapped instead of Harvard. On the other hand, they must also know that they're playing a very risky game, facing the electorate as stymied, but well-intentioned compromisers instead of being able to present actual results. And the Republicans already managed once to recast their obstructionism and clientele politics as principled opposition to some horrendous socialist program, to great effect. The bottom line is that he wasted a unique opportunity to reaffirm the validity of liberal politics in the wake of an enormous crisis and instead embraced the very principles that brought it about; now he will have to answer for his complicity in this failure. Right now, the only thing he's really got going for him is that the best thing the Republicans have to offer for the election is their version of John Kerry. To be honest, I can understand that the only thing that could motivate many American leftists to vote for him again is the specter of a president Perry. Röstigraben (talk) 10:23, 10 September 2011 (UTC) - Re: Obama's rhetoric, I also found myself involuntarily smiling every time he punched the air and said "pass this bill!" As if he's giving children a stern lecture. It was the right message: this is all stuff you would agree with if you were serious. I'm calling your bullshit, and dare you not to pass it. Whether or not it will work remains to be seen. Junggai (talk) 13:28, 10 September 2011 (UTC) Obama is fucked, all over. Aceace 13:31, 10 September 2011 (UTC) Vegan black metal chef[edit] I'm a vegan (though not for animal rights purposes) and I've noticed a few vegan questions about. So this'll make you laugh, I hope.--User:Brxbrx/sig 12:33, 10 September 2011 (UTC) - Love this guy. It's rare to see anyone who likes black metal be able to put their tongue so firmly in their cheek. ADK...I'll xerox your icicle! 15:46, 10 September 2011 (UTC) - Adding black metal to anything makes it 1,000x more awesome. Nebuchadnezzar (talk) 18:53, 10 September 2011 (UTC) You see…[edit] …this is why I loathe the Daily Fail. It's a hate-filled, vile rag of a newspaper who can't wait to tarnish the reputation of anybody who is associated with a crime and yet, at the same time, they are capable of producing something like this on the front page of the online site. They are obviously capable of some level of quality and just as obviously, want to have nothing to do with it 99% of the time.-- Spirit of the Cherry Blossom 22:45, 7 September 2011 (UTC) - Second worst rated comment: "What a fantastic demonstration of the Creator's work." CrundyTalk nerdy to me 08:50, 8 September 2011 (UTC) - They nicked that picture from the Astronomy Picture of the Day site from a couple of days ago (I subscribe to that site's RSS feed). See the original here. –SuspectedReplicant retire me 08:56, 8 September 2011 (UTC) - Beautiful image. It made me go look up more Cassini images. In regards to APOTD, that "Robert Nemiroff (MTU)" in the credits? Totally had him for an Astronomy class. It was as awesome as you'd imagine. Quarugarbage bin - You can't explain that! 23:56, 9 September 2011 (UTC) - You are here, courtesy of NASA. -- CS Miller (talk) 22:56, 11 September 2011 (UTC)
https://rationalwiki.org/wiki/RationalWiki:Saloon_bar/Archive119
CC-MAIN-2022-21
en
refinedweb
Hi everyone, I am posting to SAP GL using an input file to read the data and transfer it to BKPF and BSEG tables. The problem is I have to use BAPI_ACC_DOCUMENT_POST, and it expects values for OBJ_KEY and OBJ_TYPE.. For now, OBJ_TYPE creates a problem, because if I use BKPF, it says it cannot post using this object type, as it is for SAP internal use only. Does anyone know how to add a new object type for the customer namespace, which can be manually used for this kind of posting? I know that the new entry must be made in tables TTYP, TTYPT, and possibly TTYPV, for which the maintainence view exists: V_TTYPV. How to add an entry here, or where can I find it in customizing? All helpful answers will be awarded. Thank you very much Srdjan
https://answers.sap.com/questions/4324205/adding-new-object-type-field-bkpf-awkey-for-bapi-p.html
CC-MAIN-2022-21
en
refinedweb
Other AliasNodeMetric SYNOPSIS #include <NodeMetric.h> Public Member Functions NodeMetric (const tlp::PropertyContext &) bool run () bool check (std::string &) Detailed Description NodeMetric.h - Compute the number of nodes in the subtree induced by each node. Computes the number of nodes in the subtree induced by each node. HISTORY - 20/08/2001 Verson 0.0.1: Initial release Note: - This algorithm assigns to each node a value defined as following : If two nodes are in the same connected component they have the same value else they have a different value. NodeMetric::NodeMetric (const tlp::PropertyContext &) Member Function Documentation bool NodeMetric::check (std::string &) bool NodeMetric::run () Author Generated automatically by Doxygen for Tulip Plugins Library from the source code.
https://manpages.org/nodemetrich/3
CC-MAIN-2022-21
en
refinedweb
Selection RadPropertyGrid provides you with a selection functionality, which allows the user to select one or more items from the data displayed by the control. Selection Modes RadPropertyGrid. Example 1: Setting the SelectionMode to Multiple <telerik:RadPropertyGrid x: Example 2: Setting the SelectionMode to Multiple this.propertyGrid.SelectionMode = System.Windows.Controls.SelectionMode.Multiple; Me.propertyGrid.SelectionMode = System.Windows.Controls.SelectionMode.Multiple Pressing Ctrl+A will select all items. Selected items RadPropertyGrid provides two properties to get the data behind the selected items - SelectedPropertyDefinition and SelectedPropertyDefinitions. SelectedPropertyDefinition: The business object that sits behind the selected Property Definition. SelectedPropertyDefinitions: A collection of the business objects that sits behind the selected Property Definitions. It will contain more than one item when the SelectionMode is either Multiple or Extended. Example 3: Binding to SelectedPropertyDefinition <telerik:RadPropertyGrid x: Example 4: The viewmodel's SelectedDefinition property public class ViewModel : ViewModelBase { private object selectedDefinition; public object SelectedDefinition { get { return selectedDefinition; } set { if (value != this.selectedDefinition) { this.selectedDefinition = value; this.OnPropertyChanged("SelectedDefinition"); } } } } Public Class ViewModel Inherits ViewModelBase Private _selectedDefinition As Object Public Property SelectedDefinition() As Object Get Return _selectedDefinition End Get Set(ByVal value As Object) If value IsNot Me._selectedDefinition Then Me._selectedDefinition = value Me.OnPropertyChanged("SelectedDefinition") End If End Set End Property End Class As of R2 2016, the SelectedField property, previously marked as obsolete, has officially been removed. Events There is a single event relevant to the selection in RadPropertyGrid - SelectionChanged. As suggested by its name, it occurs when the selected property definition has changed. Example 5: Adding a handler for the SelectionChanged event <telerik:RadPropertyGrid x: Example 6: SelectionChanged event handler private void propertyGrid_SelectionChanged(object sender, SelectionChangeEventArgs e) { var propertyDefinition = e.AddedItems[0] as PropertyDefinition; MessageBox.Show($"You selected property definition with DisplayName: {propertyDefinition.DisplayName}"); } Private Sub propertyGrid_SelectionChanged(ByVal sender As Object, ByVal e As SelectionChangeEventArgs) Dim propertyDefinition = TryCast(e.AddedItems(0), PropertyDefinition) MessageBox.Show($"You selected property definition with DisplayName: {propertyDefinition.DisplayName}") End Sub As of R2 2016, the SelectedFieldChanged event, previously marked as obsolete, has officially been removed.
https://docs.telerik.com/devtools/wpf/controls/radpropertygrid/features/selection
CC-MAIN-2022-21
en
refinedweb
chunk_logger Module **Configuration Change. ** This feature is available in Momentum 4.2 and later. The chunk_logger module provides a safe interface for logging asynchronously from Lua, C, and C++. Historically, the paniclog has been used for low-volume logging via print() in Lua or ec_mod_debug()/log_error() in C/C++. However, logging to the paniclog is not suitable for general debug logging or more than occassional debug logging. Logging to the paniclog in the scheduler thread (the main thread) can limit throughput and cause watchdog kills. The scheduler thread's job is to multiplex file descriptors and execute timed events, handing off time-consuming tasks to other threads. Logging to the paniclog involves disk I/O, and writing to the paniclog in the scheduler thread may block its execution for a long time, thereby holding up other tasks in the scheduler thread and decreasing throughput. If enough data is logged to the paniclog in the scheduler thread, it may become so unresponsive to the watchdog process that the watchdog timeout triggers. The chunk_logger module does not have this limitation. The chunk_logger is configured through a configuration file using a stanza such as: chunk_logger chunk_logger1 { timestamp_format = "%m:%d:%H:%M:%S" destination = "/path/to/log/file" add_newline = "true" } In this example, the log file is written to /path/to/log/file and the timestamp_format specifies the timestamp in a strftime() format. In addition, add_newline enables you to specify whether a new line is added automatically to every item of data that is logged. It defaults to true. The module is in the msys.beta.chunk_logger_int namespace: msys.beta.chunk_logger_int.log("Hello World!") The module msys.ts.chunk_logger and the function msys.ts.chunk_logger.log() provides the Lua interface, as shown by the following example.: require("msys.beta.chunk_logger_int") ... msys.beta.chunk_logger_int.log() The C interface uses Momentum's module hooks system to provide a callable hook point. chunk_logger provides an implementation of the hook point, as shown in the following example: #include <module-hooks.h> #include "hooks/chunk_logger/log.h" ... call_chunk_logger_log_hook("default", buf, buflen); Note "default" is specified here as the name of the log destination. Currently chunk_logger only supports one log destination, so this field is ignored. It is recommended that you pass "default" until different log destinations are supported.
https://support.sparkpost.com/momentum/4/modules/chunk-logger
CC-MAIN-2022-21
en
refinedweb
Top: Streams: outfile #include <pstreams.h> class outfile: outstm { outfile( [ const string& filename, bool append = false ] ); string get/set_filename(string); bool get/set_append(bool); int get/set_umode(int); } This class derives all public methods and properties from iobase and outstm, and in addition defines the following: outfile::outfile( [ const string& filename, bool append = false ] ) creates an output file stream, but does not open the file. When opening a file with open(), it is truncated to zero unless append property is set to true. Filename and append parameters are optional. string outfile::get/set_filename(string) sets the file name. set_filename() closes the stream prior to assigning the new value. bool outfile::get/set_append(bool) -- if set to true, the file pointer is set beyond the last byte of the file when opening the stream with open(). int outfile::get/set_umode(int) sets UNIX file mode when creating a new file. By default a file is created with 0644 octal, which on UNIX means read/write access for the owner and read-only access for group members and all others. This property has no effect on Windows. See also: iobase, outstm, logfile, Examples
http://www.melikyan.com/ptypes/doc/streams.outfile.html
crawl-001
en
refinedweb
> Is it the case that the only way to express the *invalid* form: > while x = foo() do print(x) end > is by using the valid Lua form: > while (function() x=foo(); return x end)() do print(x) end No, if you expect x to be local to the body of the loop, you can write: for x in foo do print(x) end (As long as foo is a real function and not a table with a __call method) You can generalise that by writing functions in the for statement, if that suits your fancy: for x in function() local line = io.read() return (not string.find(line, "^%s*quit")) and line end do local _, _, command, rest = string.find(x, "^%s*(%w+)%s*(.*)") if command and Command[command] do Command[command](split(rest)) else io.write(string.format("I don't know how to '%s'\n", command or x)) end end end
http://lua-users.org/lists/lua-l/2003-05/msg00056.html
crawl-001
en
refinedweb
SourceForge.net Tue, 07 Aug 2007 08:10:57 -0700 Support Requests item #1769459, was opened at 2007-08-07 08:04: Michael (mthenderson) Assigned to: Nobody/Anonymous (nobody) Summary: xpath fails to return results Initial Comment: I am having a issue using xpath. We are receiving a file from an external vender. When we use xpath to parse the file, we don’t get any results. Below is a brief example. <?xml version="1.0" encoding="UTF-8"?> <TXLife Version="2.16.01" xmlns="" xmlns: <TXLifeRequest> <TransRefGUID>abc1234567</TransRefGUID> </TXLifeRequest> </TXLife> The following code returns no result List nodes = doc.selectNodes("//TransRefGUID"); I realize it's due to the default namespace declaration, but the file comes from an external vendor and we have not control over it. Is there a fix for this? Is there a work around? We have no control over the incoming xml. Mike Henderson ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-08-07 08:10 Message: Logged In: NO Use DocumentFactory for creating document and set it's namespace map for XPath: namespaces.put("default", ""); DocumentFactory documentFactory = DocumentFactory.getInstance(); documentFactory.setXPathNamespaceURIs(namespaces); reader = new SAXReader(documentFactory); Than you can use "default" as prefix for your namespace: List nodes = doc.selectNodes("//default:TransRefGUID"); You can try empty prefix: namespaces.put("", ""); but I can't remember if this works. ----------------------------------------------------------------------
http://www.mail-archive.com/dom4j-dev%40lists.sourceforge.net/msg01254.html
crawl-001
en
refinedweb
Hack the Box Write-up #5: TartarSauce In this write-up we’re looking at solving the retired machine “TartarSauce” from Hack The Box. After spending some time on the hosted web applications, we’ll eventually get the first foothold via an outdated Wordpress plugin. From there we can upgrade to a user shell by abusing the tar command. Eventually, we get root by abusing tar once more, but this time as part of a backup script and in a bit more involved way. Recon and Enumeration As usual, we run our initial nmap scan nmap -sV -sC -oN nmap/init 10.10.10.88 PORT STATE SERVICE VERSION 80/tcp open http Apache httpd 2.4.18 ((Ubuntu)) | http-robots.txt: 5 disallowed entries | /webservices/tar/tar/source/ | /webservices/monstra-3.0.4/ /webservices/easy-file-uploader/ |_/webservices/developmental/ /webservices/phpmyadmin/ |_http-server-header: Apache/2.4.18 (Ubuntu) |_http-title: Landing Page While only getting back one open port, the listed entries in the robots.txt file do look promising. Note that entries in the robots.txt file don’t “hide” pages/directories. While they indicate to crawlers what you want and don’t want to have indexed, they are a) only an advisory and not a technically imposed rule, and b) can give an attacker a first idea of what you don’t want exposed or have removed from public search engines. Let’s start by visiting the root path of 10.10.10.88: Nothing interesting to see here except some ascii art and a little troll at the end of the page source after hundreds of line feeds: <!--Carry on, nothing to see here :D-->. Let’s start a directory brute-force of / and /webservices while going through the list of disallowed robots.txt entries: gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u Out of the five paths listed in robots.txt, only /webservices/monstra-3.0.4/ is available. Monstra is a Content Management System written in PHP, apparently not further developed anymore and the version it displays has several known security vulnerabilities. Doing a searchsploit monstra in Kali shows (Authenticated) Arbitrary File Upload / Remote Code Execution as the most promising weakness related to this version. As it requires prior authentication, let’s go over to and attempt a login with common credentials. admin and admin as user/password works right off the bat and we’re inside the admin interface. Examining the potential exploit ( searchsploit -x 43348), it looks like a simple file upload could give us remote code execution via PHP. Trying it out, however, we quickly find the upload functionality does not work for any file, and we can see that doing any kind of modification in the admin panel leads to errors as well (e.g. modifying a template). The vulnerability does not seem to be exploitable, even though in theory it should be. I like this, because it reflects a very common situation in real life, where vulnerabilities exist, but cannot be exploited due to the presence of certain configurations or just lucky circumstances. But, looking at the gobuster results from the directory brute-force started earlier, we have found another promising candidate: /webservices/wp. It shows a rather empty wordpress installation, but as abandoned software often that lets you in, let’s start enumerating it. Having a look at Wordpress’ default directories, we see that browsing them is a bit tedious as it seems the base url of the site is misconfigured (missing a slash after http:/). While we could manually correct all HTTP requests through an intercepting proxy, there’s a nice trick to do it automatically in Burp. Going to Options in the Proxy tab, we can add a rule under Match and Replace and tell it to replace GET /10.10.10.88/webservices in the request header with GET /webservices. Similarly, we could do this for other methods and headers as well. Now we can browse the site regularly through the Burp proxy. Unfortunately, we’re not lucky with weak credentials this time, and even notice a delay in processing the login requests to prevent brute-forcing. As Wordpress security is often compromised using third-party plugins, let’s have a look at WPScan to enumerate plugins: wpscan --url -e ap --plugins-detection aggressive (Using aggressive detection as passive/mixed did not yield results) [i] Plugin(s) Identified: [+] akismet | Location: | Last Updated: 2019-11-13T20:46:00.000Z | Readme: | [!] The version is out of date, the latest version is 4.1.3 | | Found By: Known Locations (Aggressive Detection) | -, status: 200 | | Version: 4.0.3 (100% confidence) | Found By: Readme - Stable Tag (Aggressive Detection) | - | Confirmed By: Readme - ChangeLog Section (Aggressive Detection) | - [+] brute-force-login-protection | Location: | Latest Version: 1.5.3 (up to date) | Last Updated: 2017-06-29T10:39:00.000Z | Readme: | | Found By: Known Locations (Aggressive Detection) | -, status: 403 | | Version: 1.5.3 (100% confidence) | Found By: Readme - Stable Tag (Aggressive Detection) | - | Confirmed By: Readme - ChangeLog Section (Aggressive Detection) | - [+] gwolle-gb | Location: | Last Updated: 2019-10-25T15:26:00.000Z | Readme: | [!] The version is out of date, the latest version is 3.1.7 | | Found By: Known Locations (Aggressive Detection) | -, status: 200 | | Version: 2.3.10 (100% confidence) | Found By: Readme - Stable Tag (Aggressive Detection) | - | Confirmed By: Readme - ChangeLog Section (Aggressive Detection) | - Going through these and researching past vulnerabilities, we find a potential Remote File Inclusion vulnerability in gwolle-gb, albeit for a different version. As it’s a very easy exploit, let’s try it anyway. First shell We create a file wp-load.php in a directory on our machine and add code for a PHP reverse shell. I chose the shell from SecLists, present at seclists/Web-Shells/laudanum-0.8/php/php-reverse-shell.php. After changing the IP to our own and port to one of choice, we can launch a webserver from the directory of our wp-load.php file ( python3 -m http.server 80), spin up a netcat listener ( nc -lvnp <port>), and then navigate to<our IP>/. It works and we get our first shell as www-data. The version information in the readme.txt that WPScan read was thus false information. Privilege escalation to user To get a nicer shell, let’s quickly do a python3 -c 'import pty; pty.spawn("/bin/bash")' followed by backgrounding, stty raw -echo and foregrounding again (check the blog post “Upgrading Simple Shells to Fully Interactive TTYs” at blog.ropnop.com for details about this trick). One of the first things to check once we get an initial foothold is – amongst other things – see if we can execute commands as another user. In this case, we can: www-data@TartarSauce:/$ sudo -l Matching Defaults entries for www-data on TartarSauce: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin User www-data may run the following commands on TartarSauce: (onuma) NOPASSWD: /bin/tar Being able to run tar as the user onuma probably means we can easily escalate to that user: $ sudo -u onuma /bin/tar xf /dev/null -I '/bin/sh -c "sh <&2 1>&2"' $ id uid=1000(onuma) gid=1000(onuma) groups=1000(onuma),24(cdrom),30(dip),46(plugdev) The reason this works is that -I allows us to specify a custom compression program ( -I == --use-compress-program). It is not the only method of abusing tar for privilege escalation, though. Have a look at the gtfobins page for tar. Getting root Having our new permission, we can run an enumeration script to get an overview of the system. We can host LinEnum on our machine (e.g. python3 -m http.server 80) and then load it and pipe it into bash in the onuma shell: curl | bash Amongst other things we see a couple of files related to some kind of backup and more specifally a systemd timer: [-] Systemd timers: NEXT LEFT LAST PASSED UNIT ACTIVATES Sun 2020-02-09 17:08:42 EST 3min 24s left Sun 2020-02-09 17:03:42 EST 1min 35s ago backuperer.timer backuperer.service There are also a few other (false?) hints, e.g. a comment in .bashrc: # add alias so i don't have to type root's super long password everytime i wanna switch to root :D" I couldn’t find any clue to these, so let’s go on with finding out more about the backuperer.service and the related timer. systemd timers are a way to start services based on time, similar to cron. We can find the configuration of “backuperer” in /etc/systemd/system/multi-user.target.wants/backuperer.timer or /lib/systemd/system/backuperer.timer, respectively. backuperer.timer: [Unit] Description=Runs backuperer every 5 mins [Timer] # Time to wait after booting before we run first time OnBootSec=5min # Time between running each consecutive time OnUnitActiveSec=5min Unit=backuperer.service [Install] WantedBy=multi-user.target And the service backuperer.service in /lib/systemd/system/backuperer.service: [Unit] Description=Backuperer [Service] ExecStart=/usr/sbin/backuperer And, finally, the contents of /usr/sbin/backuperer: #!/bin/bash # [...] # Set Vars Here basedir=/var/www/html bkpdir=/var/backups tmpdir=/var/tmp testmsg=$bkpdir/onuma_backup_test.txt errormsg=$bkpdir/onuma_backup_error.txt tmpfile=$tmpdir/.$(/usr/bin/head -c100 /dev/urandom |sha1sum|cut -d' ' -f1) check=$tmpdir/check # formatting printbdr() { for n in $(seq 72); do /usr/bin/printf $"-"; done } bdr=$(printbdr) # Added a test file to let us see when the last backup was run /usr/bin/printf $"$bdr\nAuto backup backuperer backup last ran at : $(/bin/date)\n$bdr\n" > $testmsg # Cleanup from last time. /bin/rm -rf $tmpdir/.* $check # Backup onuma website dev files. /usr/bin/sudo -u onuma /bin/tar -zcvf $tmpfile $basedir & # Added delay to wait for backup to complete if large files get added. /bin/sleep 30 # Test the backup integrity integrity_chk() { /usr/bin/diff -r $basedir $check$basedir } /bin/mkdir $check /bin/tar -zxvf $tmpfile -C $check if [[ $(integrity_chk) ]] then # Report errors so the dev can investigate the issue. /usr/bin/printf $"$bdr\nIntegrity Check Error in backup last ran : $(/bin/date)\n$bdr\n$tmpfile\n" >> $errormsg integrity_chk >> $errormsg exit 2 else # Clean up and save archive to the bkpdir. /bin/mv $tmpfile $bkpdir/onuma-www-dev.bak /bin/rm -rf $check .* exit 0 fi We can see that the script does – more or less – the following: - Removes dot files from /var/tmp, plus the /var/tmp/checkfolder. - Zips/archives the contents of /var/www/htmlas user onuma into a file in /var/tmpwith a random name beginning with a dot. - Sleeps for 30 seconds - Creates the directory /var/tmp/check - Extracts the previously archived contents as root into the /var/tmp/checkdirectory - Performs a diffagainst /var/www/htmlvs. /var/tmp/check/var/www/html - If the check in 6. reports differences, it just writes an error log, but leaves the files. If no differences are reported or if the diff command errors out (as, for example, the directory doesn’t exit), it moves the archive file into /var/backupsand then removes the /var/tmp/checkdirectory and dot file. If we are able to replace the tar gzipped file with our own malicious one in the timeframe of step 3 (sleep 30), include in our own tar.gz an executable with setuid bit set and owner root, plus leave the directory structure intact (as we want a successful diff (no error) that reports differences), tar should extract (and keep permissions/attributes) and the script should not move/delete any file. After that we could then enter the check directory and execute our file to get a root shell. Let’s give it a shot: - Create a simple C program on our machine that will spawn a bash shell (and keep effective user id): #include <stdio.h> #include <unistd.h> int main (void) { char *argv[] = { "/bin/bash", "-p", NULL }; execve(argv[0], argv, NULL); } Compile for the target machine: gcc -m32 shell.c -o shell Add the setuid: chmod +s shell(owner is already root ( 0) as we’re on a Kali machine) Make the directory structure (still on our machine): mkdir -p var/www/html Move our executable into the directory: mv shell var/www/html/ Tar the whole thing up: tar -zcvf shell.tar.gz var/ Now that we have our shell.tar.gz file, we can transfer it over to the target machine (e.g. via a HTTP server like above) and place it into, e.g. /var/tmp. With systemctl list-timers, we can see when our window of opportunity will open (as soon as LEFT goes to 0): NEXT LEFT LAST PASSED UNIT ACTIVATE Mon 2020-02-10 10:52:38 EST 56s left Mon 2020-02-10 10:47:38 EST 4min 3s ago backuperer.timer backuper Once the backuperer script runs and we can see the temp file in /var/tmp, we’ll replace it with our shell.tar.gz ( cp shell.tar.gz .<random name>). A few seconds later – if everything went fine, we should find the check folder with our setuid binary in it. Now we still have a couple of minutes left to execute the binary in /var/tmp/check/var/www/html, which gives us a root bash shell: onuma@TartarSauce:/var/tmp/check/var/www/html$ ls shell onuma@TartarSauce:/var/tmp/check/var/www/html$ ./shell bash-4.3# id uid=1000(onuma) gid=1000(onuma) euid=0(root) egid=0(root) groups=0(root),24(cdrom),30(dip),46(plugdev),1000(onuma) bash-4.3# whoami root Cheers! I hope you’ve enjoyed this write-up. If you have any questions, did it another way or have something else to say, feel free to leave a comment. I’m always happy to learn new things. You can also check out the other write-ups.
https://davidhamann.de/2020/02/10/htb-writeup-tartarsauce/
CC-MAIN-2020-10
en
refinedweb
This page explains how to scale a deployed application in Google Kubernetes Engine. Overview When you deploy an application in GKE, you define how many replicas of the application you'd like to run. When you scale an application, you increase or decrease the number of replicas. Each replica of your application represents a Kubernetes Pod that encapsulates your application's container Inspecting an application Before scaling your application, you should inspect the application and ensure that it is healthy. To see all applications deployed to your cluster, run kubectl get [CONTROLLER]. Substitute [CONTROLLER] for deployments, statefulsets, or another controller object type. For example, if you run kubectl get deployments and you have created only one Deployment, the command's output should look similar to the following: NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE my-app 1 1 1 1 10m The output of this command is similar for all objects, but may appear slightly different. For Deployments, the output has six columns: NAMElists the names of the Deployments in the cluster. DESIREDdisplays the desired number of replicas, or the desired state, of the application, which you define when you create the Deployment. in the cluster. In this example, there is only one Deployment, my-app, which has only one replica because its desired state is one replica. You define the desired state at the time of creation, and you can change it at any time by scaling the application. Inspecting StatefulSets Before scaling a StatefulSet, you should inspect it by running kubectl describe statefulset my-app. In the output of this command, check the Pods Status field. If the Failed value is greater than 0, scaling might fail. If a StatefulSet appears to be unhealthy, run kubectl get pods to see which replicas are unhealthy. Then, run kubectl delete [POD], where [POD] is the name of the unhealthy Pod. Attempting to scale a StatefulSet while it is unhealthy may cause it to become unavailable. Scaling an application The following sections describe each method you can use to scale an application. The kubectl scale method is the fastest way to scale. However, you may prefer another method in some situations, like when updating configuration files or when performing in-place modifications. kubectl scale kubectl scale lets your instantaneously change the number of replicas you want to run your application. To use kubectl scale, you specify the new number of replicas by setting the --replicas flag. For example, to scale my-app to four replicas, run the following command, substituting [CONTROLLER] for deployment, statefulset, or another controller object type: kubectl scale [CONTROLLER] my-app --replicas 4 If successful, this command's output should be similar to deployment "my-app" scaled. Next, run kubectl get [CONTROLLER] my-app. The output should look similar to the following: NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE my-app 4 4 4 4 15m kubectl apply You can use kubectl apply to apply a new configuration file to an existing controller object. kubectl apply is useful for making multiple changes to a resource, and may be useful for users who prefer to manage their resources in configuration files. To scale using kubectl apply, the configuration file you supply should include a new number of replicas in the replicas field of the object's specification. The following is an updated version of the configuration file for the example my-app object. The example shows a Deployment, so if you use another type of controller, such as a StatefulSet, change the kind accordingly. This example works best on a cluster with at least three Nodes. apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: 3 selector: matchLabels: app: app template: metadata: labels: app: app spec: containers: - name: my-container image: gcr.io/google-samples/hello-app:2.0 In this file, the value of the replicas field is 3. When this configuration file is applied, the object my-app scales to three replicas. To apply an updated configuration file, run the following command: kubectl apply -f config.yaml Next, run kubectl get [CONTROLLER] my-app. The output should look similar to the following: NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE my-app 3 3 3 3 15m Console To scale a workload in Google Cloud Console, perform the following steps: Visit the Google Kubernetes Engine Workloads menu in Cloud Console. Select the desired workload from the menu. Click Actions, then Scale. From the Replicas field, enter the desired number of replicas. Click Scale. Autoscaling Deployments You can autoscale Deployments based on CPU utilization of Pods using kubectl autoscale or from the GKE Workloads menu in Cloud Console. kubectl autoscale kubectl autoscale creates a HorizontalPodAutoscaler (or HPA) object that targets a specified resource (called the scale target) and scales it as needed. The HPA periodically adjusts the number of replicas of the scale target to match the average CPU utilization that you specify. When you use kubectl autoscale, you specify a maximum and minimum number of replicas for your application, as well as a CPU utilization target. For example, to set the maximum number of replicas to six and the minimum to four, with a CPU utilization target of 50% utilization, run the following command: kubectl autoscale deployment my-app --max 6 --min 4 --cpu-percent 50 In this command, the --max flag is required. The --cpu-percent flag is the target CPU utilization over all the Pods. This command does not immediately scale the Deployment to six replicas, unless there is already a systemic demand. After running kubectl autoscale, the HorizontalPodAutoscaler object is created and targets the application. When there a change in load, the object increases or decreases the application's replicas. To see a specific HorizontalPodAutoscaler object in your cluster, run: kubectl get hpa [HPA_NAME] To see the HorizontalPodAutoscaler configuration: kubectl get hpa [HPA_NAME] -o yaml The output of this command is similar to the following: apiVersion: v1 items: - apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: creationTimestamp: ... name: [HPA_NAME] namespace: default resourceVersion: "664" selfLink: ... uid: ... spec: maxReplicas: 10 minReplicas: 1 scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: [HPA_NAME] targetCPUUtilizationPercentage: 50 status: currentReplicas: 0 desiredReplicas: 0 kind: List metadata: {} resourceVersion: "" selfLink: "" In this example output, the targetCPUUtilizationPercentage field holds the 50 percentage value passed in from the kubectl autoscale example. To see a detailed description of a specific HorizontalPodAutoscaler object in the cluster: kubectl describe hpa [HPA_NAME] You can modify the HorizontalPodAutoscaler by applying a new configuration file with kubectl apply, using kubectl edit, or using kubectl patch. To delete a HorizontalPodAutoscaler object: kubectl delete hpa [HPA_NAME] Console To autoscale a Deployment, perform the following steps: Visit the Google Kubernetes Engine Workloads menu in Cloud Console. Select the desired workload from the menu. Click Actions, then Autoscale. Fill the Maximum number of pods field with the desired maximum number of Pods. Optionally, fill the Minimum number of pods and Target CPU utilization in percent fields with the desired values. Click Autoscale. Autoscaling with Custom Metrics You can scale your Deployments based on custom metrics exported from [Stackdriver Kubernetes Engine Monitoring]. To learn how to use custom metrics to autoscale deployments, refer to the Autoscaling Deployments with Custom Metrics tutorial.
https://cloud.google.com/kubernetes-engine/docs/how-to/scaling-apps?hl=no
CC-MAIN-2020-10
en
refinedweb
Understanding Struts Controller Understanding Struts Controller In this section I will describe you the Controller.... It is the Controller part of the Struts Framework. ActionServlet is configured Hii.. - Struts Hii.. Hi friends, Thanks for nice responce....I will be very... me URL its very urgent Hi Soniya, I am sending you a link. I hope...:// Thanks. Amardeep Hi Hi Hi this is really good example to beginners who is learning struts2.0 thanks Struts - Struts Struts Dear Sir , I am very new in Struts and want to learn about validation and custom validation. U have given in a such nice way... provide the that examples zip. Thanks and regards Sanjeev. Hi friend.. - Java Beginners Hi.. Hi, I got some error please let me know what is the error integrity constraint (HPCLUSER.FAFORM24GJ2_FK) violated - parent key its very urgent Hi Ragini can u please send your complete source Java programming tutorial for very beginners Java programming tutorial for very beginners Hi, After completing my 12th Standard in India I would like to learn Java programming language. Is there any Java programming tutorial for very beginners? Thanks Hi Hi, - Java Beginners Hi, Hi friends I have some query please write the code and send me.I want adding value using javascript onChange() Events...please write the code and send me ts very urgent roseindia - Java Beginners hi roseindia what is java? Java is a platform independent..., Threading, collections etc. For Further information, you can go for very good...). Thanks/Regards, R.Ragavendran... Hi deepthi, Read for more Hi.... - Java Beginners Hi.... I hv 290 data and very large form..In one form it is not possible to save in one form so i want to break in to part....And i give...; Hi friend, Some points to be member to solve the problem : When Hi... - Struts Hi... Hi, If i am using hibernet with struts then require... of this installation Hi friend, Hibernate is Object-Oriented mapping tool... more information,tutorials and examples on Struts with Hibernate visit Big Problem - Java Beginners Very Big Problem Write a 'for' loop to input the current meter reading and the previous meter reading and calculate the electic bill.... Please give my answer in a for loop only and as soon as you can. Struts Provide material over struts? Hi Friend, Please visit the following link: Thanks Struts Struts How Struts is useful in application development? Where to learn Struts? Thanks Hi, Struts is very useful in writing web applications easily and quickly. Developer can write very extensible and high.java struts - Java Beginners java struts Hi sir i need complete digram of struts... how i can configer the struts in my eclipse... please send me the complete picture diagram hi - Java Beginners hi hi sir, i am entering the 2 dates in the jtable,i want to difference between that dates,plz provide the suitable example sir Hi.../beginners/DateDifferent.shtml Struts - Struts Struts for beginners struts for beginners example hi - Java Beginners hi Hi.... let me know the difference between object and instance variables with examples.... Hi friend, Objects are key to understanding object-oriented technology. Instance Method is a subroutine or function java material Hi Check this.... - Java Beginners Hi Check this.... Hi Sakthi here.. Run This Code.. Hi sakthi Your code is not visible here, can u send again please.. Thanks sir - Java Beginners hi sir Hi,sir,i am try in netbeans for to develop the swings,plz provide details about the how to run a program in netbeans and details about... the details sir, Thanks for ur coporation sir Hi Friend,Thanks for ur coporation, i am save the 1 image with customer data,when i am search that customer data,i want to see that image... sir,plzzzzzzzzzzzz Hi Friend, Please provide some more hi roseindia - Java Beginners hi roseindia what is object? A Blue print of class Hi deepthi, Objects are the basic run time entity or in other words object is a instance of a class . An object is a software bundle of variables friend - Java Beginners hi friend ummm i want to know a java code ...what are the code if i want to display inverted pyramid(shape). i mean a pyramid is reversed down.... thank u friends!!! Hi friend, Inverted pyramid code class hi Friend... - Java Beginners hi Friend... Hi friend... I have to import only " The System.out.println " Function Not any other Input Function ..How should i import... plz Explain this...Thank u.. Sakthi Hi friend, Java IO, what is the need for going to java.how java differ form .net.What is the advantage over .net.Is there any disadvantage in java Hi Friend, Difference between java and .net: 1)Java is developed by Sun Can someone explain Polymorphism with real time example Hi anjali, class ploy { public void ployTest(int x){ System.out.println("value of x: "+ x); } public void ployTest(int x, int y Friends, I want to write code in java for change password please provide the code change password have three field old_pwd,new_pwd,con_pwd Thanks Hi Friend, Create a database table login[id... I want to write code for change password from data base please help me import com.binsys.utility.DBOperation; package service... is occur Hi Friend, Try the following code: 1)change.jsp hi again - Java Beginners hi again i did the changes on the code but still the time is not decreasing i wanna reach increasing running time target sorry for asking too...; // testing every character for (int n=0 ;n Hi friend, Do changes Hi.. - Java Beginners Hi.. Hi friends, I want to display two calendar in my form,one is dislay successfully but another is not please tell me how display second... is successfully but date of birth is not why... Hi Friend, Try Struts - Struts Struts examples for beginners Struts tutorial and examples for beginners hi - Java Beginners hi hi sir,Thanks for ur coporation, i am save the 1 image with customer data,when i am search that customer data,i want to see that image (already... that image is rendered to my frame,that's my question Hi Friend ,plzzzzzzzzzzzzzzzzzzzzzzzzzzzz, i am declare the final for jtextfields Hi - Java Beginners singleton class in struts - Java Beginners singleton class in struts hi, This balakrishna, I want to retrive data from database on first hit to home page in struts frame work
http://www.roseindia.net/tutorialhelp/comment/13326
CC-MAIN-2014-10
en
refinedweb
Spring Integration: A Hands-On Tutorial, Part 1 Adding confirmation e-mails [The source for this section is available here] After an enrollment advisor (or some other staff member) creates a lead in the system, we want to send the lead an e-mail letting him know that that's happened. Actually—and this is a critical point—we really don't care how the lead was created. Anytime a lead appears on the newLeadChannel, we want to fire off a confirmation e-mail. I'm making the distinction because it points to an important aspect of the message bus: it allows us to control lead processing code centrally instead of having to chase it down in a bunch of different places. Right now there's only one way to create leads, but figure 2 revealed that we'll be adding others. No matter how many we add, they'll all result in sending a confirmation e-mail out to the lead. Figure 4 shows the new bit of plumbing we're going to add to our message bus. Figure 4. Send a confirmation e-mail when creating a lead. To do this, we're going to need to make a few changes to the configuration and code. POM changes First we need to update the POM. Here's a summary of the changes; see the code download for details: • Add a JavaMail dependency to the Jetty plug-in. • Add an org.springframework.context.support dependency. • Add a spring-integration-mail dependency. • Set the mail.version property. These changes will allow us to use JavaMail. Expose JavaMail sessions through JNDI We'll also need to add a /WEB-INF/jetty-env.xml configuration to make our JavaMail sessions available via JNDI. Once again, see the code download for details. I've included a /WEB-INF/jetty-env.xml.sample configuration for your convenience. As mentioned previously, you'll need access to an SMTP server. Besides creating jetty-env.xml, we'll need to update applicationContext.xml. Listing 6 shows the changes we need so we can use JavaMail and SMTP. Listing 6. /WEB-INF/applicationContext.xml changes supporting JavaMail and SMTP <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="" xmlns:context="" xmlns:jee="" xmlns:p="" xmlns:xsi="" xsi: <jee:jndi-lookup <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl" p: <context:component-scan </beans> The changes expose JavaMail sessions as a JNDI resource. We've declared the jee namespace and its schema location, configured the JNDI lookup, and created a JavaMailSenderImpl bean that we'll use for sending mail. We won't need any domain model changes to generate confirmation e-mails. We will however need to create a bean to back our new transformer endpoint. Service integration tier changes First, recall from figure 4 that the newLeadChannel feeds into a LeadToEmailTransformer endpoint. This endpoint takes a lead as an input and generates a confirmation e-mail as an output, and the e-mail gets pipes out to an SMTP transport. In general, transformers transform given inputs into desired outputs. No surprises there. Figure 4 is slightly misleading since it's actually the POJO itself that we're going to call LeadToEmailTransformer; the endpoint is really just a bean adapter that the messaging infrastructure provides so we can place the POJO on the message bus. Listing 7 presents the LeadToEmailTransformer POJO. Listing 7. LeadToEmailTransformer.java, a POJO to generate confirmation e-mails package crm.integration.transformers; import java.util.Date; import java.util.logging.Logger; import org.springframework.integration.annotation.Transformer; import org.springframework.mail.MailMessage; import org.springframework.mail.SimpleMailMessage; import crm.model.Lead; public class LeadToEmailTransformer { private static Logger log = Logger.getLogger("global"); private String confFrom; private String confSubj; private String confText; ... getters and setters for the fields ... @Transformer public MailMessage transform(Lead lead) { log.info("Transforming lead to confirmation e-mail: " + lead); String leadFullName = lead.getFullName(); String leadEmail = lead.getEmail(); MailMessage msg = new SimpleMailMessage(); msg.setTo(leadFullName == null ? leadEmail : leadFullName + " <" + leadEmail + ">"); msg.setFrom(confFrom); msg.setSubject(confSubj); msg.setSentDate(new Date()); msg.setText(confText); log.info("Transformed lead to confirmation e-mail: " + msg); return msg; } } Again, LeadToEmailTransformer is a POJO, so we use the @Transformer annotation to select the method that's performing the transformation. We use a Lead for the input and a MailMessage for the output, and perform a simple transformation in between. When defining backing beans for the various Spring Integration filters, it's possible to specify a Message as an input or an output. That is, if we want to deal with the messages themselves rather than their payloads, we can do that. (Don't confuse the MailMessage in listing 7 with a Spring Integration message; MailMessage represents an e-mail message, not a message bus message.) We might do that in cases where we want to read or manipulate message headers. In this tutorial we don't need to do that, so our backing beans just deal with payloads. Now we'll need to build out our message bus so that it looks like figure 4. We do this by updating applicationContext-integration.xml as shown in listing 8. Listing 8. /WEB-INF/applicationContext-integration.xml updates to support confirmation e-mails <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="" xmlns:mail="" xmlns:beans="" xmlns:context="" xmlns:p="" xmlns:xsi="" xsi: <context:property-placeholder <gateway id="leadGateway" service- <publish-subscribe-channel <service-activator <transformer input- <beans:bean <beans:property <beans:property <beans:property </beans:bean> </transformer> <channel id="confEmailChannel" /> <mail:outbound-channel-adapter </beans:beans> The property-placeholder configuration loads the various ${...} properties from a properties file; see /crm/src/main/resources/applicationContext.properties in the code download. You don't have to change anything in the properties file. The transformer configuration brings the LeadToEmailTransformer bean into the picture so it can transform Leads that appear on the newLeadChannel into MailMessages that it puts on the confEmailChannel. As a side note, the p namespace way of specifying bean properties doesn't seem to work here (I assume it's a bug:), so I just did it the more verbose way. The channel definition defines a point-to-point channel rather than a pub-sub channel. That means that only one endpoint can pull messages from the channel. Finally we have an outbound-channel-adapter that grabs MailMessages from the confEmailChannel and then sends them using the referenced mailSender, which we defined in listing 6. That's it for this section. We should have working confirmation e-mails. Restart your Jetty instance and go again to Fill it out and provide your real e-mail address in the e-mail field. A few moments after submitting the form you should receive a confirmation e-mail. If you don't see it, you might check your SMTP configuration in jetty-env.xml, or else check your spam folder. Summary In this tutorial we've taken our first steps toward developing an integrated lead management system. Though the current bus configuration is simple, we've already seen some key Spring Integration features, including • support for the Gateway pattern, allowing us to connect apps to the message bus without knowing about messages • point-to-point and pub-sub channels • service activators to allow us to place service beans on the bus • message transformers • outbound SMTP channel adapters to allow us to send e-mail The second tutorial will continue elaborating what we've developed here, demonstrating the use of several additional Spring Integration features, including • message routers (including content-based message routers) • outbound web service gateways for sending SOAP messages • inbound HTTP adapters for collecting HTML form data from external systems • inbound e-mail channel adapters (we'll use IMAP IDLE, though POP and IMAP are also possible) for processing incoming e-mails Enjoy, and stay tuned. Willie is a solutions architect with 12 years of Java development experience. He and his brother John are coauthors of the upcoming book Spring in Practice by Manning Publications (). Willie also publishes technical articles (including many on Spring) to wheelersoftware.com/articles/.Willie is a solutions architect with 12 years of Java development experience. He and his brother John are coauthors of the upcoming book Spring in Practice by Manning Publications (). Willie also publishes technical articles (including many on Spring) to wheelersoftware.com/articles/. - « first - 1 - 2 - 3 - 4 (Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.) Koen VT replied on Thu, 2009/08/20 - 2:32am
http://java.dzone.com/articles/spring-integration-hands?page=0,3
CC-MAIN-2014-10
en
refinedweb
Designing and building a datacenter has many pitfalls: There's time spent -- and often wasted -- as representatives from departments throughout the organization gather round the table and butt heads over the design of the new facility. There's also the wasteful practice of building more datacenter than you actually need, be it in terms of size, density, or redundancy. You end up stuck paying the bills to build and power that extra infrastructure without getting any return (until the time comes that you need it). IBM has set out to address these problems as part of the second phase of its $1 billion Project Big Green initiative. The company this week announced the availability of new modular datacenter designs, aimed at helping companies install and scale datacenters quickly and in sync with their needs. The notion of designing datacenters in a modular, "pay-as-you-grow" fashion seems to be gaining momentum. IBM already offers the 500- and 1,000-square-foot Scalable Modular Data Center for smaller organizations, and customers such as Bryant University have reaped the benefits. Similarly, Sun, unveiled a highly modular, scalable datacenter in Santa Clara, Calif. last year. Model modularity One of IBM's new offerings is called the Enterprise Modular Data Center (EMDC). It starts at a minimum 5,000-square-foot standardized module, including racking systems, raised floor, power, and cooling. (IBM calls them "shrink-wrapped," but they don't actually come in, say, a storage container -- unlike the other modular datacenter I'll discuss next.) The base EMDC module delivers density of 100W per square foot, according to Brian Canney, IBM Global Services executive for site and facilities services. As a company's computing needs increase, however, the datacenter can be expanded on the fly in two ways, according to Canney, thanks to the standardized nature of the modules. The datacenter operator could expand horizontally up to 25,000 square feet by adding additional 5,000-square-foot modules, or "vertically," as Canney puts it, which entails increasing the density of the facility in increments of 100W per square foot. Thus over time, a company could theoretically expand its datacenter 12 times, starting at a 5,000-square-foot, low-density facility and eventually reaching 25,000 square feet of high-density datacenter with 300W of power per square foot. Customers can have some say in the design of the module -- for example, opting for more or less redundancy, but again, it's mostly a standardized design. The payoff: Implementation is 25 percent faster than you'd expect with a customized datacenter design.
http://www.infoworld.com/d/green-it/ibm-makes-big-green-push-modular-datacenters-818?source=fssr
CC-MAIN-2014-10
en
refinedweb
iGeneralMeshState Struct Reference [Mesh plugins] This interface describes the API for the general mesh object. More... #include <imesh/genmesh.h> Detailed Description This interface describes the API for the general mesh object. Main creators of instances implementing this interface: - Genmesh mesh object plugin (crystalspace.mesh.object.genmesh) - iMeshObjectFactory::NewInstance() Main ways to get pointers to this interface: Main users of this interface: - Genmesh Loader plugin (crystalspace.mesh.loader.genmesh) Definition at line 255 of file genmesh.h. Member Function Documentation Find the index of a submesh. The index can be used with DeleteSubMesh() and the GetSubMesh...() methods. Returns 0 if the submesh was not found. The returned interface can be used for limited per-object variation of the submeshes as defined in the factory. Currently the following aspects can be overridden: - Shader variables (by querying the iShaderVariableContext interface) Set the progressive LOD level on all submeshes. If a submesh's max prog LOD level is less than level, set it to its maximum. Get the current animation control for this object. Set the animation control to use for this mesh object. See iGenMeshAnimationControl for more information. The documentation for this struct was generated from the following file: Generated for Crystal Space 2.0 by doxygen 1.6.1
http://www.crystalspace3d.org/docs/online/api-2.0/structiGeneralMeshState.html
CC-MAIN-2014-10
en
refinedweb
Many of us have seen sci-fi movies where the characters come home, walk in the front door, and their lights turn on for them. Perhaps they tell the house to switch on the TV or bring up the video phone with its wall-sized screen to call a friend. Unfortunately, we're not quite "there" yet with regard to commercially-available home automation technology. But you might be surprised at how much can be achieved by the enthusiast looking to advance his home into the 21st century. Let me show you some of the shipping protocols and options. Then, we'll walk through the purchase process and installation to see what it takes to turn a house into a modern-day electronic toy. Before we get ahead of ourselves, lets talk a little about what home automation is, exactly. HA, short for home automation, is a technology class that enables automatic and/or remote control of household electronics. The most commonly connected devices in an HA implementation are usually lamps/over-head lighting, heating/air conditioning, lawn and garden irrigation, and security systems. One of the vendors we looked at, SmartHome, seems fairly biased by their near-exclusive offering of Insteon products. But the company does have some convenient information on HA, including a chart of the available technologies. You can check that out right here. We'll dig into more of the differences, considerations and available options later. Interview with George Hanover First, we wanted to talk to an expert in the field and find out why home automation isn't more popular among computing enthusiasts than it is today. We exchanged emails with George Hanover, a fellow and membership chair of the IEEE Consumer Electronics Society, to find out more. Tom's Hardware: Why isn't home automation more pervasive today? George: Well it is catching on, albeit slowly. “Buying” home automation is not like buying an appliance or even a home theater system. A customer can be shown a new refrigerator or TV set, but how does a salesman effectively demonstrate home automation? Also, all of the user devices must be compatible with each other and with the HA system so that they can talk to each other. So, when a customer buys in to a particular system, he/she is really making a long-term commitment. Tom's Hardware: We'd think that a basic home automation setup could be deployed for less than the price of a mid-grade computer. Many households have two or more computers these days. Is it the installation process scaring most folks off? George: Also, there’s the matter of retrofitting into the existing housing inventory. Each year, only a tiny percentage of the housing stock is new, which means the biggest market for HA is in existing homes, and some of them have been around for 40+ years. Tom's Hardware: Most people don't install irrigation systems themselves. Instead, they hire a contractor to perform the installation. Are there home automation installers, and are they difficult to find? George: Yes, there are, and no they’re not. Check the Customer Electronic Design and Installation Association (CEDIA) Web site at. You will see an installer locater and also find that CEDIA has a certification program for installers and holds an annual expo. Also, I think the level of expertise needed to install a first-rate HA system is much higher than needed to install an irrigation. It was mentioned on page 3:... Second - The "industry", for all our "talk" does NOT think home automation is even remotely a priority for the "masses". A "techno-geek", here or there, yes, but not the average consumer. Without the second, you will not get the first.. As consumers, we need to be told what this will do for us in a way that we can understand and see real benefits from. Not "off the wall" concepts of futuristic homes, but down to earth, realities that we could feel, today...or even tomorrow (short term). Not to mention, at a price point which is do-able for the majority.. Could any of it be done? I believe so, but I think, at this moment, there is no one company, no group of companies, who will bother. The ROI just is not there. Getting the right hardware/software combination is critical. I have gone from X-10 to the latest "Insteon" products and reliability has improved 90%. I. I ran X10 for years and had reliability and interference issues. 99% of these are gone with Insteon, the appearance of the devices is much nicer and the programmability is superior - using the ISY99 from Universal Devices. The author should seriously refrain from giving electrical advice: ... White is neutral (hot) and is ... I really hope this was a typo, because it kind of suggests that the author doesn't know (very basic!) difference between hot (black) and neutral (white). In the name of not having any Tom's readers electrocute themselves, I'd reccomed saying nothing more. Sometimes you'll happen upon different colors used for the same thing just because an older standard wasn't specifying a color for certain things at all, or the technician ran out of white and didn't care... Good point, neutral is not hot, its the return (completes the circuit) but not really a safety issue. People afraid of touching the neutral won't hurt anything, besides, the author already covered making sure that power was removed from the circuit.
http://www.tomshardware.com/reviews/home-automation-insteon,2308.html
CC-MAIN-2014-10
en
refinedweb
. The other day I went out to dinner to Fareast with my wife and daughter. On the way out I met a group of people who had come down from USA. They had their 8-month old daughter with them. In the casual chat that followed one of them asked my daughter's name and I answered Prokriti. I was kind of surprised by the question that followed. The gentleman asked me what the name means (BTW it means Nature in Bangla and Hindi) This brings up an interesting side to Indian names which that gentlemen seemed to know, most people's name in India have a meaning or some other significance like the name of some God/Goddess or some other mythological significance. AFAIK, this is not true in Western countries. I'll take some examples. Abhinaba (my name) => UnprecedentedSomtapa (my wife) => One who worships the moon goddess.Hemant (friend) => Spring season in Sanskrit/hindiMohor (sister) => Golden coinPralay (friend) => Doom, cataclysm A lot of times the names are based on the names of some god or goddess like Shiva, Vishnu, Durga. Sometimes these names become kind of funny. For example long back I met someone with the name Nirdosh, which meant not-guilty. I couldn't figure out what lead his parents to name him such :) C++ and C# varies considerably in how virtual method calls from constructors work. I feel that the approach taken by C++ is significantly better. Let's consider the following code in C++. #include <iostream> using namespace std; class Base { public: Base() { Foo(); } virtual void Foo() { cout << "Base::Foo" << endl; } }; class Derived : Base { public: Derived() { } void Foo() { cout << "Derived::Foo" << endl; } }; Derived* der = new Derived(); The output of the program is Base::Foo. Here the Base class constructor is calling the virtual method Foo. In C++ (as with most OO language) the Base class is created before the Derived class and hence the base class constructor is called first. So when the call to Foo is made in Base::Base(), Derived is not yet created and hence the call Foo() ends in Base::Foo and not its override in Derived::Foo. In C# the behavior is different and always the most derived override is called. class Base { public Base() { Foo(); } public virtual void Foo() { Console.WriteLine("Base::Foo"); } } class Derived : Base { string str = null; public Derived() { str = "Hello world"; } public override void Foo() { Console.WriteLine("Derived::Foo"); //Console.WriteLine(str); } } class Program { static void Main(string[] args) { Derived der = new Derived(); } } In this case the output is Derived::Foo. Even in C# the base class is created first and its constructor is called first. However calls to virtual methods always land on the most derived version which in this case is Derived::Foo(). However there are issues with this. Even though Derived::Foo gets called, Derived class is still not initialized properly and its constructor is not yet called. In the above code the variable str is not initialized and if it is referred from Derived::Foo a null reference will occur. So I tend to believe that even though C++ implementation needs a bit more understanding of object creation (vtable build-up) it is safer. Due to all these subtleties its always recommended to not refer to virtual methods from ctors. If for example you are writing some code that will be used by others (as in Frameworks) then this may break the client developers if they derive from your class. They may never anticipate that calls to their overrides may hit un-initialized variables which they have explicitly initialized in the derived class's constructor. I'm currently working on a personal project that needs to spit out code after parsing some XML file. I had previously used the .NET frameworks CodeDom to do on the fly compilation and hence tried digging it up to see if I could use it for code generation. In a small time I was completely blown over by the feature set and what I could achieve in a relatively small time. I had initially expected to get little support from the framework and had thought I'd manipulate text to generate the C# code. I now figured out that I could use the CodeDom to build the code structure hierarchy and just pass on a language parameter and if that language is supported generate code using that language. Suddenly my application was not limited to C# but I could use VB.NET or VJ# for my output code as well. To demonstrate this I'd skip the XML parsing (serialization and logic) part. The following code generates a hello world program in any of the supported .NET language private void BtnGenerate_Click(object sender, EventArgs e){ TextCode.Text = GenerateCode("C#"); TextCode.Text += GenerateCode("VJ#"); TextCode.Text += GenerateCode("VB");}public string GenerateCode(string language){ // get CodeDom provider from the language name CodeDomProvider provider = CSharpCodeProvider.CreateProvider(language); // generate the code return GenerateCode(provider);}public string GenerateCode(CodeDomProvider provider){ // open string based in memory streams using(StringWriter writer = new StringWriter()) using (IndentedTextWriter tw = new IndentedTextWriter(writer, " ")) { // create top level namespace CodeNamespace myNamespace = new CodeNamespace("AbhinabaNameSpace"); // create file level comment CodeComment comment = new CodeComment( string.Format("Generated on {0}", DateTime.Now.ToLocalTime().ToShortDateString()), false); CodeCommentStatement commentStatement = new CodeCommentStatement(comment); myNamespace.Comments.Add(commentStatement); // add using statements for the required namespaces myNamespace.Imports.Add( new CodeNamespaceImport("System")); // define the one and only class CodeTypeDeclaration mainClass = new CodeTypeDeclaration(); mainClass.IsClass = true; mainClass.Name = "HelloWorldMainClass"; mainClass.Attributes = MemberAttributes.Public; myNamespace.Types.Add(mainClass); //define the entry point which'd be //Main method in C# CodeEntryPointMethod mainMethod = new CodeEntryPointMethod(); mainMethod.Comments.Add( new CodeCommentStatement("<summary>", true)); mainMethod.Comments.Add( new CodeCommentStatement("Entry point", true)); mainMethod.Comments.Add( new CodeCommentStatement("</summary>", true)); mainClass.Members.Add(mainMethod); //define the string variable message CodeVariableDeclarationStatement strDecl = new CodeVariableDeclarationStatement( new CodeTypeReference(typeof(string)), "message"); mainMethod.Statements.Add(strDecl); //create the message = "hello world" statement CodeAssignStatement ptxAssign = new CodeAssignStatement( new CodeVariableReferenceExpression("message"), new CodeSnippetExpression("\"hello world\"")); mainMethod.Statements.Add(ptxAssign); //call console.writeline to print the statement CodeMethodInvokeExpression invokeConsoleWriteLine = new CodeMethodInvokeExpression( new CodeTypeReferenceExpression(typeof(Console)), (); }} private (); }} If only more languages were on .NET I could build the list in in about couple of hours :) I get the following output In C# ======= // Generated on 2/27/2006 namespace AbhinabaNameSpace { using System; public class HelloWorldMainClass { /// /// Entry point /// public static void Main() { string message; message = "hello world"; System.Console.WriteLine(message); } } } VJ# ======= // Generated on 2/27/2006 package AbhinabaNameSpace; import System.*; public class HelloWorldMainClass { /** Entry point */ public static void main(String[] args) { String message; message = "hello world"; System.Console.WriteLine(message); } } VB ======= Imports System 'Generated on 2/27/2006 Namespace AbhinabaNameSpace Public Class HelloWorldMainClass ''' '''Entry point ''' Public Shared Sub Main() Dim message As String message = "hello world" System.Console.WriteLine(message) End Sub End Class End Namespace In all the code I wrote for VSTF I never used unsafe C# code. However, recently I was writing a tool which needed some unsafe code (sizeof in particular). While writing the code I thought of some quick points to remember while using unsafe code. Do not use redundant unsafe context In C#2.0 you no longer need to use unsafe context while applying sizeof to predefined types. This means the following code compiles without any unsafe context. class MyClass{ static public void Foo() { Console.WriteLine(sizeof(int)); Console.WriteLine(sizeof(byte)); }} Limit the scope of the unsafe context Locate the minimal scope of unsafe code and apply either the unsafe modifier or unsafe statement over that minimal scope only. The following is bad, because other methods in the class are also included in the unsafe context and unintentinally unsafe code may creep into them. unsafe class MyClass{ static public void Foo() { Console.WriteLine(sizeof(MyStruct)); }} The following is better because only required methods are marked as unsafe. class MyClass{ unsafe static public void Foo() { Console.WriteLine(sizeof(MyStruct)); }} The following is the best option if you have unsafe code only in limited places, as this gives the unsafe context only to the minimal scope (statement level). class MyClass{ static public void Foo() { unsafe { Console.WriteLine(sizeof(MyStruct)); } }} } Be careful about subtle syntax difference Most commonly these unsafe features get used by C/C++ programmers moving into C#. The syntax looks deceptively similar to C/C++ but sometimes varies. The following statment is valid C/C++ and valid C# as well. int * a, b; int However, in C/C++ it means that a is a pointer and b is not but in C# a and b are both pointers to ints. So in C# * should be written with type as in int* and not with the pointer name. Becareful about what pointers you return This is equally true for C/C++. You must ensure that you are not returning a pointer (as return value or ref/out arguments) that points to a local variable. Once the function returns the stack is popped and the local variables are gone. So the returned pointers become dangling pointers if they pointed to some local variables You can't point to everything Everything that resides in the manages heap can be moved around (relocated) by the garbage-collector and therefore it is not possible to have pointers to it directly. You can have pointers only to fixed variables. Fixed variables include stuff that is on the stack like local variables and value-type function-parameters. You can also take pointers to variables on the heap after pinning them with a fixed expression class MyClass{ static int statNum = 50; unsafe static public void Bar(int paramNum) { int localNum; int* ap; ap = &localNum; //local variable ap = ¶mNum; //value-type argument //pin so that the address don't change fixed(int* apnew = &statNum) { Console.WriteLine(*apnew); } }} Avoid unsafe code and pointers There was a reson for which pointers were excluded in core C#. Even though pointers make a language very powerfull they introduce complexity and pointer related bugs like dangling pointers, overrun, type-unsafety plague the software. C/C++ programmers have a habit of using unsafe context even when they are not required and this is a habit that may lead to trouble in the .NET world. Use unsafe code only when absolutely necessary.... . In the initial years user interfaces derived heavily from real-life objects. Common examples include buttons, spin controls, dials, check-boxes and radio-buttons. Modern UI design relies on prior Computer exposure of general public and controls are now designed for the user-interfaces directly and not modeled on objects. Today we no-longer see the 3d button like controls in tool bars. There are exceptions like media players and clocks, but they have exact real-world couterparts. One of the things that worked somewhat opposite to the real-world is the scroll-bar. When we read from a piece of paper, we move the paper up to continue reading it. However on-screen we click on the down arrow below the scroll bar to make the document move up. Some software like Adobe Acrobat models there user-experience on the real-world. There you have the option of using the Hand Tool to grab the document and push it up, as you'd do with a piece of paper. Its funny to notice that most people are more comfortable with the scroll bar and not with this hand tool. Dominant software makes users conditioned to do things is a way so much so that they start feeling that this is indeed the right way to go. I have noticed a very similar thing with elevators. In developed countries its hard (or impossible) to find someone not accustomed to elevators. But in developing countries like India you sometimes do find people who are not very familiar with it. For them elevators are like cabs, they figure out they need to summon it and once inside need to tell it which direction to go. For them the usage pattern is very different. If they need to go down and the elevator is on some floor below them, they'll press the up button to call the elevator. When inside they'll press the down button. But to their astonishment it'll go to floors above them first. Currentlyा); } } }} using namespace {. I was reading Mike Stall's blog and he said that his last post was #200. This got me thinking and I went to check my blog-stat. My blog admin page currently states Total Posts: 100 So this means I just hit a century. This is a cricket term and I intentionally used it tell some people that just as you do not understand cricket we do not understand Super Bowl (American Football) jargon either :) I initially started this blog to rant about Team System, but it looks like I am ranting more about C#/.NET these days. In future I intend to keep it this way. I also hope that I do not act like Tendulkar and get out soon after my century. (This is another cricketing thing for folks who talks too much about Super Bowl in their blogs :) Sometime back I had posted about writing applications that can load plugins using late binding. Users can drop assemblies in a specific folders which is scanned by an host application at startup. Using reflection the host can locate classes that implement a specific interface and instantiate those classes as plugins. The drawback is that the host processes plugin assemblies and you need to store/maintain the corresponding sources elsewhere. This can be extended using on the fly compilation. In this technique the user drops source files in a specific folder and the host-application either at startup or on user request compiles the sources in-memory and loads the generated assembly. The sources can be in any of the .NET languages like C#, VB.NET or J#. The whole of this can be trivially accomplished using the Microsoft.CSharp and the System.CodeDom.Compiler namespaces from System.dll. We can call these sources as scripts as they are available as sources. However, in the truest sense they are not scripts because they are not interpreted but are compiled and executed. They are more of plugins where the step of compilation is done by the host application. There are several security issues to be considered before using this technique and so you might want to read the drawbacks section at the end of this post before trying this out. The Common Contract The first and one of the most important things to decide is the Document Object Model or the DOM that the host-application exposes. The DOM is used by the script to manipulate the host-application. Similarly it's also important to decide the interface that the script exposes so that the host application can locate the script class in the script-source and instantiate the class. The DOM and the script interface together form the SW contract that both parties use to communicate with each other. It's best to define the DOM and the script interface in a common extension dll and make both the host application and all scripts refer to it. The DOM is also defined in terms of an interface which the host application implements. For our purpose let's consider the simple DOM/script-interface combination. namespace ScriptableApplication.Extensibility{ public delegate void ClickEvent(int x, int y); public interface IHost { string Title { get; set; } Color BackgroundColor { get; set; } event ClickEvent Click; } public interface IScript { string Name {get;} string Description { get;} void Initialize(IHost host); void Close(); }} { } public interface IScript Here the host exposes a simple DOM using which the scripts can modify the host-applications title text and background color. It also exposes an event which is fired each time user clicks on the host-form. Scripts can subscribe to the event to get click notification along with the coordinates of the click. Each script needs to have at least one class that implements the IScript interface. The host application compiles the script on the fly and using reflection looks for any class that implements this interface and instantiates that class. It then calls the Initialize method passing it the IHost pointer which the script can use to manipulate the host DOM. On the Fly Compilation This is what makes the whole technique work. .NET framework exposes all the compilers and associated framework in a very well designed namespace. This can be used to locate any compiler registered with a given file extension and use it to compile the sources. private CompilerResults LoadScript(string filepath){ string language = CSharpCodeProvider.GetLanguageFromExtension( Path.GetExtension(filepath)); CodeDomProvider codeDomProvider = CSharpCodeProvider.CreateProvider(language); CompilerParameters compilerParams = new CompilerParameters(); compilerParams.GenerateExecutable = false; compilerParams.GenerateInMemory = true; compilerParams.IncludeDebugInformation = false; string extAssembly = Path.Combine( Path.GetDirectoryName(Application.ExecutablePath), "Extensibility.dll"); compilerParams.ReferencedAssemblies.Add(extAssembly); compilerParams.ReferencedAssemblies.Add("System.dll"); compilerParams.ReferencedAssemblies.Add("System.Drawing.dll"); compilerParams.ReferencedAssemblies.Add("System.Windows.Forms.dll"); return codeDomProvider.CompileAssemblyFromFile(compilerParams, filepath);} In the first part we use the .NET framework to locate the relevant compiler based on the extension of the script file. In case of unsupported language System.Configuration.ConfigurationErrorsException is thrown. After we get the code-dom provider we create the compiler parameters. The GenerateInMemory flag is set to indicate the assembly is not generated on disk but in-memory. Since the script needs to refer to the extensibility dll and some bare minimal .NET framework dlls, they are added to the ReferencedAssemblies collection. After that the compilation is done and the result of the compilation is returned as a CompilerResults object. In case compilation fails the failures are available and are enumerated as follows CompilerResults result = LoadScript(filePath);if (result.Errors.HasErrors){ StringBuilder errors = new StringBuilder(); string filename = Path.GetFileName(filePath); foreach (CompilerError err in result.Errors) { errors.Append(string.Format("\r\n{0}({1},{2}): {3}: {4}", filename, err.Line, err.Column, err.ErrorNumber, err.ErrorText)); } string str = "Error loading script\r\n" + errors.ToString(); throw new ApplicationException(str);} This gives detailed failure messages along with rom/column numbers of the failure. If there are no compilation errors then the compiled in-memory assembly is available in result.CompiledAssembly. The host uses reflection to search through all the types in the assembly that implements IScript interface and loads that type and calls IScript methods. GetPlugins(result.CompiledAssembly);private void GetPlugins(Assembly assembly){ foreach (Type type in assembly.GetTypes()) { if (!type.IsClass || type.IsNotPublic) continue; Type[] interfaces = type.GetInterfaces(); if (((IList<Type>)interfaces).Contains(typeof(IScript))) { IScript iScript = (IScript)Activator.CreateInstance(type); iScript.Initialize(m_host); // add the script details to a collection ScriptDetails.Add(string.Format("{0} ({1})\r\n", iScript.Name, iScript.Description)); } }} With this we are done initializing the plugins Implementing the scripts Implementing the scripts is simple and can be done in any .NET language. The following example is a script in C#. using System;using ScriptableApplication.Extensibility;using System.Drawing;public class Script : IScript{ int i = 0; IHost host = null; public string Name {get {return "CoolScript";}} public string Description { get {return "Coolest script";}} public void Initialize(IHost host) { this.host = host; host.Click += delegate(int x, int y) { host.Title = string.Format("Clicked on {0}, {1}", x, y); Random autoRand = new Random(); host.BackgroundColor = Color.FromArgb(autoRand.Next(0, 255), autoRand.Next(0, 255), autoRand.Next(0, 255)); }; } public void Close() { }} host.BackgroundColor = Color.FromArgb(autoRand.Next(0, 255), autoRand.Next(0, 255), autoRand.Next(0, 255)); }; The script stores the IHost reference and subscribes to the IHost.Click event. In the event handler it sets the host dialogs title to the position of the click and changes the background-color to some random generated color. Similarly scripts can be written in VB.NET as follows Imports Microsoft.VisualBasicImports SystemImports System.DrawingImports ScriptableApplication.ExtensibilityPublic Class Class1 Implements IScript Public Sub Initialize(ByVal host As IHost) Implements IScript.Initialize host.Title = "VB Script loaded" End Sub Public Sub Close() Implements IScript.Close End Sub Public ReadOnly Property Description() As String Implements IScript.Description Get Description = "I'm a nice VB script" End Get End Property Public ReadOnly Property Name() As String Implements IScript.Name Get Name = "VB Script" End Get End PropertyEnd Class Sample project You can download the complete sample from here. It contains the following Extensibility project: This contains only one source file Interfaces.cs which contains definition for the IScript and IHost interfaces. This project generates the Extensibility.dll. ScriptableApplication project: This contains ScriptHandler.cs which has the complete implementation of on the fly compilation and loading of the dlls. MainForm.cs which implements the host application. Scripts: Contains two sample scripts script.cs and script.vb Drawbacks There are two huge drawbacks to this technique, both of which related to security. If any user with lesser privilege has access to the plugins folder or can direct the host-application to pick up a script from any folder then the user can execute any code he wants using the credentials of the host application. In my case I used this to create motion detection algorithm plugins. This was a personal use test code and I ensured that only I and other admins of the box had write permission to the plugins folder, and so it is kind-of safe for use. However, if you want to use this in a program that's distributed outside you need to plug this security-flaw. I had initially assumed that I can apply assembly level security restrictions on the generated assembly to disallow file and network access using something like [assembly: FileIOPermission(SecurityAction.RequestRefuse, Unrestricted = true)] and I'll be done. I am not an expert on security related issues and so I asked around on what is the best option in securing this scenario. Shawn Farkas suggested that the best option would be to use sand-boxed AppDomains. However since the plugin will be in an AppDomain different from the AppDomain in which the host application exists, there'll be performance cost due to cross appdomain calls that needs marshalling. The other issue is error conditions in the script. If there is an unhandled exception in the script it'll bring the whole application down. Steve Yi has a interesting post about Mysterious things he has eaten. Since I am from India we are used to a lot of food that may be considered as Mysterious. I couldn't figure out why Kimchee made into his list. It's served in all oriental restaurant here and is very main stream. Anyways I thought I'd post the mysterious things I ate And no we do not eat snakes and bull-eyes as depicted in the Indiana Jones movie :-)
http://blogs.msdn.com/b/abhinaba/archive/2006/02.aspx
CC-MAIN-2014-10
en
refinedweb
#include <db_cxx.h> int DbTxn::prepare(u_int8_t gid[DB_GID_SIZE]); The DbTxTx. All open cursors in the transaction are closed and the first cursor close error will be returned. The DbTxn::prepare() method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. The errors that this method returns include the error values of Dbc::close() and the following:. The gid parameter specifies the global transaction ID by which this transaction will be known. This global transaction ID will be returned in calls to DbEnv::txn_recover() telling the application which global transactions must be resolved.
http://idlebox.net/2011/apidocs/db-5.2.28.zip/api_reference/CXX/txnprepare.html
CC-MAIN-2014-10
en
refinedweb
player_ranger_data_intnspose Struct Reference #include <player_interfaces.h> Collaboration diagram for player_ranger_data_intnspose: Detailed DescriptionData: post-stamped intensity scan (PLAYER_RANGER_DATA_INTNSPOSE). An intensity scan with the (possibly estimated) pose of the device when the scan was acquired. Definition at line 445 of file player_interfaces.h. The documentation for this struct was generated from the following file:
http://playerstage.sourceforge.net/doc/Player-2.1.0/player/structplayer__ranger__data__intnspose.html
CC-MAIN-2014-10
en
refinedweb
When instead see your public error pages. You need to keep track of errors that occur in deployed sites, so Django can be configured to create reports with details about those errors. When DEBUG is False, Django will email the users listed in the ADMINS setting whenever your code raises an unhandled exception and results in an internal server error (strictly speaking, for any response with an HTTP status code of 500 or greater). This gives the administrators immediate notification of any errors. The ADMINS will get a description of the error, a complete Python traceback, and details about the HTTP request that caused the error. Note In order to send email, Django requires a few settings telling it how to connect to your mail server. At the very least, you’ll need to specify. Django can also be configured to email errors about broken links (404 “page not found” errors). Django sends emails about 404 errors when: DEBUGis False; MIDDLEWAREsetting includes django.middleware.common.BrokenLinkEmailsMiddleware. If those conditions are met, Django will email the users listed in the MANAGERS setting whenever your code raises a 404 and the request has a referer. It doesn’t bother to email for 404s that don’t have a referer – those are usually people typing in broken URLs or broken Web bots. It also ignores 404s when the referer is equal to the requested URL, since this behavior is from broken Web bots too. Note BrokenLinkEmailsMiddleware must appear before other middleware that intercepts 404 errors, such as LocaleMiddleware or FlatpageFallbackMiddleware. Put it towards the top of your MIDDLEWARE setting. You can tell Django to stop reporting particular 404s by tweaking the IGNORABLE_404_URLS setting. It should be a list of compiled regular expression objects. For example: import re IGNORABLE_404_URLS = [ re.compile(r'\.(php|cgi)$'), re.compile(r'^/phpmyadmin/'), ] In this example, a 404 to any URL ending with .php or .cgi will not be reported. Neither will any URL starting with /phpmyadmin/. The following example shows how to exclude some conventional URLs that browsers and crawlers often request: import re IGNORABLE_404_URLS = [ re.compile(r'^/apple-touch-icon.*\.png$'), re.compile(r'^/favicon\.ico$'), re.compile(r'^/robots\.txt$'), ] (Note that these are regular expressions, so we put a backslash in front of periods to escape them.) If you’d like to customize the behavior of django.middleware.common.BrokenLinkEmailsMiddleware further (for example to ignore requests coming from web crawlers), you should subclass it and override its methods. See also 404 errors are logged using the logging framework. By default, these log records are ignored, but you can use them for error reporting by writing a handler and configuring logging appropriately. Warning Filtering sensitive data is a hard problem, and it’s nearly impossible to guarantee that sensitive data won’t leak into an error report. Therefore, error reports should only be available to trusted team members and you should avoid transmitting error reports unencrypted over the Internet (such as through email). Error reports are really helpful for debugging errors, so it is generally useful to record as much relevant information about those errors as possible. For example, by default Django records the full traceback for the exception raised, each traceback frame’s local variables, and the HttpRequest’s attributes. However, sometimes certain types of information may be too sensitive and thus may not be appropriate to be kept track of, for example a user’s password or credit card number. So in addition to filtering out settings that appear to be sensitive as described in the DEBUG documentation, Django offers a set of function decorators to help you control which information should be filtered out of error reports in a production environment (that is, where DEBUG is set to False): sensitive_variables() and sensitive_post_parameters(). sensitive_variables(*variables)¶ If a function (either a view or any regular callback) in your code uses local variables susceptible to contain sensitive information, you may prevent the values of those variables from being included in error reports using the sensitive_variables decorator: from django.views.decorators.debug import sensitive_variables @sensitive_variables('user', 'pw', 'cc') def process_info(user): pw = user.pass_word cc = user.credit_card_number name = user.name ... In the above example, the values for the user, pw and cc variables will be hidden and replaced with stars (**********) in the error reports, whereas the value of the name variable will be disclosed. To systematically hide all local variables of a function from error logs, do not provide any argument to the sensitive_variables decorator: @sensitive_variables() def my_function(): ... When using multiple decorators If the variable you want to hide is also a function argument (e.g. ‘ user’ in the following example), and if the decorated function has multiple decorators, then make sure to place @sensitive_variables at the top of the decorator chain. This way it will also hide the function argument as it gets passed through the other decorators: @sensitive_variables('user', 'pw', 'cc') @some_decorator @another_decorator def process_info(user): ... sensitive_post_parameters(*parameters)¶ If one of your views receives an HttpRequest object with POST parameters susceptible to contain sensitive information, you may prevent the values of those parameters from being included in the error reports using the sensitive_post_parameters decorator: from django.views.decorators.debug import sensitive_post_parameters @sensitive_post_parameters('pass_word', 'credit_card_number') def record_user_profile(request): UserProfile.create( user=request.user, password=request.POST['pass_word'], credit_card=request.POST['credit_card_number'], name=request.POST['name'], ) ... In the above example, the values for the pass_word and credit_card_number POST parameters will be hidden and replaced with stars (**********) in the request’s representation inside the error reports, whereas the value of the name parameter will be disclosed. To systematically hide all POST parameters of a request in error reports, do not provide any argument to the sensitive_post_parameters decorator: @sensitive_post_parameters() def my_view(request): ... All POST parameters are systematically filtered out of error reports for certain django.contrib.auth.views views ( password_reset_confirm, password_change, and add_view and user_change_password in the auth admin) to prevent the leaking of sensitive information such as user passwords. All sensitive_variables() and sensitive_post_parameters() do is, respectively, annotate the decorated function with the names of sensitive variables and annotate the HttpRequest object with the names of sensitive POST parameters, so that this sensitive information can later be filtered out of reports when an error occurs. The actual filtering is done by Django’s default error reporter filter: django.views.debug.SafeExceptionReporterFilter. This filter uses the decorators’ annotations to replace the corresponding values with stars (**********) when the error reports are produced. If you wish to override or customize this default behavior for your entire site, you need to define your own filter class and tell Django to use it via the DEFAULT_EXCEPTION_REPORTER_FILTER setting: DEFAULT_EXCEPTION_REPORTER_FILTER = 'path.to.your.CustomExceptionReporterFilter' You may also control in a more granular way which filter to use within any given view by setting the HttpRequest’s exception_reporter_filter attribute: def my_view(request): if request.user.is_authenticated: request.exception_reporter_filter = CustomExceptionReporterFilter() ... Your custom filter class needs to inherit from django.views.debug.SafeExceptionReporterFilter and may override the following methods: SafeExceptionReporterFilter¶ SafeExceptionReporterFilter. is_active(request)¶ Returns True to activate the filtering operated in the other methods. By default the filter is active if DEBUG is False. SafeExceptionReporterFilter. get_post_parameters(request)¶ Returns the filtered dictionary of POST parameters. By default it replaces the values of sensitive parameters with stars (**********). SafeExceptionReporterFilter. get_traceback_frame_variables(request, tb_frame)¶ Returns the filtered dictionary of local variables for the given traceback frame. By default it replaces the values of sensitive variables with stars (**********). See also You can also set up custom error reporting by writing a custom piece of exception middleware. If you do write custom error handling, it’s a good idea to emulate Django’s built-in error handling and only report/log errors if DEBUG is False.
https://doc.bccnsoft.com/docs/django-docs-3.0-en/howto/error-reporting.html
CC-MAIN-2021-04
en
refinedweb
Database Views With Room for Android In this Android Room tutorial, you’ll learn how to use the Database Views feature of Room to create pre-packaged SELECT statements. Version - Kotlin 1.3, Android 5.0, Android Studio 4.0 Room is an abstraction layer over SQLite that Google packaged as an AndroidX library and also recommends. Since version 2.1, Room offers the ability to add Database Views, also known as stored queries. Some of the good reasons to use Database Views would be: - They make it easy for you to write complex queries and use them in Data Access Object (DAO) queries. - You can query only the fields you need, rather than having to go through all the fields in a table. In this tutorial, you’ll be building a Customer Surveys app which lets a restaurant’s customers leave feedback, then saves that feedback in Room managed database. During the process you’ll learn the following: - What is a Database View? - How to create Database Views? - How to use them to simplify writing SELECT queries This tutorial also uses Coroutines with Room. To learn more, read our Coroutines With Room Persistence Library tutorial. Getting Started Download the starter project by clicking the Download Materials button at the top or bottom of this tutorial. Extract the ZIP file and open the starter project in Android Studio 4.0 or later by selecting Open an existing Android Studio project from the welcome screen. Once the Gradle sync is complete, explore the project structure. The project follows MVVM architecture, so similar functionalities are under one package. Familiarize yourself with the packages present — you’ll use them in this tutorial. Build and run. You’ll see a simple screen with a welcome message, an image and a START SURVEY button. Tap the START SURVEY button. For the purpose of this tutorial, you can ignore the fact that you haven’t eaten a meal at the restaurant. :] The next screen is the survey screen. It has an email input field, radio buttons to choose the meal that you’re rating and three questions. Each question has Good, Average and Bad buttons below them, so the user can rate their satisfaction. You’ll also see the SUBMIT SURVEY button. Tap it and you’ll see a toast which says it’s not time to take the survey yet. Don’t worry, you’ll fix that over the course of this tutorial. You’ve now been welcomed to The View Restaurant, where you’ll get to see amazing nature views, taste their delicious meals and rate your satisfaction. While at it, you’ll also learn about Room Database Views. Using Database Views Consider a table that has extra functionality of pre-packaged SELECT queries for convenience. Room version 2.1 and higher calls these as a Database View and provides an annotation with the same name i.e @DatabaseView. Using this annotation you can mark a class to behave like a Database View. This will enable you to attach a query to the class, like below: @DatabaseView("SELECT user.id, user.name " + "AS departmentName FROM user " + "WHERE user.departmentId = department.id") class User { var id: Long = 0 var name: String? = null } You can then use this class in your DAO to query data the same way you would do with a class marked as an Entity i.e Table in a database. A DAO helps you access data from your app’s database. It typically contain the CUD (Create, Update and Delete) methods and can also contain other methods that may be necessary for read and write access to the database. The relationship between Database Views and the database is similar to the relationship between entities and the database. You’ll take a deeper look at those relationships next. Comparing a Database View and an Entity Classes annotated with @DatabaseView are similar to Entity classes. Here’s how: - Both can use SELECT FROM in DAO queries. Database Views and Entitys can both use @ColumnInfo, which allows you to customize the column information associated with a field. - They can both use @Embedded, which allows a field to have nested fields that queries can reference directly. While there are many similarities between the two, there are also differences between DatabaseViews and Entitys: - You can use INSERT, UPDATE and DELETE with an Entity, but not with a DatabaseView. - You define all your views in your apps using views, but you define entities using entities. Now that you know what a DatabaseView is and how it compares and contrasts with an Entity class, it’s time to use it and start submitting the survey for The View Restaurant. Submitting the Survey Your first step is to add the logic to submit the survey and save it to the Room database after you tap the SUBMIT SURVEY button. Navigate to customersurveys/CustomerSurveyFragment.kt, where you’ll add the logic for collecting the responses and saving them to Room. Do this by replacing the code in submitSurvey() with this: // 1 val email = editEmail.text.toString() // 2 if (validateEmail(email)) { // 3 val meal = when (radioGroupMeals.checkedRadioButtonId) { R.id.radioBreakfast -> "Breakfast" R.id.radioLunch -> "Lunch" R.id.radioDinner -> "Dinner" else -> "No Meal" } // 4 val customerSurvey = SurveyListItem .CustomerSurvey(0, email, meal, questionOneAnswer, questionTwoAnswer, questionThreeAnswer) customerSurveyViewModel.insertCustomerSurvey(customerSurvey) // 5 findNavController() .navigate(R.id.action_surveyFragment_to_surveyCompletedFragment) } Here’s what you’re doing with this code: - You get the email from editEmailand assign it to a variable: - This condition check calls validateEmail(email), which checks if the email is nullor not. It returns falseif it’s null. It also checks if the email entered is valid and returns falseif it’s not. - The code inside the ifstatement executes when validateEmail(email)returns true. mealholds the type of meal the user selected from the radio groups. - Once you have meal‘s value, you create SurveyListItem.CustomerSurvey, which has all the information about the survey. It pulls the values for questionOneAnswer, questionTwoAnswerand questionThreeAnswerfrom toggleButtonListeners(), which has listeners for that purpose. - Here, you save customerSurveyby calling insertCustomerSurvey(customerSurvey)in CustomerSurveyViewModel, which handles the logic to save to Room. - You navigate to SurveyCompletedFragment. After adding this, you’ll notice that customerSurveyViewModel and findNavController() have red underlines. To fix this, first add the CustomerSurveyViewModel initialization at the top of the class, just below the questionThreeAnswer initialization. private val customerSurveyViewModel: CustomerSurveyViewModel by viewModels() Make sure to add respective import statements when the IDE prompts you. Build and run. Start the survey, enter the required email input and select your answers to the questions. Great, you’ve completed the survey. Tap the VIEW SURVEYS button… oops, it doesn’t do anything yet. Don’t worry, you’ll fix that soon. In the next section, you’ll learn how to create your first DatabaseView. Creating a Database View To create a view, you’ll add a @DatabaseView annotation to a class or data class. Start by navigating to customersurveys/SurveyListItem.kt. This is a sealed class with a couple of data classes for you to use in this tutorial. At the bottom of SurveyListItem, just below QuestionOneSadView, add the following: data class HappyBreakFastView( override val email: String ) : SurveyListItem() This data class overrides the email variable from SurveyListItem and inherits from the class — meaning it’s a subtype of SurveyListItem. After creating this data class, add @DatabaseView with a SELECT query to fetch all email ids from CustomerSurvey table where meal is set to “Breakfast”, just above the HappyBreakFastView data class. Your annotation should be look like this: @DatabaseView("SELECT CustomerSurvey.email FROM CustomerSurvey WHERE CustomerSurvey.meal = 'Breakfast'") A few things to note about the query inside the annotation: - The query works like any other query you’ve written in Room. - You need to request all the fields that you have in your data class as you write the query. In this case, you only need the email. You use SELECT CustomerSurvey.email From...to get the email from CustomerSurvey. Congratulations, you’ve created your first view! Next, you’re going to see how you can use the view in your DAO queries. Using Room Database Views in DAO Queries First, you’ll include HappyBreakFastView in views in the app’s @Database. Navigate to database/AppDatabase.kt and, inside views, add SurveyListItem.HappyBreakFastView::class. Your updated @Database annotation should look like below: @Database(entities = [SurveyListItem.CustomerSurvey::class], version = 2, exportSchema = false, views = [ SurveyListItem.AverageLunchView::class, SurveyListItem.SadDinnerView::class, SurveyListItem.QuestionOneSadView::class, // Added SurveyListItem.HappyBreakFastView::class ]) Notice that the version = 2. You need to update the database version every time you add a view in the AppDatabase — otherwise, your app will crash. In this case, you have updated the version to 2. Sync gradle to apply all these changes. Next, navigate to customers/CustomerSurveysDao.kt and, just below getQuestionOneSadView(), add the following code: @Query("SELECT * FROM HappyBreakFastView") fun getHappyBreakFastCustomers():LiveData<List<SurveyListItem.HappyBreakFastView>> This method gets all customers that were happy with any aspect of the survey from the restaurant. To explain it in more detail: - First, you use HappyBreakFastViewas you would in a normal query. - You call this method in CustomerSurveyRepoto get a list of all customers that responded to any of the questions with Good. Note that the return type of the method is a list LiveDataof type SurveyListItem.HappyBreakFastView, which is an observable variable holder. Now, you’ve created a view and the method to query the list of customers who responded with a positive answer in CustomerSurveysDao. In the next section, you’ll learn how to call this method from the repository class. Fetching Data Using a DatabaseView Navigate to customersurveys/CustomerSurveyRepo.kt and add the following method just below getQuestionOneSadView(): fun getHappyBreakFastCustomers() : LiveData<List<SurveyListItem.HappyBreakFastView>> { return customerSurveysDao.getHappyBreakFastCustomers() } This method calls getHappyBreakFastCustomers() from CustomerSurveysDao to get the data from Room. Its return type is a LiveData, which allows the caller of this method to observe any changes in the data. Next, you’ll add a call to getHappyBreakFastCustomers() in CustomerSurveyViewModel. It’s responsible for displaying the data to the view — which, in this case, is not DatabaseView but AllSurveysFragment. Navigate to customersurveys/CustomerSurveyViewModel.kt and add the following code: val happyBreakfastCustomers : LiveData<List<SurveyListItem.HappyBreakFastView>> by lazy { customerSurveyRepo.getHappyBreakFastCustomers() } This variable gets its value by calling getHappyBreakFastCustomers() from CustomerSurveyRepo. There’s a by lazy{} so that you don’t load the data immediately, but rather when the variable is first accessed. Next, you’ll update the UI so it can display the data. Displaying the Data to the UI Navigate to allsurveys/AllSurveysFragment.kt and add the following code at the bottom of the class: private fun getHappyBreakfastCustomers() { customerSurveyViewModel.happyBreakfastCustomers.observe(viewLifecycleOwner, Observer { customerSurveyList -> if (customerSurveyList.isEmpty()) { layoutEmptyView.visibility = View.VISIBLE rvReviews.visibility = View.GONE } else { layoutEmptyView.visibility = View.GONE rvReviews.visibility = View.VISIBLE initView(customerSurveyList) } }) } private fun initView(customerSurveySurveyList: List<SurveyListItem.HappyBreakFastView>) { val customerSurveysAdapter = CustomerSurveysAdapter(customerSurveySurveyList) rvReviews.adapter = customerSurveysAdapter } To explain what the code does: - First, it calls happyBreakfastCustomersand observes its value. - Inside the observe lambda, there’s a check to see if customerSurveyList is nullor not. If the list is null, you set TextView‘s No surveys found! message to visible and hide RecyclerView. If it’s not null, you set the visibility of TextViewto GONE and show RecyclerView. You also call initView(customerSurveyList)with the customerSurveyListvalue from CustomerSurveyViewModel. initView(customerSurveySurveyList: Listinitializes ) CustomerSurveysAdapterwith customerSurveyListand sets the adapter for RecyclerViewto CustomerSurveysAdapter, which now displays the list of surveys to the UI. The IDE will prompt you to add the SurveyListItem import. If it doesn’t, add this import: import com.raywenderlich.android.customersurveys.customersurveys.SurveyListItem Now that you’ve displayed the data to the UI, you have only a few more steps before everything works perfectly. Next, you’ll add the code that handles fetching data from Room depending on the option selected on the dropdown in the user interface i.e Spinner widget. Fetching Data for the Different Views Add the following piece of code just below onCreate in AllSurveysFragment.kt:: private fun spinnerListener() { filterSpinner.onItemSelectedListener = object : AdapterView.OnItemSelectedListener { override fun onNothingSelected(parent: AdapterView<*>?) {} override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) { when (position) { 0 -> resetState() 1 -> getAllCustomerSurveys() 2 -> getHappyBreakfastCustomers() 3 -> getSadDinnerCustomers() 4 -> getAverageLunchCustomers() 5 -> getQuestionOneSadCustomers() } } } } The piece of code above sets onItemSelectedListener to filterSpinner and overrides two methods: onNothingSelected and onItemSelected. You don’t want to do anything when nothing is selected, so onNothingSelected is left empty. You do want to react to when an Item is selected, so you need to implement onItemSelected. onItemSelected has a when expression that calls different methods depending on the option selected in filterSpinner. These methods are similar to getHappyBreakfastCustomers(), but they fetch data using a different DatabaseView. Make sure you add the imports when the IDE prompts you. Finally, add a call to spinnerListener() inside onViewCreated, right after setupSpinner(), as shown below: override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) setupSpinner() // Added spinnerListener() } Now that you have everything ready to fetch the surveys, your next step is to add the code to navigate to AllSurveysFragment. Navigating to All Surveys This is the last step you need to see the views in action. Navigate to completedsurvey/SurveyCompletedFragment.kt and uncomment the code inside btnViewSurveys. Your final result will look like this: override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) btnViewSurveys.setOnClickListener { findNavController() .navigate(R.id.action_surveyCompletedFragment_to_allSurveysFragment) } } Here, you’re simply setting the click listener for the VIEW SURVEYS button and navigating to AllSurveysFragment. Once you uncomment the code, the IDE will prompt you to import findNavController(). Simply import the required. Build, run and start a survey, then answer the questions and submit them. Finally, view All Surveys, where you’ll be able to fetch all the data depending on the option you selected on the spinner. Congratulations! You’ve finished your experience at The View Restaurant. Hopefully you have had a great meal, seen amazing views and had a chance to learn what DatabaseViews are. Where to Go From Here? Download the final project by using the Download Materials button at the top or bottom of the tutorial. For more information about Room’s features, check out the official documentation from Android. We hope you enjoyed this Room Database Views tutorial. If you have any questions, comments or awesome modifications to this project app, please join the forum discussion below.
https://www.raywenderlich.com/10194335-database-views-with-room-for-android
CC-MAIN-2021-04
en
refinedweb
Creating a WP7 Custom Control in 7 Stepspublished on: 03/01/2020 | Tags: CustomControls windows-phone by WindowsPhoneGeek In this article I am going to demonstrate how to create a simple Custom Control using Silverlight for Windows Phone 7. Generally custom controls can be loosely defined as creating a control that is based on (i.e. derived from) an existing control and extends its functionality in some way. Custom Controls are skinable, themable and reusable controls that once created can be used by simply loading the assembly in any project. All controls that are used in Silverlight for Windows Phone 7 (eg., Button, TextBlock, ListBox) and UserControl are also Custom Controls. Usually Custom Controls inherit from Control, ItemsControl, ContentControl, etc. NOTE:For more information about the Silverlight UI model and the difference between Custom Control and User Control take a loot the the previous post: User Control vs Custom Control in Silverlight for WP7. In this article we are going to create a very simple custom control: "MyCustomControl" which derives from ContentControl and exposes IconSource property without adding any VisualStates. We will focus on the minimum requirements that you have to cover in order to create a Custom Control. To begin with creating a custom control you will need to follow the steps: - First create a sample Class Library project in VisualStudio: This will generate a class named "Class1.cs". This is the class which we will use in order to implement our custom control. So lets change its name to "MyCustomControl.cs". 2.We will create a simple custom control that derives from ContentControl and has a custom IconSource dependency property. IconSource property will be used in order to enable users to add different images to MyCustomControl. So add the following code into MyCustomControl.cs: public class MyCustomControl : ContentControl { public static readonly DependencyProperty IconSourceProperty = DependencyProperty.Register("IconSource", typeof(ImageSource), typeof(MyCustomControl), null); public MyCustomControl() { DefaultStyleKey = typeof(MyCustomControl); } public ImageSource IconSource { get { return base.GetValue(IconSourceProperty) as ImageSource; } set { base.SetValue(IconSourceProperty, value); } } } NOTE:More information about the DependencyProperty class you can find at the MSDN Documentation. NOTE: DefaultStyleKey gets or sets the key that references the default style for the control. NOTE: In more complex scenarios when you need to get a reference to some part of the ControlTemplate it is necessary to override OnApplyTemplate. The method is called just before a UI element displays in an application. example: public override void OnApplyTemplate() { base.OnApplyTemplate(); ContentPresenter presenter = this.GetTemplateChild("ContentContainer") as ContentPresenter; } where "ContentContainer" is a part from our ControlTemplate: <ContentPresenter x: - The next step is to create a folder named "Themes". NOTE: The name of this folder is important! - After that add a XAML file named generic.xaml into the folder Currently in Silverlight for Windows Phone 7 there is no suitable VisualStudio Template for adding a XAML file or ResourceDictionary as a file in your project. Sp in order to add generic.xaml file you can create a new Class by choosing Add->NewItems->Class and rename it to generic.xaml. NOTE: The name is important! NOTE:It is very important that you remember to set the generic.xaml build action to Resource. This is necessary in order to make sure that the template is packed in the same assembly as the control otherwise the template wont be available. - Add the following XAML tags in the the generic.xaml file. By default it's not possible to create a new ResourceDictionary file using the default VisualStudio Templates. However you can create it on your own. Just replace the content of the newly created class in step 3 with the following code: <ResourceDictionary xmlns="" xmlns: <Style> </Style> </ResourceDictionary> - The next step is to define the default Style and the ControlTemplate of our control i.e. how the control will looks like. At first we will include the custom control namespace. After that we will add a sample Style. Note that ControlTemplate is the most important part of the style because it specifies the visual structure and the visual behavior of a control. Generally ControlTemplate is usually a composition of multiple elements. You can define it in XAML even without writing any C# code . NOTE: Take a look at the following articles for reference: In our case the code should looks like: <ResourceDictionary xmlns="" xmlns: <Style TargetType="local:MyCustomControl"> <Setter Property="Background" Value="YellowGreen"/> <Setter Property="IconSource" Value="/CustomControlSample;component/Themes/icon.png"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="local:MyCustomControl"> <Border BorderBrush="White" BorderThickness="2"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="100"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Image Grid. <Border Background="{TemplateBinding Background}" Grid. <ContentPresenter x: </Border> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> Basically we added an Image, a ContentPresenter and TemplateBinding for some of the important properties. When a control derives from ContentControl it means it has a Content property that developers can use to customize its content. ContentPresenter can render any XAML assigned to the control's Content property. NOTE: TemplateBinding links the value of a property in a control template to be the value of a property on the templated control! NOTE: We define the default value of a custom control using the Style Setters! NOTE: There is no x:Key attribute because the default style of a custom control is determined by the TargetType. NOTE: We added a icon.png image to our project and place it into the Themes folder. - That is all you have to do in order to have working "MyCustomControl". NOTE: These are the minimum requirements that you have to cover in order to create a Custom Control. Now lets create a new Windows Phone 7 application project which will be used as a Test project for our new control. Add reference to "CustomControlSample" assembly as shown in the next screen shot: After that just define the control namespace and add the following code: <phone:PhoneApplicationPage ... xmlns: <StackPanel x: <myControl:MyCustomControl <TextBlock Text="Second Example" Margin="20"/> <myControl:MyCustomControl <myControl:MyCustomControl.Content> <StackPanel> <TextBlock Text="Some Text Content Here"/> <Button Content="Test Button"/> </StackPanel> </myControl:MyCustomControl.Content> </myControl:MyCustomControl> </StackPanel> Here are some screen shot that demonstrate "MyCustomControl" in action: That was all about how to create a simple CustomControl in Silverlight for Windows Phone 7. In the next articles of this series I will give a more complex examples. I hope that the article was helpful. You can find the full source code here: You can also follow us on Twitter: @winphonegeek for Windows Phone; @winrtgeek for Windows 8 / WinRT ContentPresenter or ContentControl? posted by: Juel on 01/07/2011 19:03:10 Thanks for clarifying how to implement Custom Control in WP7. Now the fog begins to clear for me. I just have one more question. Why are you using ContentPresenter? What is the difference between ContentPresenter and ContentControl? RE:ContentPresenter or ContentControl? posted by: w on 01/07/2011 20:03:59 ContentControl derives from Control while ContentPresenter derives from FrameworkElement. ContentControl is a control that knows how to display content. ContentPresenter is an element that is useful inside the template of ContentControl, and is used to specify where you want its content to be placed. Here are some links to the official MSDN documentation: So it depends on your case weather to use ContentPresenter or ContentControl. 10x posted by: Juel on 01/08/2011 18:54:04 10x for the detailed explanation! thanks posted by: Bindu on 03/02/2011 12:52:02 hi, thanks a lot for publishing such a simple and useful article. this helped me in understanding the concept easily. as a beginner i appreciate ur work. regards, bindu Nice work posted by: kishor on 05/27/2011 12:10:36 Good work. Very useful. Want to extend password box functionality posted by: ramki on 06/22/2011 12:22:06 If passwordchar is x, then user entered password will be changed to xxxxxx, is there a way to show this password as it is instead of passwordchars, when user selects some checkbox "showpassword" ? or based on some event? Is this possible with custom controls? OnApplyTemplate() doesn't work in designer posted by: Zenob on 05/16/2012 17:08:41 I want to prepare some logic in OnApplyTemplate() of ContentControl, and preview result in VS Desinger - but unfortunately it doesn't work. I even tried to throw test exception at the beginning of OnApplyTemplate() but Desinger doesn't show any errors. Nice Artical posted by: [email protected] on 05/17/2013 07:44:44 Thanks,very nice explanation,and waiting for tutorial about creating complex custom
http://www.geekchamp.com/articles/Creating-a-WP7-Custom-Control-in-7-Steps
CC-MAIN-2021-04
en
refinedweb
In this article, we will create a python function that will produce an array with the numbers 0 to N-1 in it. For example, the following code will result in an array containing the numbers 0 to 4: arr(5) // => [0,1,2,3,4] There are a few rules we need to follow here:- - when the user passes in 0 to the above function, the function will return an empty list. - when the user passes in an empty argument into the above function, the function will also return an empty list. - any other positive number will result in an ascending order array. Below is the full solution to the above problem. def arr(n=None): li = [] if n == 0 or n == None: return li else: for i in range(n): li.append(i) return li Write down your own solution in the comment box below this post 🙂 Please follow and like us:
https://kibiwebgeek.com/write-a-python-function-that-produces-an-array-with-the-numbers-0-to-n-1-in-it/
CC-MAIN-2021-04
en
refinedweb
Five Ways to Lazy Load Images for Better Website Performance Jump Start Web Performance 👋 40% of people abandon a website that takes more than 3sec to load With images being among the most popular type of content on the web,. In this article, you’ll learn about five approaches to lazy loading images that you can add to your web optimization toolkit to improve the user experience on your website. What Is Lazy Loading? Lazy loading images. Native Lazy Loading. lazy: works great for lazy loading eager: instructs the browser to load the specified content right away auto: leaves the option to lazy load or not to lazy load up to the browser. This method has no rivals: it has zero overhead, it’s clean and simple. However, although at the time of writing most major browsers have good support for the For an in-depth article on this awesome feature for lazy-loading images, including browser support workarounds, don’t miss Addy Osmani’s “Native image lazy-loading for the web!”. #2 Lazy Loading Using the Intersection Observer API The Intersection Observer API is a modern interface that you can leverage for lazy loading images and other content. Here’s how MDN introduces this API: The Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document’s viewport. In other words, what’s being asynchronously watched is the intersection of one element with another. Denys Mishunov has a great tutorial both on the Intersection Observer and on lazy loading images using it. Here’s what his solution looks like. Let’s say you’d like to lazy load an image gallery. The markup for each image would look like this: <img data- Notice how the path to the image is contained inside a data-src attribute, not a src attribute. The reason is that using src means the image would load right away, which is not what you want. In the CSS, you give each image a min-height value, let’s say 100px. This gives each image placeholder (the img element without the src attribute) a vertical dimension: img { min-height: 100px; /* more styles here */ } In the JavaScript document, you then create a config object and register it with an intersectionObserver instance: // create config object: rootMargin and threshold // are two properties exposed by the interface const config = { rootMargin: '0px 0px 50px 0px', threshold: 0 }; // register the config object with an instance // of intersectionObserver let observer = new intersectionObserver(function(entries, self) { // iterate over each entry entries.forEach(entry => { // process just the images that are intersecting. // isIntersecting is a property exposed by the interface if(entry.isIntersecting) { // custom function that copies the path to the img // from data-src to src preloadImage(entry.target); // the image is now in place, stop watching self.unobserve(entry.target); } }); }, config); Finally, you iterate over all of your images and add them to this iterationObserver instance: const imgs = document.querySelectorAll('[data-src]'); imgs.forEach(img => { observer.observe(img); }); The merits of this solution: it’s a breeze to implement, it’s effective, and has the intersectionObserver do the heavy-lifting in terms of calculations. On the flip side, although the Intersection Observer API is supported by most browsers in their latest versions, it’s not consistently supported by all of them. Fortunately, a polyfill is available. You can learn more on the Intersection Observer API and the details of this implementation in Denys’s article. #3 Lozad.js A quick and easy alternative for implementing lazy loading of images is to let a JS library do most of the job for you. Lozad is a highly performant, light and configurable lazy loader in pure JavaScript with no dependencies. You can use it to lazy load images, videos, iframes and more, and it uses the Intersection Observer API. You can include Lozad with npm/Yarn and import it using your module bundler of choice: npm install --save lozad yarn add lozad import lozad from 'lozad'; Alternatively, you can simply download the library using a CDN and add it to the bottom of the HTML page in a < script> tag: <script src=""></script> Next, for a basic implementation, add the class lozad to the asset in your markup: <img class="lozad" data- Finally, instantiate Lozad in your JS document: const observer = lozad(); observer.observe(); You’ll find all the details of how you can use the library on the Lozad GitHub repository. If you don’t want to dive into the workings of the Intersection Observer API or you’re simply looking for a fast implementation that applies to a variety of content types, Lozad is a great choice. Only, be mindful of browser support and eventually integrate this library with a polyfill for the Intersection Observer API. #4 Lazy Loading with Blurred Image Effect If you’re a Medium reader, you have certainly noticed how the site loads the main image inside a post. The first thing you see is a blurred, low-resolution copy of the image, while its high-res version is being lazy loaded:. #5 Yall.js Yall is a feature-packed, lazy-loading script for images, videos, and iframes. More specifically, it uses the Intersection Observer API and smartly falls back on traditional event handler techniques where necessary. When including Yall in your document, you need to initialize it as follows: <script src="yall.min.js"></script> <script> document.addEventListener("DOMContentLoaded", yall); </script> Next, to lazy load a simple img element, all you need to do in your markup is: <img class="lazy" src="placeholder.jpg" data- Note the following: - you add the class lazy to the element - the value of srcis a placeholder image - the path to the image you want to lazy load is inside the data-srcattribute Among the benefits of Yall are: - great performance with the Intersection Observer API - fantastic browser support (it goes back to IE11) - no other dependencies necessary To learn more about what Yall can offer and for more complex implementations, feel free to check out the project’s page on GitHub. Conclusion And there you have it — five ways of lazy loading images you can start to experiment with and test out in your projects. Get practical advice to start your career in programming! Master complex transitions, transformations and animations in CSS!
https://www.sitepoint.com/five-techniques-lazy-load-images-website-performance/
CC-MAIN-2021-04
en
refinedweb
morphinit, re_morphinit, morphstr, morphword − WordNet morphological processor functions #include "wn.h" int morphinit(void); int re_morphinit(void); char *morphstr(char *origstr, int pos); char *morphword(char *word, int pos); The WordNet morphological processor, Morphy, is accessed through these functions: morphinit() is used to open the exception list files. It returns 0 if successful, -1 otherwise. The exception list files must be opened before morphstr() or morphword( are called. re_morphinit() is used to close the exception list files and reopen them, and is used exclusively for WordNet development. Return codes are as described above. morphstr() is the basic user interface to Morphy. It tries to find the base form (lemma) of the word or collocation origstr in the specified pos. The first call (with origstr specified) returns a pointer to the first base form found. Subsequent calls requesting base forms of the same string must be made with the first argument of NULL. When no more base forms for origstr can be found, NULL is returned. Note that morphstr() returns a pointer to a static character buffer. A subsequent call to morphstr() with a new string (instead of NULL) will overwrite the string pointed to by a previous call. Users should copy the returned string into a local buffer, or use the C library function strdup to duplicate the returned string into a malloc’d buffer. morphword() tries to find the base form of word in the specified pos. This function is called by morphstr() for each individual word in a collocation. Note that morphword() returns a pointer to a static character buffer. A subsequent call to morphword() will overwrite the string pointed to by a previous call. Users should copy the returned string into a local buffer, or use the C library function strdup to duplicate the returned string into a malloc’d buffer. morphinit() is called by wninit() and is not intended to be called directly by an application. Applications wishing to use WordNet and/or the morphological functions must call wninit() at the start of the program. See wnutil(3WN) for more information. origstr may be either a word or a collocation formed by joining individual words with underscore characters (_). Usually only morphstr() is called from applications, as it works on both words and collocations. pos must be one of the following: If ADJECTIVE_SATELLITE is passed, it is treated by morphstr() as ADJECTIVE. wnintro(3WN), wnsearch(3WN), wndb(5WN), morphy(7WN). Passing an invalid part of speech will result in a core dump. The WordNet database files must be open to use morphstr() or morphword(). Morphy will allow non-words to be converted to words, if they follow one of the rules described above. For example, it will happily convert plantes to plants.
http://man.m.sourcentral.org/ubuntu1710/3+morph
CC-MAIN-2021-04
en
refinedweb
Eclipse4/RCP/Contexts The Eclipse 4 Application Platform manages state and services using a set of contexts; this information is used for injection. Contexts are used as the sources for Dependency Injection. In this respect, they are somewhat analogous to modules in Guice. Normally code should not have to use or know about the context. Contents - 1 What is a Context? - 2 The Use of Contexts in Eclipse 4 - 3 Context Variables - 4 Context Chains and the Active Context - 5 Context Functions - 6 Run And Tracks - 7 Exposing Services and State on an Eclipse Context - 8 Creating New Contexts - 9 Advanced Topics - 10 TODO What is a Context? A context (a IEclipseContext) is a hierarchical key-value map. The keys are strings, often Java class names, and the values are any Java object. Each context has a parent, such that contexts are linked together to form a tree structure. When a key is not found in a context, the lookup is retried on the parent, repeating until either a value is found or the root of the tree has been reached. The Use of Contexts in Eclipse 4 Values are normally added to an Eclipse Context via IEclipseContext#set(key,value) or #modify(key,value). Values are retrieved by #get(key), which returns null if not found. There is a special variant of get: Java class names are frequently used as keys and instances as values, so there is a special T get(Class<T>) that casts the value as an instance of T. The power of contexts comes as Eclipse 4 associates a context with most model elements — the logical UI containers — such that the context tree matches the UI hierarchy. So an MPart and its containing MPerspective, MWindow, and the MApplication, each have contexts and are chained together. Looking up a key that is not found in the part will cause the lookup to continue at the perspective, window, and application.. actually sets it. Context Chains and the Active Context A node can be made active in two ways. Calling #activate() makes the receiver the active child of its parent node, but does not otherwise disturb the rest of the tree. Calling #activateBranch() on the other hand effectively the same as: void activateBranch() { activate(); if(getParent() != null) getParent().activateBranch(); } It makes the receiver the active child of its parent, and then recursively calls #activateBranch() on its parent. It's often useful to resolve values from the active leaf with #getActive(key). Eclipse 4 keeps its IEclipseContext activation state in sync with the UI state, such that the active window's context is the active window-level context, and each window's active part is that window's active leaf o. Context Functions Contexts support a special type of value called a context function. When a retrieved key's value is a context function, the IEclipseContext calls compute(context, key) and returns the result of the computation. Context sanctions must subclass org.eclipse.e4.core.contexts.ContextFunction. For example, the Eclipse 4 Workbench makes the current selection available via a context function: appContext.set(SELECTION, new ContextFunction() { @Override public Object compute(IEclipseContext context, String contextKey) { IEclipseContext parent = context.getParent(); while (parent != null) { context = parent; parent = context.getParent(); } return context.getActiveLeaf().get("out.selection"); } }); The result of a context function are memoized: they are only recomputed when another referenced value is changed. See the section on Run And Tracks below. Run And Tracks RunAndTracks, affectionally called RATs, are a special form of a Runnable. RATs are executed within a context, and the context tracks all of the values accessed. When any of these values are changed, the runnable is automatically re-evaluated. The following example will print 20.9895 and then 20.12993: final IEclipseContext context = EclipseContextFactory.create(); context.set("price", 19.99); context.set("tax", 0.05); context.runAndTrack(new RunAndTrack() { @Override public boolean changed(IEclipseContext context) { total = (Double) context.get("price") * (1.0 + (Double) context.get("tax")); return true; } @Override public String toString() { return "calculator"; } }); print(total); context.set("tax", 0.07); print(total); A RAT continues executing until either its context is disposed, or its changed() method returns false. Note that RATs are only re-evaluated when the value is changed (i.e., IEclipseContext#set() or #modify() are called), and not when the contents of the value are changed. Exposing Services and State on an Eclipse Context Values are normally addd to an Eclipse Context via IEclipseContext#set(key,value) or #modify(key,value). But these require knowing and being able to find the context to be modified. But developers sometimes need to be able to add values on-the-fly. There are a few techniques. Context Functions A Context Function is provided both the key that was requested and the source context, where the retrieval began. The context function can return an instance created for that particular context, or set a value in that context — or elsewhere. This approach is very useful for computing results based on the active part (IEclipseContext#getActiveLeaf()). OSGi Services The Eclipse 4 workbench roots its context hierarchy from an EclipseContextOSGi, a special Eclipse Context that knows to look up keys in the OSGi Service Registry. EclipseContextOSGi instances are obtained via EclipseContextFactory#getServiceContext(BundleContext). These contexts — and the services requested — are bounded by the lifecycle of the provided bundle. Context Functions Exposed As OSGi Declarative Services This approach exposes a context function as the implementation of a service defined OSGi Declarative Services. This pattern is used for creating the IEventBroker, using the new DS annotations support. @Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.core.services.events.IEventBroker") public class EventBrokerFactory extends ContextFunction { @Override public Object compute(IEclipseContext context, String contextKey) { EventBroker broker = context.getLocal(EventBroker.class); if (broker == null) { broker = ContextInjectionFactory.make(EventBroker.class, context); context.set(EventBroker.class, broker); } return broker; } } Note that the service is actually exposed as an IContextFunction, not an IEventBroker. This approach is specific to being used for values retrieved from an IEclipseContext. Creating New Contexts Contexts can be created either as a leaf of another context (see IEclipseContext#newChild()) or as a new root (see EclipseContextFactory#create()). A special EclipseContext implementation exists (EclipseContextOSGi, obtained by EclipseContextFactory#getServiceContext()) to expose OSGi Services too. Advanced Topics TODO Proposed Topics: - how do I access the current context? - @Active vs ACTIVE_PART vs getActiveLeaf().getActive(MPart.class) The old E4 wiki pages provides background [E4/Contexts|on the influences on IEclipseContext].
http://wiki.eclipse.org/index.php?title=Eclipse4/RCP/Contexts&oldid=408274&printable=yes
CC-MAIN-2021-04
en
refinedweb
HOWTO-Engines, see here: Engine.php. You also must hook yourself into the regular ScummVM main build system. Actually, some ports use . Example: engines/quux/quux.h #ifndef QUUX_H #define QUUX_H #include "base/engine.h" namespace Quux { // our engine debug levels enum { kQuuxDebugExample = 1, kQuuxDebugExample2 = 2 // next must be 4, because the debug levels must be able to be combined with OR // and again be extracted with AND and for example 3 could be then kQuuxDebugExample or // kQuuxDebugExample2, that should be only used then a call should be printed when one of both // is specified }; class QuuxEngine : public Engine { public: QuuxEngine(OSystem *syst); ~QuuxEngine(); virtual int init(GameDetector &detector); virtual int go(); }; } // End of namespace Quux #endif Example: engines/quux/quux.cpp #include "common/stdafx.h" (); // Additional setup. printf("QuuxEngine::init\n"); return 0; } int QuuxEngine::go() { // Your main even loop should be (invoked from) here. printf(
https://wiki.scummvm.org/index.php?title=HOWTO-Engines&direction=prev&oldid=2618
CC-MAIN-2021-04
en
refinedweb
Mailing List - Entries of 2017 2019 up to now | 2018 | 2017 | 2016 | 2015 | 2014 | 2013 Hello everyone, I want to select a table cell at row 11, column 2 and populate that cell with a value ‘1’ Now I’ve created a Jython SUT script as shown below: And I am calling the procedure ‘selectCell’ from qft.qft, but when I ran the following Jython SUT script (P.S. I’ve tried the different rc.callProcedure as you seen in the commented lines, they all failed with different errors): from java.math import BigDecimal #rc.callProcedure("table.selectCell", {"id": "dialogCash_Dissection.tableTOTAL:"}, {"column": "2"}, {"row": "11"}, {"columnSeparator": "&"}, {"rowSeparator": "&"}) #rc.callProcedure("table.selectCell", {"id": "dialogCash_Dissection.tableTOTAL:"}, {"column": "2"}, {"row": "11"}) #rc.callProcedure("table.selectCell", {"id": "dialogCash_Dissection.tableTOTAL:", "column": "2", "row": "11"}) #rc.callProcedure("table.selectCell", "dialogCash_Dissection.tableTOTAL:&2&11") #rc.callProcedure("table.selectCell", {"id": "dialogCash_Dissection.tableTOTAL:"}, {"dialogCash_Dissection.tableTOTAL:&2&11"}) #rc.callProcedure("table.selectCell", {"dialogCash_Dissection.tableTOTAL:"}, {"dialogCash_Dissection.tableTOTAL:&2&11"}) rc.callProcedure("qfs.swing.table.selectCell", {"id": "dialogCash_Dissection.tableTOTAL:"}, {"column": 2}, {"row": 11}) bd1 = BigDecimal($(amount)) bd2 = BigDecimal("0.05") numericDen05 = bd1.divide(bd2, 2, BigDecimal.ROUND_HALF_UP) table = rc.getComponent("dialogCash_Dissection.tableTOTAL:") rows = table.getRowCount() print rows I got a script error and followed by a deadlock issue Any ideas on how to select a table cell based on the column and row number without deadlock issues? And with the table cell population, is there any existing qft api reference I can just call? Or do I create a text input node after the Jython SUT script? Thanks in advance Kevin.
https://www.qfs.de/en/qf-test-mailing-list-archive-2017/lc/2017-msg00036.html
CC-MAIN-2021-04
en
refinedweb
There. I assume that you have already a good idea what Prometheus, Grafana and OpenShift are and that you have access to an OpenShift cluster which allows you to download docker images from the internet. The example has been tested with OpenShift 3.7 and might not work with older OpenShift versions. The first step will be to deploy a simple demo application. It is a SpringBoot application that provides two RESTful services (“/hello-world” and “/metrics”) and already facilitates to be monitored with Prometheus. The demo application provides metrics for the request count of the “hello-world” service as well as Java hotspot metrics. More information how to provide metrics in Java application can be found here. My colleague Dr. Fabian Stäber gave a very good talk, how to provide metrics for a Java application without modifying the source code. An article of the talk can be found here. The following code snip it shows how the Prometheus metrics are implemented in the Restful services: @Component @Path("/") public class Metrics { private final Logger logger = LogManager.getLogger(Metrics.class); private final Counter promRequestsTotal = Counter.build() .name("requests_total") .help("Total number of requests.") .register(); { DefaultExports.initialize(); } @GET() @Path("/hello-world") @Produces(MediaType.TEXT_PLAIN) public String sayHello() { promRequestsTotal.inc(); return "hello, world"; } @GET() @Path("/metrics") @Produces(MediaType.TEXT_PLAIN) public StreamingOutput metrics() { logger.info("Starting service for metrics"); return output -> { try (Writer writer = new OutputStreamWriter(output)) { TextFormat.write004(writer, CollectorRegistry.defaultRegistry.metricFamilySamples()); } }; } } The highlighted section of the source code marks initialization of the request counter; the java hotspot metrics. The Restful service “/metrics” returns the metrics of the demo application. To deploy the demo application we first create a project in OpenShift called “demoapplication” and deploy the demo application in this project. We will do this in the OpenShift command line. To create project demoapplication execute: oc new-project demoapplication The deployment of the demo application is done with this command: oc new-app -f -n demoapplication If the demo application has been successfully deployed you should be able to open the demo application in a web browser (Hint: you can find the url in the route of the demo application ). You will see two links: If you can see these links and they show similar results if you click on the links then you have successfully deployed the application. The source code of the used demo application can be found here We are going to deploy Prometheus with sidecar containers for OAuth (for the browser and “serviceaccounts”) and for alerts. The drawback with usage of OAuth at the time being is that service accounts (i.e. from Grafana) can’t be authenticated with a token unless the OAuth sidecar service account has the cluster role “system:auth-delegator” assigned to it. Unfortunately, the cluster role “system:auth-delegator” is by default not assigned to the roles like admin or view. Which means that you need to ask the OpenShift Cluster administrators whether they will assign the cluster role to the service account of Prometheus OAuth sidecar. If you are not able to get this role binding then we need to use a workaround. The workaround will bypass the OAuth sidecar for service accounts and will talk directly with Prometheus via the service endpoint. Hence Grafana can query data from Prometheus without authentication. Any other user, group or service account that knows the service endpoint can bypass the authentication as well. For most parts that shouldn’t be a problem, because the Grafana service account should only get read access to the project with Prometheus. Otherwise the deployment of Prometheus is straightforward. First we create a project called “prometheus” with the following command: oc new-project prometheus In the next step you either deploy Prometheus with the role “system:auth-delegator” for the service account with the following command: oc new-app -f -p NAMESPACE=prometheus or without the role by the command: oc new-app -f -p NAMESPACE=prometheus After this you should be able to login to Prometheus with your OpenShift account and see the following screen if you click on “Status->Targets”. So far we only see that Prometheus is scraping pods and services in the project “prometheus”. No worries, we are going to change that in step 4. The next step is to install Grafana. For this we first create a new project “grafana” with the command: oc new-project grafana Now we are going to deploy Grafana with the command: oc new-app -f -p NAMESPACE=grafana Next we need to grant the Grafana service account view access to the project “prometheus” with the following command, so that Grafana can display data from Prometheus: oc policy add-role-to-user view system:serviceaccount:grafana:grafana-ocp -n prometheus After this step you need to open Grafana in a browser. Here we need to create a data source for Prometheus. In order to do that, click on “Add data source”. You should see the following screen: If you installed Prometheus without the role “system:auth-delegator” you need to provide a name for the datasource. We are going to use the name “Promtheus-OCP”. Set the URL to the endpoint IP address of the Prometheus service. This endpoint IP address can be determined with the following command: oc describe service prometheus -n prometheus You need to take the highlighted IP-Address: If you press Add (later called Save & Test) the result should look like this: ### Setup Prometheus datasource with the role “system:auth-delegator” If you installed Prometheus with the role “system:auth-delegator” you need to provide a name for the datasource. Set the URL to the URL of the prometheus website. You can look it up the with command: oc get route prometheus -n prometheus Further more you need to check the check box “Skip TLS Verification (Insecure)” and get the token for the service account grafana-ocp with this command: oc sa get-token grafana-ocp If you press save the result should look like this: At the time being the deployed Prometheus will only search for in the project “prometheus”. We are going to change that so that the service and the pods of the demo application will be scrapped as well. For this we need to adapt the configuration of Prometheus that is stored in the config map prometheus in the file “prometheus.yaml” in the project “prometheus”. Edit the config map either in the browser or with the command line interface. Add the highlighted lines to the config map: # A scrape configuration for running Prometheus on a Kubernetes cluster. # This uses separate scrape configs for cluster components (i.e. API server, node) # and services to allow each to use different authentication configs. # # Kubernetes labels will be added as Prometheus labels on metrics via the # `labelmap` relabeling action. # Scrape config for API servers. # # Kubernetes exposes API servers as endpoints to the default/kubernetes # service so this uses `endpoints` role and uses relabelling to only keep # the endpoints associated with the default/kubernetes service using the # default named port `https`. This works for single API server deployments as # well as HA API server deployments. scrape_configs: - job_name: 'kubernetes-pods' kubernetes_sd_configs: - role: pod namespaces: names: - prometheus - demoapplication__ - action: labelmap regex: __meta_kubernetes_pod_label_(.+) - source_labels: [__meta_kubernetes_namespace] action: replace target_label: kubernetes_namespace - source_labels: [__meta_kubernetes_pod_name] action: replace target_label: kubernetes_pod_name # Scrape config for service endpoints. # # The relabeling allows the actual service scrape endpoint to be configured # via the following annotations: # # * `prometheus.io/scrape`: Only scrape services that have a value of `true` # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need # to set this to `https` & most likely set the `tls_config` of the scrape config. # * `prometheus.io/path`: If the metrics path is not `/metrics` override this. # * `prometheus.io/port`: If the metrics are exposed on a different port to the # service then set this appropriately. - job_name: 'kubernetes-service-endpoints' tls_config: ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt insecure_skip_verify: true kubernetes_sd_configs: - role: endpoints namespaces: names: - prometheus - demoapplication relabel_configs: - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] action: keep regex: true - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme] action: replace target_label: __scheme__ regex: (https?) - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path] action: replace target_label: __metrics_path__ regex: (.+) - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port] action: replace target_label: __address__ regex: (.+)(?::\d+);(\d+) replacement: $1:$2 - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_username] action: replace target_label: __basic_auth_username__ regex: (.+) - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_password] action: replace target_label: __basic_auth_password__ regex: (.+) - action: labelmap regex: __meta_kubernetes_service_label_(.+) - source_labels: [__meta_kubernetes_namespace] action: replace target_label: kubernetes_namespace - source_labels: [__meta_kubernetes_service_name] action: replace target_label: kubernetes_name A detailed description how applications in OpenShift/Kubernets can be discovered and then scrapped in Prometheus can be found here: Kubernetes scrap configuration The description of the “relabel_configs” can be found here: relabel_configs Now that we have added the project “demoapplication” in two places in the config map, we need to grant the prometheus service account access to the project “demoapplication”. We do this with the command: oc policy add-role-to-user view system:serviceaccount:prometheus:prometheus -n demoapplication So we updated the Prometheus configuration. Now we need to reload the configuration in Prometheus so that it is able to find the pods and services in the added project. For our test setup we could just kill the Prometheus pod with the command: oc delete pod prometheus-0 --grace-period=0 --force For a production environment it is not a good idea just to kill Prometheus in order to reload the configuration, because you interrupt the monitoring. There is an alternative way, for this you need to submit an empty POST to Prometheus URL with the suffix “-/reload”. The problem here is that with our OpenShift you can’t just submit a POST directly to the Prometheus server, because of the OAuth authentication. Luckily we are able to execute the command within the prometheus pod itself with the following OpenShift CLI command oc exec prometheus-0 -c prometheus -- curl -X POST After executing this command and some time you should see on the “Status->Targets” the pods and the services of the demo application. In case you don’t see the services as “Up” you might need to hit refresh a couple of times in the browser. It should look like this: The scrap configuration used in this article requires annotations in the services and pods so that metrics can be scraped from them (opt-in). This is done with these three lines in scrap configuration for each job: - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] action: keep regex: true If you want to scrap all pods respectivly services unless the specifed otherwise in the service or pod (out-out) you need to modify the configuration to this: - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] action: drop regex: false For our example we use the opt-in configuration. In case your are wondering, the template of the “demoapplication” already contains the setting for scrapping the pods and the service. For the pod’s the configuration looks like this: ... template: metadata: annotations: openshift.io/generated-by: OpenShiftNewApp prometheus.io/path: /metrics prometheus.io/port: "8080" prometheus.io/scrape: "true" labels: app: ${APP_NAME} deploymentconfig: ${APP_NAME} spec: containers: - image: olafmeyer/${APP_NAME} imagePullPolicy: IfNotPresent name: ${APP_NAME} resources: {} ... The configurations for the service look like this: ... - apiVersion: v1 kind: Service metadata: annotations: prometheus.io/scrape: "true" prometheus.io/scheme: http prometheus.io/port: "8080" # prometheus.io/path: /metrics labels: app: ${APP_NAME} name: ${APP_NAME} ... With these configurations the pods and services are not only enabled for scrapping, furthermore the port, path and the scheme (http/https) for the metrics can be overwritten. In our case the used port of the demo application is 8080 instead of the default port 80. The only part that is missing is to display the collected metrics of the demo application in Grafana. Like in every cooking show on TV, I have already prepared something. In our scenario you just need to import a dashboard to see some metrics. For this, you need first to download this (Grafana dashboard template)[] file. In order to use the template, select in the browser with the Grafana the Grafana-Logo (upper left)->Dashboards->Import. In the next screen upload the Grafana dashboard template file. The following screen should look like this: Here you define the name of the Grafana dashboard and the data source. Please select the data source that you have defined above for Prometheus. After this click the button “Import” and you should see something like this: In order to get some metrics you call the service “hello-world” of the demo application a couple of times either in the browser or by executing the following command: for i in {0..1000}; do curl -s.<your server name>/hello-world; done Congratulation! You have now installed Prometheus and Grafana on your OpenShift cluster. Furthermore, you have installed a demo application and gathered metrics of it. This article showed you how to deploy Prometheus and Grafana on an OpenShift Cluster without admin permissions. Also it described how to configure Prometheus to collect metrics of an application in a different project. Lastly it showed how to display these metrics in Grafana. This article is only the starting point on the monitoring of applications in OpenShift with Prometheus. The next steps could be to attach persistent volumes to Prometheus and Grafana to store the configuration and other data, extend the monitoring, add alerts, define an archiving of metrics, clustering of Prometheus and so. The templates that are used to deploy Prometheus and Grafana are based on templates of these websites: * OpenShift Origin Prometheus template * Grafana on OpenShift by Eldad Marciano
https://labs.consol.de/de/development/2018/01/19/openshift_application_monitoring.html
CC-MAIN-2021-04
en
refinedweb
mbsinit - test for initial shift state #include <wchar.h> int mbsinit(const mbstate_t *ps); Character. For an explanation of the terms used in this section, see attributes(7). POSIX.1-2001, POSIX.1-2008, C99. This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at.
https://manual.cs50.io/3/mbsinit
CC-MAIN-2021-04
en
refinedweb
Understanding Observer Pattern in C++ in depth Reading time: 20 minutes The Observer Pattern is a design pattern where changes in one object can be notified to other objects. This is important as with this, we can use objects that have dependency and can avoid regular checking for changes. It is widely used in situations like refreshing a webpage provided the database state has changed like a stock price page. Key points: - Observer is the object to whom the changes will be notified - Subject is the object in which changes will take place - There is One to many dependency between Subject and Observer - Observers themselves do not have access to data We will answer the following questions: - When to use Observer pattern? - What are Real Life Use cases of Observer pattern? - A C++ Exmaple of Observer pattern - What are the Advantages of Observer pattern? - What are the Disadvantages of Observer pattern? When to use Observer pattern? You should consider using this pattern in your application when multiple objects are dependent on the state of one object as it provides a neat and well tested design for the same. What are Real Life Use case of Observer pattern? It is heavily used in GUI toolkits and event listener. In java: - the button(subject) - onClickListener(observer) are modelled with observer pattern. Social media, RSS feeds, email subscription in which you have the option to follow or subscribe and you receive latest notification. All users of an app on Play store and iOS Store gets notified if there is an update. All chrome extension users are updated when a new version is available A C++ Exmaple of Observer pattern Here we have: - Observer class with a notify function - observer_concrete class which extends the Observer class - subject class which keeps track of all observers and calls the notify() function of each observer in case of any changes Go through this C++ example code carefully: #include <vector> #include <functional> class observer { public: virtual void notify() = 0; }; class observer_concrete : public observer { public: virtual void notify() override { } }; class subject { public: void register_observer(observer& o) { observers.push_back(o); } void notify_observers() { for (observer& o : observers) { o.notify(); } } private: std::vector<std::reference_wrapper<observer>> observers; }; The observer pattern allows generic observer objects to be registered with a subject object and receive notifications when certain events occur on them. Observers (also known as listeners), in this case, are objects that implement the observer interface. The register_observer function adds observers to this std::vector, which are later to be notified by the notify_observers function. Use of std::reference_wrapper for the elements of the std::vector , because the standard containers require the element type to be assignable, which normal reference types are not. What are the Advantages of Observer pattern?. What are the Disadvantages of Observer pattern? - Memory leaks caused by Lapsed listener problem because of explicit register and unregistering of observers.It originates in the observer pattern, where observers (or listeners) register with a subject (or publisher) to receive events. In basic implementation, this requires both explicit registration and explicit deregistration, as in the dispose pattern, because the subject holds strong references to the observers, keeping them alive. The leak happens when an observer fails to unsubscribe from the subject when it no longer needs to listen. Consequently, the subject still holds a reference to the observer which prevents it from being garbage collected — including all other objects it is referring to — for as long as the subject is alive, which could be until the end of the application. - Infinite recursion in notifications This occurs when there is a cycle in the dependency graph. Now technically cycles should be impossible, and that is indeed the case if data dependency is represented at a fine-grained enough level. However in practice it is common for objects to host multiple caches, so that there may be cycles at the coarse resolution of objects. - Dirty reads Let Y = f(X) and Z = g(X,Y). This typically leads to a redundant edge in the dependency graph: Observer pattern dirty reads: Let X be changed and X notifies Z before Y. Then Z may access a dirty cached value in Y, because Y hasn't yet been marked as dirty by X. A dirty read can be a source of surprises. For example, Z may see a value of Y that should be impossible given the value of X. Observer attaches or detaches during a notification The problem is that while a subject is notifying one of the observers, an observer decides to attach or detach to/from the subject. This may cause a crash depending on the data structure used by the subject to store the observers. One hack I've seen to solve this problem is to use a "one shot observer". Another is to make a copy of the list of observers before issuing the notifications.
https://iq.opengenus.org/observer-pattern-cpp/
CC-MAIN-2021-04
en
refinedweb
Java - Comments The Comments are added in programming code with the purpose of making the code easier to understand. It makes the code more readable and hence easier to update the code later. Comments are ignored by compiler while running the code. In Java, there are two ways of putting a comment. - Single line comment - Block comment Single line Comment: It starts with // and ends with the end of that line. Anything after // to the end of line is a single line comment and will be ignored by compiler. Syntax //single line comment. statements; //single line comment. Example: The below example illustrates how to use single line comments in a Java script. The compiler ignores the comments while compiling the code. public class MyClass { public static void main(String[] args) { //first single line comment. System.out.println("Hello World!."); / Java code which is ignored by the compiler while compiling the code. public class MyClass { public static void main(String[] args) { /*first block comment. */ System.out.println(/*second block comment.*/"Hello World!."); } } The output of the above code will be: Hello World!.
https://www.alphacodingskills.com/java/java-comments.php
CC-MAIN-2021-04
en
refinedweb
Add a static list of interfaces to the global list of interfaces #include <aoi.h> const AOICtrl_t *AoAddStatic(AOInterface_t *interfaces); libaoi.so This function makes statically defined (that is, not loaded from a DLL) interfaces available to the AOI API. Use this function when you want to directly link your application with a set of interfaces. NULL QNX Neutrino
http://www.qnx.com/developers/docs/7.0.0/com.qnx.doc.neutrino.addon/topic/ao/aoaddstatic.html
CC-MAIN-2018-43
en
refinedweb
T- type for which the wrapper is created public interface InterceptionFactory<T> InterceptionFactoryallows to create a wrapper instance whose method invocations are intercepted by method interceptors and forwarded to a provided instance. An implementation of InterceptionFactory may be obtained by calling BeanManager.createInterceptionFactory(CreationalContext, Class) to be used in the create method of a custom bean for example. public class MyCustomBean implements Bean<MyClass> { BeanManager bm; public MyBean(BeanManager bm) { this.bm = bm; } public MyClass create(CreationalContext<MyClass> creationalContext) { InterceptionFactory factory = bm.createInterceptionFactory(creationalContext, MyClass.class); factory.configure().filterMethods(m -> m.getJavaMember().getName().equals("shouldBeTransactional")).findFirst() .ifPresent(m -> m.add(new AnnotationLiteral<Transactional>() { })); return factory.createInterceptedInstance(new MyClass()); } } The container must also provide a built-in bean with scope Dependent, bean type InterceptionFactory and qualifier Default that can be injected in a producer method parameter. @Produces @RequestScoped public MyClass produceMyClass(InterceptionFactory factory) { factory.configure().add(new AnnotationLiteral () { }); return factory.createInterceptedInstance(new MyClass()); } Instances of this class are neither reusable nor suitable for sharing between threads. InterceptionFactory<T> ignoreFinalMethods() createInterceptedInstance(Object). Ignored methods should never be invoked upon the wrapper instance created by createInterceptedInstance(Object). Otherwise, unpredictable behavior results. AnnotatedTypeConfigurator<T> configure() AnnotatedTypeConfiguratorinitialized with the AnnotatedTypecreated either for the class passed to BeanManager.createInterceptionFactory(CreationalContext, Class)or derived from the InterceptionFactoryparameter injection point. The configurator allows to add or remove interceptor bindings used to associate interceptors with the wrapper instance returned by createInterceptedInstance(Object). Each call returns the same AnnotatedTypeConfigurator. AnnotatedTypeConfiguratorto configure interceptors bindings T createInterceptedInstance(T instance) This method should only be called once, subsequent calls will throw an IllegalStateException. If T is not proxyable as defined in section 3.11 of the spec an UnproxyableResolutionException exception is thrown. Calling ignoreFinalMethods() before this method can loosen these restrictions. If the provided instance is an internal container construct (such as client proxy), non-portable behavior results. instance- The provided instance Copyright © 2008–2017 JBoss by Red Hat, Inc.. All rights reserved.
http://docs.jboss.org/cdi/api/2.0/javax/enterprise/inject/spi/InterceptionFactory.html
CC-MAIN-2018-43
en
refinedweb
Pacific Rim: Uprising Pacific Rim: Uprising Universal Pictures Director: Steven S. DeKnight Screenplay: Steven S. DeKnight, Emily Carmichael, Kira Snyder and T.S. Nowlin, based on characters created by Travis Beacham Starring: John Boyega, Cailee Spaeny, Charlie Day, Jing Tian, Scott Eastwood, Rinko Kikuchi, Burn Gorman and Adria Arjona Rated PG-13 / 1 hour, 51 minutes / 2.39:1 March 23, 2018 (out of four) You never go full Transformers. Guillermo del Toro's original Pacific Rim may have drawn just that comparison - what with the giant robots tearing apart cities and all - but in truth it was a goofy, personal, eccentric movie that, whatever its (many) flaws, unmistakably rode its own wavelength. Inspired by monster movies and anime and pulp - and taking on the affected manner, in performance and design, of those influences - the film was, in summer blockbuster terms, both familiar and foreign. At a passing glance it more or less looked like Godzilla vs. Megatron, until you looked just a bit closer and saw all its dangling idiosyncrasies and oddball obsessions. Pacific Rim: Uprising is what happens when you take the weird out of the equation. It's what happens when you want all the toys del Toro played with but without the del Toro - when you're a studio executive and you see Pacific Rim and your observation is, "There are robots and monsters in it. Let's make more robots and monsters." Universal's launching of a franchise - largely on the strength of the original's performance at the Chinese box office - requires a certain willful misunderstanding of what made that movie what it was, for better and/or worse. (Or, to look at it more cynically, a more honest assessment of what wide global audiences really wanted out of Pacific Rim, or saw in it all along.) But here it is, this Uprising, a deeply streamlined version of its predecessor - with the robots-to-monsters ratio tilted heavily in favor of the former - as if this were really its true form all along. At a passing glance it more or less looks like Megatron vs. Jaeger, and then you look a bit closer and that's pretty much exactly what it is, and absolutely nothing more, and also boring as shit. And let me clarify that when I say boring, I'm talking Scott-Eastwood's-Screen-Presence boring. The real shit. When I say boring, I mean the characters spend half the movie uttering the phrase Rare-Earth Elements - the rare-earth elements, you see, are the key to the villainous Kaiju plan, on account of the way rare-earth elements react to Kaiju blood - as if the four credited screenwriters couldn't even be bothered to pick one of the rare-earth elements, like specifically, as their chemical MacGuffin. Or invent one, even. Or, since Kaiju blood isn't real, pick any other existing rarity and decide, "Yes, this is the thing that has a violent reaction to Kaiju blood, because this is a made-up concept and we can decide that a made-up thing reacts violently with anything we want without any inherent discrepancy." But no, instead, Rare-Earth Elements is the terminology they decided to have their actors throw around. It's like the Bluths holding that fundraiser to find a cure for TBD. I mean, say what you will about Unobtainium, at least there's a sort of panache to it. Uprising is course-correction in the wrong direction. For those who mistook the original for a Transformers-like spectacle, the producers have seen fit to give them a Transformers-like spectacle as a follow-up. Sorry about that personal touch, you guys - here's that generic action flick you expected. In order to accomplish this, Steven S. DeKnight - a TV writing and producing veteran with a few episodic directing credits to his name, and zero feature-film experience - was brought on to take over for del Toro behind the camera. And boy, credit where it's due, DeKnight really TV-veteran-with-zero-feature-film-experiences the shit out of this thing. Passably shot without ever being memorable, mostly coherent without ever being interesting, this movie is like a perfectly bland amalgamation of the summer blockbuster template. It looks exactly like you would expect a $150M+ budget action movie about giant robots to look, it has exactly the tone of voice and character dynamics you would expect a $150M+ budget action movie to have, without any distinguishing features getting in the way. Uprising shows the creative fatigue of a much older franchise. DeKnight often seems to think he's following in Michael Bay's footsteps rather than del Toro's, with several of his camera angles and wide compositions looking more reminiscent of Transformers footage than the more intimate, wide-eyed grandeur del Toro offered in Pacific Rim. Then again, whatever directorial personality he chose to try on in one sequence or another is not enough to give the direction as a whole any actual flavor. It's all aftertaste. The film's autopilot narrative focuses on a disaffected former pilot, who is supplied with both an estranged ex-partner and a plucky kid sidekick. He also enjoys ice cream. (You know, for depth.) The disaffected former pilot and his estranged ex-partner are supplied with a Very Beautiful Woman to bicker over and get jealous about even though neither of them ever seems to say more than one sentence at a time to her. The plucky kid sidekick is supplied with a resentful Russian rival to fight with. The plot is supplied with a sinister corporation that is Probably Doing Something Naughty. (Or is it?) And finally there are our returning champions, the scientist duo who, after working together to save the world last time, find themselves with competing agendas this time around. (One of them has been brainwashed by the Kaiju, so you can't really blame him.) The film's preamble actually suggests a more interesting (though not as summer-friendly) movie, focusing on what the world has become in the ten years since Stringer Bell canceled the apocalypse. A collective euphoric release, a decadent celebration amidst a civilization living on indefinite borrowed time. Kaiju bones become collectors' items, trophies, found-art sculptures for the affluent - the perfect visual centerpiece for your pool party. Scrapheaps around every corner, Jaeger machinery resting side by side with the rubble left over from years of destruction. It's 2035, a strange wasteland of wartime memories and technological upheaval, a world of jaded revelers on high alert. But this backdrop - this decade of decadence - is simply montaged as a path from one movie to the next, and primarily in order to introduce us to Stacker Pentecost's son, Jake* (John Boyega), who's been living the rogue life since quitting the Jaeger program, spending his days on the hustle around Jaeger graveyards selling machine parts and nuclear cores. That he will wind up back in the place he left - and where his father left such an impossible legacy - is obvious, but before he gets there he has to get paired up with Amara (Cailee Spaeny), an orphan thief and tinkerer who sees Jaegers as symbols of humanity's capacity for greatness. The two get caught trying to steal the same piece of equipment, and after Jake's sister Mako (Rinko Kikuchi, in a too-brief reprisal of her original role) pulls some strings, they both wind up back in the Jaeger training program. Heading up that program is none other than the aforementioned ex-partner, Nate (Eastwood). * As if someone named "Stacker" would ever name his kid "Jake." Its other issues notwithstanding, Uprising is the best use of Boyega's natural energy and charm since his breakout role in Attack the Block, and when the movie works - to whatever extent it works - it's on the strength of his presence. (He's been quite good in the Star Wars sequels and other recent films, but those roles have generally required different modes from him - the neurotic, unsure, foolish courage of Finn; the quiet resolve and contemplation of his security-guard role in Detroit.) His Jake Pentecost is ego and smarts and toughness, the kind of guy who can persuade any hardened crook he can get him what he wants, then takes the utmost pleasure in outsmarting and outrunning that same crook. He enjoys the reputation he has in the circles that know his name, even if it puts a constant target on his back. He enjoys the target, too. It's doubly important that Boyega carry the load given that he so often plays opposite Scott Eastwood. If you didn't think it would be possible to get a performance more wooden and uncharismatic than Charlie Hunnam's lead turn in the original, Eastwood took that doubt as a personal challenge. Eastwood in Uprising makes Hunnam in Pacific Rim look like Brando in Streetcar. Most of the original's stars are gone; Ron Perlman's Hannibal Chau - and the black-market corner of the world he so grandly inhabited - is a deeply felt absence. But Charlie Day and Burn Gorman return (Gorman strangely, and disappointingly, abandoning the heightened cartoonish persona he gave us in the first movie in favor of a more toned-down version, more in line with traditional Hollywood middle-aged scientist-nerd comic relief), while Jing Tian joins the cast as the regal but ruthless CEO of the Shao Corporation, which is on the verge of deploying a controversial Jaeger drone program. On the recruit side of things, the young Spaeny goes toe to toe with Russian Elizabeth Olsen Ivanna Sakhno in a subplot that plays more like an outline for a screenplay about hotshot military trainees than a fully formed story of its own. God help us if that turns out to be the starting point for another unnecessary sequel.
http://www.intergalacticmedicineshow.com/cgi-bin/mag.cgi?do=columns&vol=chris_bellamy2&article=880
CC-MAIN-2018-43
en
refinedweb
Support Vector Machines are supervised learning models which can be used for both classification and regression. SVMs are among the best supervised learning algorithms. It is effective in high dimensional space and it is memory efficient as well. Consider a binary classification problem, where the task is to assign a one of the two labels to given input. We plot each data item as a point in n-dimensional space as follows: We can perform classification by finding the hyperplane that differentiate the two classes very well. As you can see in the above image, we can draw m number of hyperplanes. How do we find the best one? We can find the optimal hyperplane by maximizing the margin . We define margin as a twice of the distance between the hyperplane and the nearest sample points to the hyperplane. This points are known as support vector. They known as support vectors because they hold up optimal hyperplane. In above figure, support vectors are represented with filled color. Consider a first hyperplane in figure-1 which touches the two sample points(red). Although it classifies all the examples correctly, but the problem is our hyperplane is close to the so many sample points and other red examples might fall on the other side of the hyperplane. This problem can be solved by choosing a hyperplane which is farthest away from the sample points. It turns out that this type of model generalize very well. This optimal hyperplane is also known as maximum margin separator. We know that we want hyperplane with maximum margin and we also discussed why we want this. Now, let us learn how to find this optimal hyperplane? Before that, please note in case of SVMs, we represent class labels with +1 and -1 instead of 0 and 1(Binary Valued Labels). Here, we represent each hyperplane, the optimal one, negative and positive hyperplane(dashed lines) with linear equations - wTx + b = 0, wTx+b = -1 and wTx + b = +1 respectively. The left most dashed line is negative hyperplane. We represent red points with x- and blue points with x+. To derive the equation for a margin let us substract equations of negative and positive hyperplane from each other. Adding length of the vector w to normalize this, where, 2/||w|| is the margin. Now the objective of the SVM becomes maximization of the margin under the constraint that samples are classified correctly. This can also be written more compactly as In practice, it is easier to minimize the below given reciprocal term This is the quadratic programming problem with the linear constraint. In the case of inherently noisy data, we may not want a linear hyperplane in high-dimensional space. Rather, we'd like a decision surface in low dimensional space that does not clearly seperate the classes, but reflects the reality of the noisy data. That is possible with the soft margin classifier, which allows examples to fall on the wrong side of the decision boundary, but assigns them a penalty proportional to the distance required to move them back on the correct side. In soft margin classifier, we add slack variables to the linear constraint. Now, our objective to minimize is C is the regularization parameter. Small C allows constraint to be easily ignored and results in large margin whereas large C makes constraints hard to ignore and results in narrow margin. This is still a quadratic optimization problem and there is a unique minimum. Now let us implement linear SVM classifier in Python using sklearn. We will use iris dataset #import the dependenciesfrom sklearn.datasets import load_irisfrom sklearn.svm import SVC#load datasetdataset = load_iris()data = dataset.datatarget = dataset.target In machine learning, we always need to do some preprocessing to make our dataset suitable for the learning algorithm. I will introduce few preprocessing techniques as we go through various algorithms. Here, we will perform feature scaling which is required for optimal performance. Feature scaling is used to standardize the range of features of data. from sklearn.preprocessing import StandardScalersc = StandardScaler()sc.fit_transform(data) #check out preprocessing module of sklearn to learn more about preprocessing in ML Output: array([[ -9.00681170e-01, 1.03205722e+00, -1.34127240e+00,-1.31297673e+00],[ -1.14301691e+00, -1.24957601e-01, -1.34127240e+00,-1.31297673e+00],[ -1.38535265e+00, 3.37848329e-01, -1.39813811e+00,-1.31297673e+00],[ -1.50652052e+00, 1.06445364e-01, -1.28440670e+00,-1.31297673e+00],[ -1.02184904e+00, 1.26346019e+00, -1.34127240e+00,-1.31297673e+00],......[ 1.03800476e+00, 5.69251294e-01, 1.10395287e+00,1.71090158e+00],[ 1.03800476e+00, -1.24957601e-01, 8.19624347e-01,1.44795564e+00],[ 5.53333275e-01, -1.28197243e+00, 7.05892939e-01,9.22063763e-01],[ 7.95669016e-01, -1.24957601e-01, 8.19624347e-01,1.05353673e+00],[ 4.32165405e-01, 8.00654259e-01, 9.33355755e-01,1.44795564e+00],[ 6.86617933e-02, -1.24957601e-01, 7.62758643e-01,7.90590793e-01]]) #now let us divide data into training and testing setfrom sklearn.model_selection import train_test_splitX_train, X_test, y_train, y_test = train_test_split(data, target, random_state=42, test_size=0.3)#train a modelmodel = SVC()model.fit(X_train,y_train) Output: SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0,decision_function_shape=None, degree=3, gamma='auto', kernel='rbf',max_iter=-1, probability=False, random_state=None, shrinking=True,tol=0.001, verbose=False) from sklearn.metrics import accuracy_scoreaccuracy_score(y_test, model.predict(X_test)) # Outputs: 1.0model.support_vectors_.shape # Outputs: (39, 4)model.support_vectors_ Output: array([[ 5.1, 3.8, 1.9, 0.4],[ 4.8, 3.4, 1.9, 0.2],[ 5.5, 4.2, 1.4, 0.2],[ 4.5, 2.3, 1.3, 0.3],[ 5.8, 4. , 1.2, 0.2],[ 5.6, 3. , 4.5, 1.5],[ 5. , 2. , 3.5, 1. ],[ 5.4, 3. , 4.5, 1.5],[ 6.7, 3. , 5. , 1.7],[ 5.9, 3.2, 4.8, 1.8],[ 5.1, 2.5, 3. , 1.1],[ 6. , 2.7, 5.1, 1.6],[ 6.3, 2.5, 4.9, 1.5],[ 6.1, 2.9, 4.7, 1.4],[ 6.5, 2.8, 4.6, 1.5],[ 7. , 3.2, 4.7, 1.4],[ 6.1, 3. , 4.6, 1.4],[ 5.5, 2.6, 4.4, 1.2],[ 4.9, 2.4, 3.3, 1. ],[ 6.9, 3.1, 4.9, 1.5],[ 6.3, 2.3, 4.4, 1.3],[ 6.3, 2.8, 5.1, 1.5],[ 7.7, 2.8, 6.7, 2. ],[ 6.3, 2.7, 4.9, 1.8],[ 7.7, 3.8, 6.7, 2.2],[ 5.7, 2.5, 5. , 2. ],[ 6. , 3. , 4.8, 1.8],[ 5.8, 2.7, 5.1, 1.9],[ 6.2, 3.4, 5.4, 2.3],[ 6.1, 2.6, 5.6, 1.4],[ 6. , 2.2, 5. , 1.5],[ 6.3, 3.3, 6. , 2.5],[ 6.2, 2.8, 4.8, 1.8],[ 6.9, 3.1, 5.4, 2.1],[ 6.5, 3. , 5.2, 2. ],[ 7.2, 3. , 5.8, 1.6],[ 5.6, 2.8, 4.9, 2. ],[ 5.9, 3. , 5.1, 1.8],[ 4.9, 2.5, 4.5, 1.7]]) Till now, we see problems where input data can be separated by linear hyperplane. But what is data points are not linearly separable as shown below? To solve this type of problems where data can not be seperated linearly, we add new feature. For example, let us add new feature z = x2 + y2. Now, if we plot data points on x and z axis we get : As you can see, now we can have a linear hyperplane that can seperate data points very well. Do we need to add this additional feature manually? And the answer is no. We use the technique called Kernel Trick. Kernel trick is nothing but a set of functions which takes low-dimensional input space and transform it into high-dimensional space where data points are linearly seperable. These functions are called kernels. Widely used kernels are Radial Basis Function Kernel, Polynomial Kernel, Sigmoid kernel, etc. Let us implement this in sklearn. #we have already imported libs and datasetmodel2= SVC(kernel="rbf", gamma=0.2)model2.fit(X_train, y_train)model2.score(X_test, y_test)# Output: 1.0 We can have different decision boundary for different kernels and gamma values. Here is the screenshot from scikit-learn website.
https://www.commonlounge.com/discussion/17083a917de049908407bb8f5e32c9be
CC-MAIN-2020-10
en
refinedweb
Implied Warranty of Fitness A number of people advocate avoiding templates when producing XML, lest they produce output that is not well formed. Yet I use a templates for this weblog. Venus produces a DOM, and serializes it via XSLT, so it is pretty safe... or so you would think. Here a few ways I have found in which one can produce a DOM which can’t be serialized as well-formed XML: from xml.dom import minidom doc = minidom.getDOMImplementation().createDocument(None,None,None) root = doc.createElement('9') root.setAttribute(';',u'\x0C') root.appendChild(doc.createTextNode(u'\uFFFF')) root.appendChild(doc.createComment('-')) doc.appendChild(root) try: minidom.parseString(doc.toxml('utf-8')) except Exception, e: print e print print doc.toxml() Am I missing anything? Venus currently handles all of these cases, and it is my intention that it will continue to do so — as well as handle any other cases that I may have missed — as I transition from sgmllib based processing to html5lib based processing.
http://www.intertwingly.net/blog/2007/02/02/Implied-Warranty-of-Fitness
CC-MAIN-2020-10
en
refinedweb
Posted by Felix, May 2019. Author contact: Twitter | Mail | LinkedIn Tags: Hancitor, Chanitor, packer, unpacking, spaghetti code, shellcode, control flow obfuscation, import table reconstruction, reflective PE loading, YARA It has been a while since I have written a blog - I have been working on some tools and other projects instead - so I decided to have another go at it . A while ago, the Twitter users 0verfl0w_ and Vitali published some nice blogs on the Hancitor malware. This made me curious to also have a look at the malware family. The Hancitor malware family has been around for a while and its core job is to download and execute additional malware. In order to succeed at its job, the malware must succeed in being run undetected on the machine and thus effectively stay under the radar of security software such as an antivirus. One of Hancitor's endeavors to bypass antivirus is by making use of a booby trapped Office document and to instruct Office to inject the Hancitor binary in a legitimate Windows process. This method has been documented well by the Airbus security team and has been used untill approximately the summer of 2018. Around that time, the Hancitor crew has shifted its infection mechanism by making their spammed Office documents download a packed executable to disk. An executable written to disk usually gets inspected/scanned by antivirus, yet the Hancitor malware has been reasonably successful in evading being detected (initially) as malicious. Hancitor's evasive success can be partly attributed to the packer/crypter being used. In this blog I will do a (technical) deep dive into Hancitor's packer, which has not changed much since the summer of 2018. I will discuss how the packer protects its payload and how it tries to thwart analysis. At the end of this blog, I'll demonstrate how this packer has also been used by many other malware families in the past. The packer The below image gives an overview of the sample which I'll discuss in this blog. Although I will be discussing a specific packed Hancitor sample, the information in this blog is applicable to many other packed Hancitor samples, as the packer has not changed much between the many SPAM campaigns (particularly the first layer of the packer has been very consistent). In this archive (password=infected) a collection of many packed Hancitor samples can be found (many thanks to Brad and James for sharing the samples on Twitter!). Image one: Overview of the packed Hancitor sample In order to keep the analysis organized, I have a divided the packed sample into "modules" (pieces) based on functionality. For each module I have added the address of the first and last relevant assembly instruction, such that interested readers can use this blog as a reference when unpacking the sample themselves in a debugger. For those who are interested in the disassembled code, but don't want to plow through the entire sample in a debugger, I have added a commented assembly output per module. Lastly, for the malware hunters among us, I have added a YARA rule for the packer in the blog's addendum. - Module 0: link to commented disassembled code (start address: 0x0040266D) - Module 1: link to commented disassembled code (start address: 0X00405177) - Module 2: link to commented disassembled code (start address: 0X004087A1) - Module 3: link to commented disassembled code (start address: start_mem_region+0x3E4) - Module 4: link to commented disassembled code (start address: 0X004015F0) - Module 5: link to commented disassembled code (start address: 0X00401520) - Module 6: link to commented disassembled code (start address: start_mem_region+0x2BF0) Spaghetti code The packed Hancitor executables always start by executing random, non-dodgy functions. We will define this code region as module zero (disassembled code). Putting random code near the executables' entrypoint makes them look unique, that is to say, for security products which (understandably) only parse/emulate executables partially because of performance reasons. The random code ends by jumping to the next module, module one (disassembled code). The disassembled output of the module one section is hard to interpret. The packer's author has broken the linear sequence of assembly instructions by reordering the instructions and connecting them to each other via JUMP instructions, as can be seen in image two. Additionally, between each instruction random instructions - which will never be executed - are placed. Image two: Spaghetti code which decrypts the next module This technique, known as spaghetti code, bypasses static detection techniques which rely on the malicious instructions being placed consecutively on each other. The goal of the spaghetti code is to change the memory protection of a part of the executable (to which we will referrer as module two) and then to decrypt said part via a simple XOR loop. Once the relevant part is decrypted, the code execution is transferred to that part via a simple JMP EAX instruction. Resolving APIs Module two (disassembled code) has three tasks: resolve the addresses of APIs which will be used in the next module, map itself and the next module in a newly allocated memory region and hunt for the start of the next module in the new memory region (delimited by the 70C5BA88 byte marker). I will not discuss how the API addresses are resolved, as the packer will use a similar technique in a later module, at which point I'll discuss the technique in depth (see paragraph: reconstruct import table). The most important part of the API resolving code is the list of APIs which are resolved: - kernel32_GetProcAddress - kernel32_GetModuleHandleA - kernel32_LoadLibraryA - kernel32_VirtualAlloc - kernel32_VirtualFree - kernel32_OutputDebugStringA - ntdll_memset - ntdll_memcpy The APIs in the list will be used to map DLLs into the packer's process memory, to resolve additional API addresses and to allocate and free memory regions. The thing in module two that stands out the most is the way (API) strings are embedded inline with the assembly code, as can be seen on image three. Image three: Data (API names) inline with the assembly code Most compilers will place strings in a region which is different from the region where the assembly code resides. To get the memory address of the inline string, the assembly code makes use of a simple trick: it will execute a CALL $+5 instruction (a procedure call where the destination is the subsequent instruction). Executing a CALL instruction will result in the return address (i.e. the address of the instruction that follows the call instruction) being pushed on the stack. The return address is immediately retrieved by executing a POP EAX instruction (pop the top of the stack into the EAX register). The return address is thus pointing to the location of the POP instruction. Because the assembly is interested in the start address of the inline placed string, three bytes needs to be added to return address (skip the POP and JMP short instructions). We can see the assembly code performing this action as follows: ADD EAX, 3. It is useful to remember this little trick in your short-term memory, because it will also be used in the next module. Decrypt next layer Module three (disassembled code) starts by overwriting code at three locations, as can be seen on image four. These locations correspond with the packed executable's entrypoint (module zero), the start of the spaghetti code (module one) and the start of module two (the addresses are described on image one). Image four: Overwriting three previous modules The code then continues by decrypting the next layer (the next modules), by making use of the APIs listed in the previous paragraph. Once the next layer has been decrypted, the module resolves the addresses of the APIs which will be used in the next layer (image five), to which we will refer as layer two. Image five: addresses of resolved APIs in memory After having resolved the API addresses, the code does something somewhat odd: it patches values in the PE header and it overwrites the section header. This action doesn't make much sense to me, because I believe these values are of no use once the executable has been mapped into memory ? Nevertheless, this action helps us in our efforts to dump the second layer executable from memory, as it seems like we have the correct PE header as well as the decrypted code. Image six: overwriting section headers bug Upon inspecting the dumped second layer executable, I noticed that the section headers were shifted. When we look at the code responsible for overwriting the section headers, we can notice an interesting bug in the packer. Remember the inline data trick I discussed in the previous paragraph? It looks like the packer's author made a small mistake while using it to overwrite the section header . Because the JMP instruction following the POP EAX instruction in module three consists of five bytes (it consisted of only three bytes in module two), the start address of the section header data is off by three bytes (image six). Instead of adding three bytes to the EAX register, the code should've added six bytes. If we correct this mistake while debugging, we get a correct dump of layer two (which I have added here). Module three ends by destroying its own code. The destruction is performed via a simple loop which overwrites every address in the module with zero valued bytes (image seven). Image seven: self destruction code in action (as seen via IDA debugger) Given the fact that the module is mapped in a newly allocated memory region (image one), one can only guess why the packer's author didn't just free the region. Maybe (s)he wanted to avoid analysis techniques which dump code by hooking VirtualFree calls? Maybe (s)he wanted to keep the modules nicely separated (VirtualFree can not be called before execution is transferred to another region/module, as a VirtualFree call would destroy the code responsible for said execution transferring)? After destroying everything, a jump is made to the entrypoint of the second layer executable, to which I will refer as module four. Decrypt Hancitor binary Module four (disassembled code) contains a debug-thwarting trick which can be confusing if you are not aware of what is happening. The module makes use of a technique called control flow obfuscation. The goal of the trick is to make use of a Windows API call in such a way that the main code flow does not continue on the code following the API call. Instead the main code flow is transferred to a callback function which is executed during the API call. If you are not aware of this trick, you would probably jump over each instruction in module four which would result in loosing control over the execution, since no debugger points are set in the registered callback function. Image eight shows how the Hancitor packer makes use of this technique. Image eight: Control flow obfuscation by making use of Window Procedures (RegisterClassExA & CreateWindowExA) The callback function is registered as part of a Windows Class Ex structure, which is passed as an argument to the RegisterClassExA API call. When a call is made to the DispatchMessageA API, the callback function gets executed. The callback function contains a jump to the fifth module. Module five (disassembled code) does not contain many interesting functions. The most important function is a function which decrypts and decompresses the Hancitor executable (if you are still reading at this point, you probably wondered when we would ever get to this stage ). The encrypted executable is stored as data inside layer two, the decryption is performed by three simple XOR loops, as can be seen on the decompiled function code on image nine. Image nine: decompiled decryption code The decompression is performed via a function call to RtlDecompressBuffer (note that the address of this API was resolved in module three, the puzzle pieces are starting to come together!). The decrypted executable is mapped into a newly allocated memory region, to which we will refer to as module six. Reconstruct import table Module six (disassembled code) contains the last functionality of the packer. The goal of the module is to emulate behavior which normally is performed by the Windows Loader: map libraries (DLLs) into the process' address space, resolve the addresses of APIs and store those addresses in the executable's Import Address Table (IAT). This behavior needs to be emulated by the packer because it has loaded the Hancitor executable directly into memory. If the Hancitor executable were to have been loaded from disk, the Windows Loader would have done its job. Obviously, loading the malware from disk is not feasible, as it would be detected quickly by security products. Code similar to the code in this module is frequently present in malware and greyhat tools which load an executable reflectively. As the reader will notice, the reverse engineered code discussed below for example looks very similar to a leaked Gozi/IFSB code part (mirror) which is described by the author as: 'a routine used to create, initialize and execute [a] PE-image without a file'. I am not a suitable person to write referral material about PE structures . However, for the sake of giving some background information on the actions which are performed in module six, I'll try to briefly write down some pointers about the PE's import tables. The IAT is a table of pointers to function (API) addresses which is used as a lookup table when an application is calling a function. The addresses of functions inside a library (DLL) are not static but change when updated versions of the DLL are released, so applications cannot be built using hardcoded function addresses. In order for the Windows Loader to know which libraries and functions it needs to import, they obviously need to be defined inside the executable. This is where the Import Directory Table (IDT) comes into play. The IDT contains structures which contain information about a DLL which a PE file imports functions from. Two important fields in those structures are FirstThunk: a relative virtual address (RVA) inside the IAT, and OriginalFirstThunk: a RVA of the Import Lookup Table (ILT). The Import Lookup Table contains an array of RVAs, each RVA points to a hint/name table (source: PE format, Microsoft). As the name suggests, the hint/name table contains the name of a function which needs to be imported. Module six starts by calculating the in-memory start address of the Import Directory Table. It calculates said address by parsing the PE header of the in-memory mapped Hancitor executable, as can be seen on image ten. First, the executable searches for the start offset of the PE header, a value which is stored at the e_lfanew field (ref: PE offsets). The module then jumps to a certain offset from the start of the PE header to locate a field whose value contains the RVA of the Import Directory. Because this value is a relative offset, the value needs to be added to the in-memory start of the mapped executable. This resulting calculation contains the in-memory start of the Import Directory Table. Image ten: Resolve address of kernelbase & find address of import directory table For module six to be able to map libraries (used by Hancitor) into the process' address space, it needs the memory location of kernel32's LoadLibrary and GetProcAddress functions. To retrieve the function addresses, the packer needs to figure out at which address (inside its own process address space) the kernel32 library is mapped. For this hunt the packer relies on a small piece of shellcode which reads the Process Environment Block (PEB). The below slide from a fifteen-years-old presentation about shellcode explains how the PEB is used to resolve kernel32's base address. Image eleven: Fifteen-year-old presentation discussing shellcode which retrieves the kernel32 base memory address After having resolved the in-memory location of the LoadLibrary and GetProcAddress functions, module six reads the FirstThunk and the OriginalFirstThunk field values inside the Import Directory Table (image twelve, image thirteen). Image twelve: Parsing Import Directory Table for OriginalFirstThunk & FirstThunk fields By enumerating these fields, the module knows via the corresponding hint/name tables which functions need to be imported. The libraries are imported via calls to the LoadLibrary function, the function addresses are resolved via calls to the GetProcAddress function. The module writes the function addressess into Hancitor's Import Address Table. The result of this action can be seen on image fourteen (note that the Import Directory field values can be nicely visualised via Hasherezade's PE bear). A graphical overview of the relation between the fields and import tables discussed in this paragraph can be seen on image thirteen. This action is the last action by the packer, the execution can now *finally* be transferred to Hancitor's code . Image thirteen: Graphical overview of the relations between the import tables. Source: dematte.org. Image fourteen: Parsing the Import Directory Table (IDT) with the ultimate goal of filling the Import Address Table (IAT) Old packer, still does the job During the hunt for additional packed Hancitor samples (using the below YARA rule), I noticed that some of the packed samples were protecting a malware family which didn't look like Hancitor at all . One sample protected some kind of Delphi malware which embedded the names of Turkish banks. The malware looked very similar to the ATMZombie malware, which Kaspersky blogged about (mirror). When we look at an ATMZombie sample which is explicitly mentioned in the Kaspersky blog, we can see that the packer of the mentioned sample is the same packer as the one which is discussed in this blog. Another packed sample which I noticed during my hunt protected a shellcode loader. The sample is mentioned in a Proofpoint blog (mirror) as a Metasploit Stager which in turn downloaded Cobalt Strike. At this point it became clear to me that this packer has been around for a time, and that it isn't exclusively used by Hancitor. In fact, when I kept digging, I found many samples of (old) malware families which were packed by this packer. Some examples are: Zeus/Panda banker, Cryptowall, Ramnit, PoSeidon and Gootkit. All packed and unpacked malware samples can be found here (password=infected). When I launched a YARA search on parts of the encrypted module two bytes (there are 255 variations, as a single byte XOR key is used in the spaghetti code of module one), I found older versions of the packer. One example is a packed Qadars sample. The sample is mentioned as an IOC in an ESET article (mirror) from 2013. This suggests that the packer has been around for at least five years already. Addendum: YARA Rule import "pe" rule hancitor_packer { meta: author = "Felix Weyne, 2019" description = "Hancitor packer spaghetti code (loose match)" hash1= "37f6f1f59bf7952fd7182deeb07d4cd0d367dd59" hash2= "2508b3211b066022c2ab41725fbc400e8f3dec1e" hash3= "3855f6d9049936ddb29561d2ab4b2bf26df7a7ff" hash4= "e9ec4a4fb6f5d143b304df866bba4277cd473843" strings: //E9=JMP, EB=JMP SHORT, 71/0F=JNO $change_sp={89 EC (E9|EB|71|0F)} //mov esp,ebp $2={5D (E9|EB|71|0F)} //pop ebp $3={BF ?? ?? ?? 00 (E9|EB|71|0F)} //mov edi, 274C67h $4={81 ?? ?? ?? ?? 00 (E9|EB|71|0F)} //add edi, 17E792h $5={57 (E9|EB|71|0F)} //push edi $6={BE ?? ?? 00 00 (E9|EB|71|0F)} //mov esi, 88Bh $7={6A 00 (E9|EB|71|0F)} //push 0 $8={54 (E9|EB|71|0F)} //push esp $9={6A 40 (E9|EB|71|0F)} //push 40h $mov_eax={B8 ?? ?? ?? 00 (E9|EB|71|0F)} //mov eax, 5ADBh $add_eax={05 ?? ?? ?? 00 (E9|EB|71|0F)} //add eax, 0E525h $12={8B 00 (E9|EB|71|0F)} //mov eax, [eax] $13={FF D0 (E9|EB|71|0F)} //call eax $ecx_zero={B9 00 00 00 00 (E9|EB|71|0F)} //mov ecx, 0 $xor={30 07 (E9|EB|71|0F)} //xor [edi], al $18={41 (E9|EB|71|0F)} //inc ecx $19={47 (E9|EB|71|0F)} //inc edi $20={39 F1 (E9|EB|71|0F)} //cmp ecx, esi $21={58 (E9|EB|71|0F)} //pop eax condition: filesize < 110KB and pe.is_32bit() and #add_eax >= 3 and #mov_eax >= 3 and all of them and for any i in (1..#xor):($change_sp in (@xor[i][email protected][i]+400)) and for any i in (1..#xor):($ecx_zero in (@xor[i][email protected][i]+300)) }
https://uperesia.com/hancitor-packer-demystified
CC-MAIN-2020-10
en
refinedweb
Hi, It is worth noting that live-build is not a Debian project, it is an external project that claims to be an official Debian project. This is something that needs to be fixed. There is no namespace issue, we are building on the existing live-config and live-boot packages that are maintained and bringing these into Debian as native projects. If necessary, these will be forks, but I'm hoping that won't have to happen and that we can integrate these packages into Debian and continue development in a collaborative manner. live-build has been deprecated by debian-cd, and live-build-ng is replacing it. In a purely Debian context at least, live-build is deprecated. live-build-ng is being developed in collaboration with debian-cd and D-I. I'm aware that I'm going to be upsetting people, but this has been a long time coming and I'm not going to spend time bikeshedding over naming. I would rather spend that time on integration of live image creation into official Debian infrastructure and building the best system for live image creation possible. Consider this thread marked as wontfix. Thanks, Iain. --
https://lists.debian.org/debian-live/2015/11/msg00008.html
CC-MAIN-2020-10
en
refinedweb
GuiRatioFixer From Unify Community Wiki; } } Boo - GuiRatioFixer.boo import UnityEngine # Use this on a guiText or guiTexture object to automatically have them # adjust their aspect ratio when the game starts. class GuiRatioFixer (MonoBehaviour): public m_NativeRatio = 1.3333333333333 def Start (): currentRatio = (Screen.width+0.0) / Screen.height transform.localScale.x *= m_NativeRatio / currentRatioe JavaScript - GuiRatioFixer.js //;
https://wiki.unity3d.com/index.php?title=GuiRatioFixer&oldid=13689
CC-MAIN-2020-10
en
refinedweb
Answer: External environment also called macro environment consist of conditions, entities, events and factors surrounding an organization which influence its activities and choices, and determine its opportunities and risks. External environment can be divided into three broad categories. These are: General environment Industry environment Competitors Here we have to analyze the general environment of China. General environment is composed of several elements, which are discussed below in details. A. Demographic: 1. Geographic Distribution: If we see the geographical location of china in map than it is surrounded by North Korea, Japan, Vietnam etc. o Natural Hazards: There are frequent typhoons, damaging floods, Tsunamis, earthquakes, droughts, land subsidence etc occurs. So there is a high risk of natural calamities over there. o Climate: If we talk about the climate of china than it is extremely diverse, hot in south to cold in north. o Mountains and hilly land take up 65 percent of the total area. so most of the area of china are covered by mountains. o Area = total: 9,596,960 sq km o Land: 9,326,410 sq km o Water: 270,550 sq km o Coastline:14500 Km o China is World’s fourth largest country after Russia, Canada, US 2. Population size:. 3. Classes of Population: The People's Republic of China is a unified, multinational country, comprising 56 nationalities. The Han people make up 91.02 percent of the total population, leaving 8.98 percent for the other 55 ethnic Country Analysis: China 1. 4. The age structure of China: 0-14 years: 20.4% (male 143,527,634/female 126,607,344) 15-64 years: 71.7% (male 487,079,770/female 460,596,384) 65 years and over: 7.9% (male 49,683,856/female 54,356,900) (2007est) Looking to above it is very clear that in China the Older population is very less around 5 to 10 Per Cent, while the ratio of Generation X & Generation Y is high. So from above we can conclude that in China most of age of people are young and so it is very good market for the product targeting to the young age. B. Economic: Before few years company going to china faces lot of problem due to communist government, and there was a fear of confiscation that government may take over a control over your business and may ask you to leave the country and can have control your business and your investment. But after that there was a tremendous change in the political system of china and it open the market for the foreign companies to invest in their country and for that it gives many benefits to those foreign companies and due to that many foreign companies are attracted to invest in china and to take the benefit of cheaper source of production like labor, natural resources and lot of government support. 1. Market oriented economy: Due L.P.G in china it gives, it’s a tremendous benefit to those who are operating in china and or wants to operate in china because of its cheaper source of production and due to that many labor intensive companies had made china as a production hub. And even due to large population in china many companies established in china and they are earning by satisfying the local demand. 2. Inflation Rate: The inflation rate in China was last reported at 4.4 percent in October of 2010. From 1994 until 2010, the average inflation rate in China was 4.25 percent reaching an historical high of 27.70 percent in October of 1994 and a record low of -2.20 percent in March of 1999. Inflation rate refers to a general rise in prices measured against a standard level of purchasing power. The most well known measures of Inflation are the CPI which measures consumer prices, and the GDP Country Analysis: China 2 deflator, which measures inflation in the whole of the domestic economy. China’s consumer prices increased at their fastest pace in two years in October, strengthening expectations the central bank might continue to tighten monetary policy to curb inflationary pressures. Fueled by a spike in food prices, the consumer price index jumped 4.4% in October, well above the 3.6% reading in September and beating economists’ expectations for a 4% rise. The nation’s producer price index accelerated 5% during the month, also beating estimates for a 4.6% rise and September’s 4.3% increase. Food prices soared more than 10% during the month, while non-food price increases, although relatively modest at 1.6%, were higher than the 1.4% increase recorded in September. 3. Interest Rate: The benchmark interest rate in China was last reported at 5.56. From 1996 until 2010, China's average interest rate was 6.49 percent reaching an historical high of 10.98 percent in June of 1996 and a record low of 5.31 percent in February of 2002. China ordered banks to set aside more deposits as reserves for the third time this year, seeking Country Analysis: China 3 to counter the risk of property bubbles and the threat inflation will surge after a record expansion in credit. The reserve requirement will increase 50 basis points effective May 10, the People’s Bank of China said on its Web site today. The current level is 16.5 percent for the biggest banks and 14.5 percent for smaller ones. Today’s move adds to a government crackdown on property speculation that intensified after prices jumped by a record in March and economic growth surged in the first quarter. The central bank left benchmark interest rates unchanged as Europe’s debt crisis highlights policy makers’ concern that the global economic recovery may still be on fragile foundations. The world’s fastest-growing major economy expanded 11.9 percent in the first quarter from a year earlier, the most since the second quarter of 2007. Measures to cool the real-estate market have included a ban on loans for third-home purchases and raising mortgage rates and downpayment requirements for second- home purchases. Besides leaving interest rates at crisis levels, the central bank has yet to scrap the yuan’s peg to the dollar, in place since July 2008 to aid exporters. Inflows of speculative capital from investors betting on yuan gains may have driven today’s move, Chinese government faces numerous economic development challenges like: • Sustaining adequate job growth for tens of millions of migrants: The main problem in china is that the rural market is not developing with the same pace as the urban areas of china and due to that migration level is very high in china, so the main problem for the government is to give support to those migrant and to give them employment and this is the main reason that labor is available at cheaper rate and due to that manufacturing companies are very much attracted to work in china and to make investment in china. New entrants to the work force: Now due to increase population, literate people are also increasing and due to that workforce also increase but due to control of government on population there is a one child policy and due to that slowly the young working population is also increasing. Workers lay off from state-owned enterprises: Now because of privatization in china and reduce in number of public corporation due to that laid off is increases in china and the labor laws are not that powerful and by this labor exploitation in china increases this one of the reason that why the labor is cheap in china and it is helpful to labor Country Analysis: China 4 • • intensive industries are increases that manufacturing companies are more attracted. • Reducing corruption and other economic crimes: The main problem the Chinese government is facing is the problem of high level of corruption is there and which is disturbing the economy and environment badly. And by these the high polluted companies are also given permission to set-up and which affect the environment badly which creates environmental damage and social strife related to the economy's rapid transformation. C. Political/Legal System: Political System: o China is communist country. o Chinese communist parties (CCP) and eight registered small parties in china hold that all resources should be owned and shared by all the people not by profit seeking enterprises for the benefit of the society. In china government controls all the productive resources and industries and as a result the government determine jobs, production, price, Education etc they emphasis on human welfare because profit making is not the government’s main objective. o Political pressure group and leaders o China democracy Party o No substantial political opposition group exists o Cabinet: State Council appointed by the National People's Congress (NPC) Elections: In China president and vice president elected by the National people. o People's Congress for five-year terms; elections last held 15-17 March 2008; premier nominated by the president, confirmed by the National People's Congress Legal System: o China’s legal system is based on civil law system ; derived from Soviet and continental civil code legal principles; legislature retains power to interpret statutes. In this system, the main rules are embodied in legislative codes. Every circumstance is clearly spelled out to indicate what is legal and what is not. There is also a strict and literal interpretation of the law under this system. o Judicial Branch: Supreme People's Court (judges appointed by the National People's Congress); Local People's Courts (comprise higher, Country Analysis: China 5 intermediate, and basic courts); Special People's Courts (primarily military, maritime, railway transportation, and forestry courts) Intellectual Property Rights: The problem of getting patent granted is often difficult in many communist countries and less developed countries because patent law do not exist or are ignored. o China did not enact its first patent laws until 1984 Items like computer software, animal, plants, food, beverages, atomic energy related innovations, chemicals, and pharmaceuticals are not included in patent law o Process of filing for patent – First to file system is adopted. Here patent is granted even if innovation was actually found by someone else. Patent publication is will be published eighteen month after filling. o Tax System: VAT applies to enterprises engaged distribution or retailing activities. in importation, production, o The general VAT rate is 17% but necessities, such as agricultural and utility items, are taxed at 13%. o Custom duty of 25%.generally for all the product the custom duty is less as compare to India and so it even cheaper to import the products to china .. o Tariffs for ASEAN countries is 5.8% from 9.9%: Even special tariffs are there for the ASEAN countries in china and due to that many Indian companies have set up their plants and offices in china and it is also beneficial to other Asian countries. o And even the government gives special concession to the companies if they invest 40% of their earnings in china only, by this china will get good amount of investment as well as the companies will get several tax relieves. D. Socio-Cultural Environment: Country Analysis: China 6 Culture plays a significant role in influencing consumer’s perception, which in turn influences their preference and purchase. A marketing mix is effective as long as it is relevant to their culture. According to culture a company must modified their product. o o o o o o o Great wall, Grand Canal, Karez irrigation system is the symbol of rich culture which build 2000 years ago. Culture is socially shared: In china culture is socially shared. Women in work force: In Chinese business industries women are some times ahead of men. They are the President, Chairman or CEO of some powerful organizations Girl children must have small feet: The preference of wanting their girl children to have small feet. Large feet viewed as lower class people. So that parents from upper class bound daughter’s feet tightly. Lack of shared common culture common values: In china due to lack of shared common cultural values, standardized advertisement may have difficulty in communicating with customers. So due to that advertising and sales promotion require special attention. Culture is enduring: In most Asian countries also in china culture is enduring. Culture is shared and passed along from generation to generation. Old habits are hard to break. People tend to maintain their own heritage. That’s why China is overcrowding. In past china views large family are blessing and assume that children will take care of parents when grown. Old but modern Chinese government make compulsory of one child per family. It’s result in numerous death of first born daughter. Chinese do not consume beef at all: Influence of culture on consumption pattern. Living style and priority of needs are dictated by culture. Chinese do not consume beef at all. They believed that it is improper to eat caftan that work on ferns. Asian consumer prefer their chicken boiled rather than fried E. TECHNOLOGICAL : In the span of less than three decades, China has evolved from a peripheral player to become the most potent engine in the global economy. Along with its rapid economic progress, and the many improvements in the quality of life for large numbers of the Chinese population, a variety of indicators suggest that China’s science and technology (S&T) capabilities also are on a sharply rising trajectory. Since the early 1990s, spending on S&T by the Chinese government has been increasing at a rate approximately twice that of overall economic Country Analysis: China 7 growth. In 2007, China spent RMB (reminbi) 366 billion (US $50 billion) on research and development (R&D), or 1.49 percent of its increasing gross domestic product (GDP), highest among countries with similar economic development level, though the percentage is still lower than that of most of the major developed economies. Foreign investment, as well as imported technology and equipment, continues to pour into China, making it one of the largest recipients of foreign capital and know-how in the world. While most attention has been focused on the rapidly expanding export side of China’s foreign trade, it must also be remembered that China has become one of the world’s largest importers. And, most recently, many of the world’s technologically most innovative companies have decided to move beyond setting up manufacturing facilities in China to establishing advanced R&D centers to develop new products and services for global markets as well as the Chinese domestic market. By the end of 2007, there were well over 1000 foreign R&D centers operating in the People’s Republic of China. In early 2006, with a great deal of fanfare, China’s leadership issued a new “Medium- to Long-Term Plan for the Development of Science and Technology (2006–2020)” (MLP). In addition to setting ambitious national priorities and formalizing the leadership’s commitment to allocate substantial financial and people resources to meet the announced goals, the MLP specifically defines enhancing indigenous innovation capability, leapfrogging in key scientific disciplines, and utilizing S&T to support and lead future economic growth as the major objectives. In a word, once considered one of the more backward developing countries, China today stands as one of the world’s most robust and dynamic economic forces. These trends have led many observers to ask, in a similar vein, whether China also is poised to become a superpower in science and technology. Underlying the massive transitions taking place in the Chinese S&T system is the emergence of a very large, increasingly well-educated talent pool. The term “talent” is a concept that has gained increasing popularity and importance in China over the last few years; specifically, it denotes those Chinese with higher-caliber abilities and skills of strategic significance to the country’s modernization and national wealth creation. Leveraging the significant investments that heretofore have been made to modernize and upgrade the country’s higher education system and R&D infrastructure, China hopes to capture and harness the country’s most strategic resource – its talented people – to embark on a quest to close appreciably the prevailing technological gap between itself and the West in fields ranging from biotechnology to nanotechnology. The launch of the MLP reflects a commitment to rely more on “brains” rather than “brawn” to bring China into a strong, leadership position during the early part of the twenty-first century. Country Analysis: China 8 F. GLOBAL : lackluster. It explains what motivates China to play an active part in economic globalization. Q2: Impacts of the factors of external environment on China’s overall business Industry. Answer: Impacts of the external environment on the overall Chinese business industries are as follows: A. Impact of Demographic factors: There are several demographic factors that affect china’s overall business industry. Each and every factor like geographic distribution, population size, age structure, ethnic mix etc. has individual impacts on different industry. Country Analysis: China 9 The first demographic factor is geographic distribution. Geographically China is very sensitive to natural calamities because frequently different types of natural calamities are striking there. This can have a adverse impact on the Chinese business industry. Many investors may think about not to invest here because of these natural hazards. China’s climate is extremely diverse. The next factor is the population size. China’s population size is the biggest in the world. 20% of the world’s population exists in China. This is one of the most attractive markets for investing. Now the population growth rate is decreasing because of the government’s one child policy, but still it is an attractive market for investing. Every year foreign investments as well as local investments are increasing. Age structure also plays an important role in the Chinese business industry. 71.7% of Chinese people’s age is ranging from 14 to 64 years. So a huge portion of a large population is productive. As a result labor cost is very cheap here. So every year a huge number of foreign investments are made in this market. Moreover, for varying age structure different new market segments are arising. So opportunities for investing in new product and service sectors are increasing. Classes of population are an important demographic factor in the Chinese business industries. China’s population is consisting of 56 nationalities. Different market segments for different ethnic groups are arising. So the multinational companies that are offering diversified products in this market are having substantial profit margin than any other markets of the world. B. Impact of Economic Factors: Different economic factors are continuously affecting Chinese business industry. 1. Impact of Inflation: Rising inflation has prompted concern Beijing might hike interest rates or take other steps to cool growth that hit 11.9% in the first quarter. That could affect the United States, Europe and others that look to China, the world's No. 3 economy, to help drive demand for their iron ore, factory machinery and other exports. Country Analysis: China 10 A statistics bureau spokesman rejected suggestions China might face "stagflation" — a damaging mix of rising prices and slowing growth. He said inflation pressure was easing and the communist government can hit its target of holding full-year inflation to 3%. Actually there is no problem of stagnation. The economy's "three driving forces" — trade, investment and consumer spending — are still rising. Analysts expect China's rapid expansion to slow as the initial impact of its $586 billion stimulus wane. The World Bank's forecast for full-year growth is 9.5%. Slower growth could complicate efforts to control prices because the standard tool of rate hikes might further chill economic activity. "In the second half of the year, growth is going to be slightly disappointing, inflation is going to be slightly too high," said Tom Orlik, an analyst in Beijing for Stone & McCarthy Research Associates. "That clearly puts the Chinese government in a policy quandary." May exports surged by nearly 50% over a year earlier but analysts expect trade to weaken as Europe's debt crisis cuts demand in the 27nation European Union, China's biggest trading partner. May growth in investment in factories and other fixed assets — seen as an indicator of future growth — slipped from April's 26.1% expansion to 25.9%, the statistics bureau reported. Growth in industrial output declined for a third month, falling to 16.5% from the previous month's 18.8% expansion. Investment growth has been dampened by government curbs aimed at cooling a credit boom and surging housing costs. Regulators also want to block overspending on industries such as steel in which production capacity already exceeds demand. Total lending by Chinese banks in May shrank by 17% from April's level to $93.6 billion, the central bank reported. Financial markets have been rattled by concerns the government might further tighten access to credit. China's main stock index has shed 4% since May 25. Two monthly surveys of industrial activity released earlier showed Chinese manufacturing growth slowing in May on sluggish new orders. Country Analysis: China 11 In a positive sign, growth in retail sales accelerated slightly in May to 18.7% from April's 18.5% rate. 2. Impact of Interest Rates: The standard assumption is that a hike in interest rates is a tightening measure, because when the price of borrowing money rises, demand for it should fall, reining in economic activity. However, as it is seen, in the prevailing interest rate range, both supply and demand for lending in China. There are many borrowers who shop around aggressively for the cheapest interest rate, but at the end of the day, regardless of what interest rate they’ll get, they’re going to take the money. Maybe that might change if the rate increases by 5 or 10%, but 0.25% barely registers., its, Chinese banks drew down on their actual reserves from 21% to around 17%. At the same time, China’s central bank has been raising the RRR to just over 17% for large banks, a bit lower for smaller ones. For the first time the banking system as a whole has run out of excess reserves and is bumping up against its reserve requirement. The Chinese inter-bank lending rate has shot up, and Country Analysis: China 12, some other effects will the interest rate hike have.. As it is mentioned earlier that Chinese borrowers regularly are being willing to pay 20% rates in the informal credit market, people are paying such rates to fund business expansion was during the Dot-Com Bubble, when people were financing start-ups on their credit cards. It’s a good illustration of the boom mentality prevalent in China right now. Country Analysis: China 13 C. Impact of Political/Legal system: China is a communist country and due to communism foreign businesses operating this country are facing some problems. They are exposed to some political risks: • • • • • • Confiscation Risk: It is a process of Government taking ownership without giving any kind of compensation like in case of coke. Chinese government takes the American property after the Chinese communists take place in 1949. As a result foreign investors are not willing to invest here. Operational Risk: here Chinese government constrains the company’s business operation in all areas including operation, marketing and finance. For example direct marketing is not allowed in china. Due to this investors are incurring some losses. Political instability: Due to political instability investors are discouraged to invest in china because when the political situation is unstable in a country; economic situation will also become volatile. As a result investments in different industries are reducing. Social unrest: China is modernizing its economy. It does not fully embrace open economy which is liable to encourage disseminations among the various groups for the sake of its own survival. Co operative society may have to obstruct the dissemination of new idea and neutralize an external group that forces a threat. Policies of host government : In china production of illegal compact disk has greater increased. The factories making counterfeit products are able to operate freely because of their political contacts. As a result the companies which are producing legal disks are losing their motivation to invest in china. Attitude of nations: The product of a multinational company is accepted or not is depend on the attitude of the nation towards the multinational companies. Impact of Tax system: Tax system of china has a great impact on its business industries. As the vat for necessity or utility items is less than the general items, it is facilitating the companies which are generally producing agriculture related products and the daily necessary products. As the custom duty for all products is low in china, it gives benefit to companies to earn good profit, and the companies who are export oriented units the government provides special tax exemption and also provide s.e.z area for the exporting from china which is more attracting the multinational companies and due that the cost of production is very less in china Country Analysis: China 14 In China tariffs for ASEAN countries are very low, which facilitates the MNCs from these countries to invest in china. As a result Chinese business industries as well as economy are becoming more and more wealthy and strong. Intellectual property rights: In china intellectual property right does not exist. In 1984 the Patent Law was enacted but it did not include some important products. As a result, one company’s product can be easily copied by other companies. In china 95% of the computer softwares are pirated. Every year software companies both inside and outside china losing $400 million. D.Impact of Socio-Cultural Environment: Chinese culture is a mix of different subcultures. So people from different subcultures are getting involved in the work force which is increasing the work force diversity. As a result businesses are getting opportunities to introduce new products and equipments for these groups of people. So firms are engaged in continuous innovation. Now a day in Chinese business industries women participation is increasing. So businesses are getting some talented works from these women which were absent previously. Moreover, increased women workforce is increasing the demand of office accessories, equipments, dresses. As a result firms producing these products are making more profits than previously. In China lack of common cultural value is more. As a result firms have to promote their products in different cultures in different ways. They can not use the standardized advertisement in all the cultures which eventually increases their promotion cost and reduces their profit margin. China is a country of huge population and it’s because of its culture. In Chinese culture there is a tradition to keep large families because people think that children will take care of there old parents. As a result population was increasing. Though the rate of population growth decreased, still china has the biggest population of the world. As a result labor cost is very low in this region, which is attracting the foreign investors to invest in china. Eventually it is having a positive impact on the Chinese business industries. E. Impact of Technological factors: Country Analysis: China 15 Production in the industrial development in the Chinese economy grew very rapidly due to technological factors. Technological developments have been considered the keys to continue the research and development in the Chinese economy. This also created new competitive industries and products to join but it also improved the Chinese economy’s infrastructure. The Chinese economy was well aware of the technological developments that needed to be taken up in the earlier years to make their economy more advanced. This new technology that has been coming about to help the Chinese economy replace obsolete technology within the industrial sector has been considered to hold the Chinese economy back some in some areas. Some of the new technology has been imported and was said to help the Chinese economy jump over many generations of technology and move into what we call the more high-tech industry of production. Some technological improvements in the Chinese economy have proven to indicate empirical evidence in the increase in productivity for them. A few of the technological improvements do include the state enterprises, which have shown increase in the pace of R&D efforts and new product development and process innovations. China has continued to benefit from technology transfer and it also has been able to provide their economy with growing technology industries and even a good outlook for more technology development and innovation in the near future for more production. One of the major roles of the Chinese economy industrial production is the use of imported technology. In order for the Chinese economy to close the technology gap and the production levels with the rest of the countries and to develop a high-tech economy, after reform they must consider technology imports vital for the Chinese economy. The Chinese economy’s government continues to increase their investment in industries in order to increase their productivity and product quality. It also continues to improve many other production areas such as the production of raw materials and improving their transportation. The technology developments of the Chinese economy and productive capacity have been enhanced by the benefits of importing large scale technology. There have been a number of industries that have become more competitive because of the improvements in the Chinese economy’s industrial production sector. Most of the improvements have resulted from the imported technology and technology transfer that have led to new emerging industries in China. Actually, the increased amount of imported technology seems to have a greater affect on industry than China’s overall economy. The new technological advancements have led to growth in the export of manufacturing products and this caused more competitive industries and lower production costs. This result of a stronger market export also increases the economic growth of the Chinese economy. The Country Analysis: China 16 economic growth of the industrial development of the Chinese economy is also a very important element. The economic growth of the Chinese economy has tremendously improved over the years, mainly due to the technological changes. Not all of the economic growth is due to technology factors; there is a large amount that is due to strong international demand for its products and heavy government spending. The export manufacturing products has been growing and this is because of the technological advancements in the Chinese economy and industry. This has been shown through the increase of productivity, lower production costs, and other competitive industries. Imported technology is a direct result of the technology advance that was achieved in the Chinese business industries and also the technology promotion efforts was also achieved. The Chinese economy has a relatively small share of technology development of overall economic growth but this new technology has transferred to China and made their industrial development better. It also created new industries and increased the competition for them. Technology in the Chinese businesses has also played a role in the future developments. Some of the new technology that is coming about that will affect the businesses in the Chinese economy are, the pervasive next generation of the Internet, the emergence of smart environments, the postgenomic health space and the emergence of the real-time enterprise. Another huge development that will take place soon for the Chinese economy is the 3G standard that has been developed in China. The Chinese government is welled prepared to have up to four 3G licenses be awarded in the coming year. They are mostly likely to be China Mobile Communications Corp., China Netcom Corp, Ltd., and China Telecommunications Corp. Right now there is no set timetable for the award of the 3G spectrum and the authorities are waiting for nextgeneration technology to become more mature. F. Impact of Global factors: The impact of globalization on China's economic growth is far-reaching. During the past 20 years, China's international trade expanded 16 times, with its ranking in the world bounced to seventh from the original 32"nd., Country Analysis: China 17. Everyone facilitate Country Analysis: China 18 Tenth Five Year Plan clearly demonstrates China's attitude towards economic globalization. The theme of the plan is nullified as that "'In the 21s1 modem. Country Analysis: China 19 Q3. In which industry this country has more opportunity and why? Ans: China has enormous opportunities in many industries but its most of the opportunities lie in the Electronic and Information Technology and IT has now become one of the most important industries in the nation. China has become the world's largest maker of many electronic appliances, such as color TVs, DVDs, & cell phones and the IT products such as computer hardwares and Softwares. China also now has a leading-edge semiconductor industry. This is great for China, since the Asian-Pacific market is projected to grow significantly over the next decade. China registered sales totaling 2.65 trillion yuan (420.4 billion US dollars) in the electronics and information sector last year, a year on year rise of 40 percent. China exported 200 billion US dollars of electronics and information industrial products last year. The competitiveness of China's IT industry depends on whether it has selfindependent core technologies and whether it can set new industrial standard based on its independent core technologies. China has made breakthroughs in CPU designing, third generation mobile telecommunications technology and interlinkage between information products and household electric appliances over the past decade. BPO , namely business process outsourcing, is also known as ITES (Information Technology Enabled Services), including customer management outsourcing, human resources outsourcing, financial process outsourcing, claim management business outsourcing, financial business outsourcing, loan process outsourcing, and the government’s non-core business process outsourcing, etc. is also a part of the Electronics and information Technology industry. Country Analysis: China 20 Despite suffered the impact of the global financial crisis in 2008, backed by its strong domestic market; the whole economy of China still maintains a relatively stable growth. And China's electronic and It industry is still growing at a high speed.edge semiconductor industry, and is the largest PC producer. Entry into the World Trade Organization is leading to economic liberalization, simplification of the licensing and foreign investment policies, and targeted government funding in electronics and IT R&D. China’s Electronic and IT industry has enormous growth potential and advantages, a growing number of global large-scale Electronic and IT companies have targeted China's market, and take entering China market as an important step of their global business development strategy. China’s main advantages in this industry development are as follows: 1. Low Labor Costs: It is well-known that for both providers and buyers, cost is the first element they need to consider, and that is just China’s advantage. Related statistics shows that the average wage of China's software engineers in first-line cities is only around half of the Indian programmers, and less than a quarter of the programmers in the US; and the wage is even lower in other cities like Tianjin. For the companies producing electronic appliances the cost advantage is even more evident. 2. Adequate Human Resources Supply: As the most populous country in the world, after years of education accumulation, China has formed a relatively rich HR storage. According to relevant statistics, from 2001 to 2006, the college graduates number has increased from 1.14 million to 4.13 million and the number would reach at least 6 million in 2009. At the same time, there are some schools and institutions cultivated a large number of personnel urgently needed for the service industry. Take Neusoft Software Park for example, it set up the Neusoft Institute of Information in order to promote the development of BPO business, which focuses on training students in computer and foreign language ability, and the graduates have a very strong practical capability in the BPO business. The above channels have provided sufficient human resources for the BPO industry. Country Analysis: China 21 3. Comprehensive IT Infrastructure: The development of Electronic and IT industry is highly dependent on the urban infrastructure, particularly the IT infrastructure construction, which is an important advantage for China. To resist the adverse effects caused by international financial crisis and avoid the economic fluctuations, the China government determined to invest 4000 billion yuan within two years to boost the economy, and most of the investment will be used for infrastructure construction: including 34 billion for the livelihood project and infrastructure construction in rural areas, 25 billion for railways, highways, airports and other major infrastructure construction, 100 billion for indemnificatory housing projects. At present, 20% of Chinese government’s investment is used for the continuous improving of infrastructure construction like transportation and communication etc. The 2008 World Economic Forum (World Economic Forum) released a report which made an integrated evaluation on the internet infrastructure construction of 127 countries and regions, China ranks 57 (last year, China is 62). 4. Powerful Domestic Market: Domestic market is the unique advantage for China's Electronic and IT industry. China owns huge domestic market and a strong manufacturing base, which forms its biggest core advantage. Modern service industry, especially the modern manufacturing service industry, is derived from manufacturing and based on the manufacturing industry. If there is no powerful manufacturing, there would be no powerful service industry. Thus, along with the unceasing expansion of China's advanced manufacturing industry, the high-end service industries originally located in developed countries also moves to Chinese cities looking for the customer needs. Today, the trend of MNCs setting corporate headquarter in first-line cities of China is a live verification for that. China's advanced manufacturing basis is bound to promote the huge demands of modern service industry. Therefore, the foreign demand plus domestic demand led by the rapid development of China’s economy composed the unique and unparalleled advantage for China’s Electronics and IT industry. 5. Government Support: The Chinese central government is encouraging foreign investment and providing massive incentives in the so-called "pillar industries," which include the electronics and IT Country Analysis: China 22 and IT industry can flourish. Q4. Identify some strategic issues adopted by the government of that country to enhance the business performance. Ans. to enhance the Electronics and Information technology Industry, Chinese government has taken a strong policy which is called ‘Indigenous Innovation policy’. To develop and implement this industry Chinese government has taken further steps. The following part will describe about this policy and the steps taken to implement this policy. Indigenous Innovation Background Indigenous innovation is a policy concept developed by the PRC government to boost the creation and commercialization of proprietary ideas and technologies by Chinese companies. It has been a core component of China’s economic development policy for several years. Central-government planners have often expressed their concern that the country’s economy and production capacity are heavily reliant. In 2006, the central government more formally introduced a policy of promoting indigenous innovation (or self-innovation), whereby government agencies would work cooperatively to develop measures that would favor products that use Chinese-developed ideas and technology. Country Analysis: China 23 Since then, several government agencies at the central and local level have implemented preferential policies, product catalogues, financing schemes, and other tools to ensure that the indigenous innovation policy results in the development of Chinese-owned technology and intellectual property (IP). Indigenous Innovation Policy Development and Implementation Several PRC government agencies are responsible for developing and implementing indigenous innovation. under the State Council. • devise and implement their own policies. Importantly, S&T and innovation are outgrowths of these longterm economic development policies. MOF oversees government procurement and sets procurement criteria for indigenous innovation products the government uses. Procurement is the lifeline of China’s indigenous innovation strategy, because government purchases are a major source of funding for companies engaged in the research and development (R&D) of innovative products. MIIT is built around the core functions of the old Ministry of Information Industry, including regulation of electronics and information product Country Analysis: China 24 • • • manufacturing. It is also responsible for crafting and implementing China’s industrial policies, of which innovation is an essential component. Implementation of indigenous innovation As with all major economic development plans, the central government first crafts broad policy documents that outline the principles for implementing the specific policy. Then, the relevant ministries and commissions—at both the central and local levels—create specific measures that implement the policy based on the principles in the broader documents. At the center of China’s indigenous innovation drive is the Medium- and Long-Term National Plan for Science and Technology Development (200620) and a follow-up document on its supporting policies both released in 2006 by the State Council. The plan and its supporting policies formally introduced the concept of indigenous innovation into China’s national industrial policy and laid out several goals, including • • • Developing a system to evaluate and qualify indigenous innovation products; Establishing a system to use government funds to buy indigenous innovation products; and Giving preferential treatment in the government procurement process to indigenous innovation products. level presents substantial commercial opportunities across a wide range of industry sectors. In addition to granting priority in government procurement, Selected Supporting Policies for the 2006-20 Medium and Long-Term Science and Technology Development Plan (2006) also favor indigenous innovation products in price-based bidding. Article 23 states that during the pricebased bidding process, if the price of an indigenous innovation product is Country Analysis: China 25 higher than others, the company making the product may reduce the price in its bid; if the price is not higher than other products, the government agency must procure the indigenous product. In addition, several articles of the 2007 Evaluation Measures on Indigenous Innovation Products for Government Procurement award indigenous innovation: • • • Article 13 provides that indigenous innovation products shall be given preference at a margin of 5–10 percent in the event that price is the sole determining factor. Article 14 states that indigenous innovation products may enjoy an additional 4 to 8 percent boost in their technical and price evaluations if comprehensive evaluation methods are used. When provincial authorities use comprehensive methods, they weigh technical merit and other technology-related factors alongside the product price to create an overall score, which is used to select the most competitive products. Article 24 calls for establishing a government system for initial purchasing and ordering that will encourage the commercialization of products with indigenous innovation accreditation. The government should purchase the first set of innovative products created by domestic enterprises, universities, and research institutes if the products are thought to have future wide-market potential. The article aims to give such products a stronger foothold in the market. November 2009 circulars lay out rules for new central-level indigenous innovation catalogue NDRC, MOST, and MOF: computers; communication (believed to include mobile phones); office equipment (such as scanners); and software. The remaining two are related to new-energy equipment and energy-efficient products. Foreign company concerns center on Section IV of the application procedures, which reiterates seven conditions, including the patent and trademark restrictions that will likely exclude foreign companies from qualifying their product. The November 15 notice does not appear to include any new requirements, but as the first national catalogue, its impact will likely exceed that of the local catalogues. Country Analysis: China 26 January 2010 draft implementing regulations for PRC Government Procurement Law The State Council’s Legislative Affairs Office (SCLAO) released on January 11 what constitutes a “domestic product” under the 2002 PRC Government Procurement Law, such that a “domestic product” is one “made within China’s borders and for which domestic manufacturing costs exceed a certain percentage of the final prices.” This definition should allow FIE products that pass a local content threshold—which apparently will be equally applied to Chinese-owned companies—to qualify as domestic for the purposes of government procurement, given that FIEs produce in China. Though the draft is silent on the percentage of domestic content required to qualify as domestic, temporary measures released by the Ministry of Finance preferentially procure domestically produced items indigenous innovation is an increasingly important concept in the minds of Chinese policymakers. Country Analysis: China 27 echoes current concerns from foreign companies about recent criteria issued by the PRC government for qualification of indigenous innovation products that effectively exclude FIE participation. Policy and Regulatory Framework Surrounding Indigenous Innovation: The central government has released various policies and regulatory measures to implement its indigenous innovation policy. Below is a list of some of these regulatory measures. PRC Government Procurement Law (2002) This law establishes the foundation for government procurement, noting that PRC government agencies should purchase domestic goods and services unless the required items cannot be obtained within China or under “reasonable commercial circumstances.” The law applies to all purchases made by central-, provincial-, and local-government agencies. Medium- and Long-term National Plan for Science and Technology Development (2006-20) This plan introduces the concept of indigenous innovation into China’s national industrial policy and lays out key principles that government agencies should follow when implementing indigenous innovation. Selected Supporting Policies for the 2006-20 Medium and Long Term Science and Technology Development Plan (2006) Country Analysis: China 28 These policies further detail how the principles of indigenous innovation should be implemented and entrusts MOF and other agencies with setting the standards for what will be considered a domestic product. Trial Measures for the Administration of the Accreditation of National Indigenous Innovation Products (2006) These measures set up the specific certification criteria for evaluating and certifying indigenous innovation products, including ownership of core intellectual property and trademarks by the applying China-based company. Evaluation Measures on Indigenous Innovative Products for Government Procurement (2007) These measures lay out the advantages that accredited products enjoy in the government procurement process, including price deduction and extra consideration in technology and quality evaluations. Administrative Measures for the Government to Initially and Selectively Purchase Indigenous Innovation Products (2007) These measures require government agencies to make initial purchases of newly developed products by domestic companies that are not currently competitive in the marketplace. Products are designated in the Catalogue of Indigenous Innovation Products, and government agencies are required to purchase those products, which will eventually be used in governmentfunded investment projects. Notification Regarding the Launch of National Indigenous Innovation Product Accreditation Work for 2009 This notification details to relevant authorities the application and review process for products applying for indigenous innovation status. Q5. Top five countries on which China has greatest impact. We can rank the top five countries on which china has greatest impact on the basis of its export to and import from those countries. Export and Country Analysis: China 29 import is mean through which a country can influence other country’s economy. The following tables list the name of the five countries where China exports mostly, from where China imports mostly and its top five trade partners. China's Top Import Suppliers 2009 ($ billion) Country / region Japan South Korea Taiwan United States Germany Volume 130.9 102.6 85.7 77.4 55.8 % change over 2008 -13.1 -8.5 -17.0 -4.8 0.0 China's Top Export Destinations 2009 ($ billion) Country/region United States Hong Kong Japan South Korea Germany Volume 220.8 166.2 97.9 53.7 49.9 % change over 2008 -12.5 -12.8 -15.7 -27.4 -15.7 China's Top Trade Partners 2009 ($ billion) Country/region United States Japan Hong Kong South Korea Taiwan Volume 298.3 228.9 174.9 156.2 106.2 Export 220.8 97.9 166.2 53.7 20.5 Import 77.5 131 8.7 102.5 85.7 From the above tables it is clear that china mostly imports from Japan, South Korea, Taiwan, United States and Germany, and exports to United States, Japan, Hong Kong, South Korea and Germany. If we want rank the countries to which china is mostly influential we have to consider the exports and imports cumulatively. In that case China’s top five trading partners are United States, Japan, Hong Kong, South Korea and Taiwan. Country Analysis: China 30 If China stops or reduces it’s trading with any one of these countries, that country will be economically hampered. If china stops importing from that country, it will lose its one of the biggest market of the world and if China stops exporting to that country, there will be a lack of supply of that product. So all the five countries’ economy will be tremendously affected, if China stops trading with these countries. Country Analysis: China 31
https://www.scribd.com/document/106829157/Analyze-the-external-environment-of-the-China
CC-MAIN-2018-39
en
refinedweb
An Intro to Virtual Proxies, Part 1 One of the most appealing facets of Polymorphism is that it is applicable in a wide variety of situations. Moreover, while the ability to switch out concrete implementations is in and of itself a fundamental object-oriented pillar, commonly used for creating loosely-coupled, interchangeable components, its usage falls shy when it comes to pulling on the reins of domain objects. There’s a somewhat fragile rationale that stands behind this observation: in many cases, domain objects are conceptually modelled up front to operate on concrete sets of data and inside the boundaries of strict relationships which most likely won’t change over time, and where most of the varying business logic is placed in hierarchies of standalone strategy classes (here’s where actual Polymorphism takes place). In such cases, certainly there’s not much room or even compelling reasons to justify having different implementations of domain objects at runtime except for mocking/testing. Furthermore, very few will disagree that programming to interfaces is a bad thing, but isn’t it overkill to have one per domain object? After all, a user object will always be modelled with a few typical roles in mind, and if its login() method ever needs to be updated, well… it’ll just be refactored accordingly and the client code won’t complain so long as the mutual contract is maintained. At a glance, it seems that having a whole new user implementation not only isn’t very pragmatic, but it’s simply absurd. A common pitfall with this approach is made apparent when it’s necessary to pull in an aggregate (a domain object made up of other objects or collections) from the database. As each reference to the aggregate implies dealing face to face with the real domain objects, the process unavoidably ends up dropping the entire object graph into the client. It’s not exactly a solution to praise with fervency, even if the objects can be cached later on. As usual, simple solutions are the most effective ones, and this applies to the above problem. Rather than fetching the real fat aggregate, if a lightweight substitute is used instead which shares the same interface and knows how to get the aggregate in question from storage then lazy-loading the underlying objects becomes a straightforward process.. Considering the functionality of proxies can be easily accommodated to coordinate either with single domain objects or with collections of them (or both), in the first part of this two-part series I’ll be showcasing the former user case, while in the second installment I’ll dig deeper into the complexities of the latter. So, let’s now move along and get things finally rolling with virtual proxies. Setting Up a Domain Model As I pointed out in the introduction, proxies are simple -yet powerful- structures that allow you to pull in requested domain objects from underlying storage. But as one might expect, it would first be warranted to create a simple Domain Model so at least one of its building objects can be interfaced to a proxy. The fist domain class I’ll add to the sample model will be one that represents blog posts. The class, along with its segregated interface, look like this: <?php namespace Model; interface PostInterface { public function setId($id); public function getId(); public function setTitle($title); public function getTitle(); public function setContent($content); public function getContent(); public function setAuthor(AuthorInterface $author); public function getAuthor(); } <?php namespace Model; class Post implements PostInterface { protected $id; protected $title; protected $content; protected $author; public function __construct($title, $content, AuthorInterface $author) { $this->setTitle($title); $this->setContent($content); $this->setAuthor($author); }Author(AuthorInterface $author) { $this->author = $author; return $this; } public function getAuthor() { return $this->author; } } The behavior of the Post class is trivial as it just implements a few mutators/accessors with some basic filtering/validation. Notice, however, that the class injects an author’s implementation in the constructor, that way setting a one-to-one relationship with the corresponding author. To get the domain model up and running, the author in question must be modeled as well. Here’s the related class, along with its contract: <?php namespace Model; interface AuthorInterface { public function setId($id); public function getId(); public function setName($name); public function getName(); public function setEmail($email); public function getEmail(); } <?php namespace Model; class Author implements AuthorInterface { protected $id; protected $name; protected $email; public function __construct($name, $email) { $this->setName($name); $this->setEmail($email); } public function setId($id) { if ($this->id !== null) { throw new BadMethodCallException( "The ID for this author has been set already."); } if (!is_int($id) || $id < 1) { throw new InvalidArgumentException( "The author ID is invalid."); } $this->id = $id; return $this; } public function getId() { return $this->id; } public function setName($name) { if (strlen($name) < 2 || strlen($name) > 30) { throw new InvalidArgumentException( "The name of the author is invalid."); } $this->name = htmlspecialchars(trim($name), ENT_QUOTES); return $this; } public function getName() { return $this->name; } public function setEmail($email) { if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { throw new InvalidArgumentException( "The email of the author is invalid."); } $this->email = $email; return $this; } public function getEmail() { return $this->email; } } The same that I just said about the Post class applies to its collaborator, Author. There subtle detail worth stressing here is this: if the domain model were put to roll down the road right now, then any post object pulled in from the database would get an author object eagerly attached to it, something that fully honors its condition of aggregate. While this is all well and fine since authors aren’t expensive to set per se, there might be times when they could be loaded only on request. If this happens, all the last-minute retrieval logic should be placed outside the domain objects’ confines, but at the same time controlled by an object that understands the model. There’s no need to sink in the waters of anguish here, as this apparently-complex condition has a dead simple solution: if an author proxy is used instead of a real author, then it’s feasible to lazy-load the latter without spoiling the contract with client code since the proxy exposes the same API. This itself proves Polymorphism is hard to knock when it comes to swapping out domain object implementations in order to optimize your database persistence/retrieval strategy. Curiosity is a pretty itching bug indeed, so let’s satisfy our own one and see how to create the above mentioned author proxy. Considering the proxy should be able to fetch author objects from the database, a neat way to do so would be through the API of a data mapper. In this particular case, the one shown below will get the job done nicely: <?php namespace ModelMapper; interface AuthorMapperInterface { public function fetchById($id); } <?php namespace ModelMapper; use LibraryDatabaseDatabaseAdapterInterface, ModelAuthor; class AuthorMapper implements AuthorMapperInterface { protected $entityTable = "authors"; public function __construct(DatabaseAdapterInterface $adapter) { $this->adapter = $adapter; } public function fetchById($id) { $this->adapter->select($this->entityTable, array("id" => $id)); if (!$row = $this->adapter->fetch()) { return null; } return new Author($row["name"], $row["email"]); } } So far, so good. With the user mapper already in place, it’s time to tackle the creation of the author proxy. As stated before, it shares the same interface with the one implemented by real authors, and its core implementation is as follows: <?php namespace ModelProxy; use ModelMapperAuthorMapperInterface, ModelAuthorInterface; class AuthorProxy implements AuthorInterface { protected $author; protected $authorId; protected $authorMapper; public function __construct($authorId, AuthorMapperInterface $authorMapper) { $this->authorId = $authorId; $this->authorMapper = $authorMapper; } public function setId($id) { $this->authorId = $id; return $this; } public function getId() { return $this->authorId; } public function setName($name) { $this->loadAuthor(); $this->author->setName($name); return $this; } public function getName() { $this->loadAuthor(); return $this->author->getName(); } public function setEmail($email) { $this->loadAuthor(); $this->author->setEmail($email); return $this; } public function getEmail() { $this->loadAuthor(); return $this->author->getEmail(); } protected function loadAuthor() { if ($this->author === null) { if(!$this->author = $this->authorMapper->fetchById($this->authorId)) { throw new UnexpectedValueException( "Unable to fetch the author."); } } return $this->author; } } At a quick glance the AuthorProxy class looks like a cheap and dirty duplicate of Author with little or no extra functionality, but I assure you this is nothing but a shallow impression. When analyzed it shows the logic that stands behind a virtual proxy in a nutshell. The loadAuthor() method is the proxy’s actual workhorse, as its responsibility is to fetch from the database once, and only once, an author object is injected into the constructor. The batch of additional methods are just wrappers for the author’ setters/getters. All in all it should be clear that constructing a proxy class that transparently handles a few domain objects behind the scenes is a lot more approachable than one might think. Even so, the best way for catching up the proxy’s real strength is by example. Let’s suppose we need to build an application that fetches a few popular quotes from a database and then dumps them to screen along with their corresponding author. In a simple implementation, the application would look pretty much like this: <?php use LibraryLoaderAutoloader, LibraryDatabasePdoAdapter, ModelMapperAuthorMapper, ModelProxyAuthorProxy, ModelAuthor, ModelPost; require_once __DIR__ . "/Library/Loader/Autoloader.php"; $autoloader = new Autoloader; $autoloader->register(); $adapter = new PdoAdapter("mysql:dbname=mydatabase", "dbuser", "dbpassword"); $authorMapper = new AuthorMapper($adapter); $author = $authorMapper->fetchById(1); $post = new Post( "About Men", "Men are born ignorant, not stupid; they are made stupid by education.", $author); echo $post->getTitle() . $post->getContent() . " Quote from: " . $post->getAuthor()->getName(); Even when the quotes’ mapper has been excluded for the sake of brevity, the code’s flow is still pretty easy to understand: it pulls in the first author object (a reference to Bertrand Russell) from the database which gets injected into the quote object. Here the author has been eagerly fetched from the storage before having any chances to process it, which isn’t a cardinal sin by the way. The purist madman living inside our heads can’t just be tossed aside so easily, though, and keeps murmuring how the author would be better off lazy-loaded. In such a case, we could switch over the proxy instead, and drop it into the application, as follows: <?php $author = new AuthorProxy(1, new AuthorMapper($adapter)); $post = new Post( "About Men", "Men are born ignorant, not stupid; they are made stupid by education.", $author); echo $post->getTitle() . $post->getContent() . " Quote from: " . $post->getAuthor()->getName(); If you take a close look at the line responsible for creating the post object, you’ll notice that it remains exactly the same as the one from before even though it now takes the proxy and lazy-loads the author from the database. Asides from illustrating how to make use of virtual proxies in a common use case, the example here shows how to keep things copesetic with client code as well. It sticks to the Open/Closed principle and relies entirely on a few segregated interfaces rather than on concrete implementations. To sum things up: if you’re still wondering if Polymorphism has a place when it comes to creating domain objects that can be swapped up at runtime by virtual proxies (or something along that line), then rest assured it can help you build up scalable, future-proof domain models. Closing Thoughts Virtual proxies come in a wide variety of flavors and forms, hence there’s no shortage of options when it comes to exploiting their functionality right out of the box. In many cases, they’re used as placeholders for actual domain objects that are rather expensive to create ahead in time, which makes it possible to load them transparently on request from the persistence layer without poisoning your client code with harmful conditionals. In the earlier example, a basic proxy was utilized for fetching a simple aggregate from a database, something hopefully instructive in the end, but not entirely in line with the real world. In more realistic situations, domain models are usually much fatter than that and are generally plagued by itteratable collections of domain objects. Not surprisingly, virtual proxies can be implemented for interplaying with collections as well without much fuss. So, in the next part I’ll show you how to create a collection-targeted proxy class so you can see for yourself if it fits your needs. Image via imredesiuk / Shutterstock
https://www.sitepoint.com/intro-to-virtual-proxies-1/
CC-MAIN-2018-39
en
refinedweb
%matplotlib inline import numpy as np import matplotlib.pyplot as plt from IPython.display import display from IPython.parallel import Client, error cluster = Client(profile="mpi") view = cluster[:] view.block = True cluster.ids [0, 1, 2, 3] Now, we load the MPI libraries into the engine namespaces, and do a simple printing of their MPI rank information to verify that all nodes are operational and they match our cluster's real capacity. Here, we are making use of IPython's special %%px cell magic, which marks the entire cell for parallel execution. This means that the code below will not run in this notebook's kernel, but instead will be sent to all engines for execution there. In this way, IPython makes it very natural to control your entire cluster from within the notebook environment: %%px # MPI initialization, library imports and sanity checks on all engines from mpi4py import MPI import numpy as np import time mpi = MPI.COMM_WORLD bcast = mpi.bcast barrier = mpi.barrier rank = mpi.rank print("MPI rank: %i/%i" % (mpi.rank,mpi.size)) [stdout:0] MPI rank: 3/4 [stdout:1] MPI rank: 2/4 [stdout:2] MPI rank: 0/4 [stdout:3] MPI rank: 1/4 We write a utility that reorders a list according to the mpi ranks of the engines, since all gather operations will return data in engine id order, not in MPI rank order. We'll need this later on when we want to reassemble in IPython data structures coming from all the engines: IPython will collect the data ordered by engine ID, but our code creates data structures based on MPI rank, so we need to map from one indexing scheme to the other. This simple function does the job: ranks = view['rank'] rank_indices = np.argsort(ranks) def mpi_order(seq): """Return elements of a sequence ordered by MPI rank. The input sequence is assumed to be ordered by engine ID.""" return [seq[x] for x in rank_indices] This is our 'simulation', a toy example that computes $\sin(f(x^2+y^2))$ for a slowly increasing frequency $f$ over a gradually refined mesh. In a real-world example, there typically is a 'simulate' method that, afer setting up initial parameters, runs the entire computation. But having this simple example will be sufficient to see something that changes visually as the computation evolves and that is quick enough for us to test. And while simple, this example has a realistic decomposition of the spatial domain in one array per MPI node that requires care in reordering the data for visualization, as would be needed in a real-world application (unless your code accumulates data in the rank 0 node that you can grab directly). %%px stop = False nsteps = 100 delay = 0.1 xmin, xmax = 0, np.pi ymin, ymax = 0, 2*np.pi dy = (ymax-ymin)/mpi.size def simulation(): """Toy simulation code, computes sin(f*(x**2+y**2)) for a slowly increasing f over an increasingly fine mesh. The purpose of this code is simply to illustrate the basic features of a typical MPI code: spatial domain decomposition, a solution which is evolving in some sense, and local per-node computation. In this case the nodes don't really communicate at all. """ # By making these few variables global, we allow the IPython client to access them # remotely for interactive introspection global j, Z, nx, nyt freqs = np.linspace(0.6, 1, nsteps) for j in range(nsteps): nx, ny = 2+j/4, 2+j/2/mpi.size nyt = mpi.size*ny Xax = np.linspace(xmin, xmax, nx) Yax = np.linspace(ymin+rank*dy, ymin+(rank+1)*dy, ny, endpoint=rank==mpi.size) X, Y = np.meshgrid(Xax, Yax) f = freqs[j] Z = np.cos(f*(X**2 + Y**2)) # We add a small delay to simulate that a real-world computation # would take much longer, and we ensure all nodes are synchronized time.sleep(delay) # The stop flag can be set remotely via IPython, allowing the simulation to be # cleanly stopped from the outside if stop: break We now define a local (to this notebook) plotting function that fetches data from the engines' global namespace. Once it has retrieved the current state of the relevant variables, it produces and returns a figure: from IPython.display import clear_output def plot_current_results(in_place=True): """Makes a blocking call to retrieve remote data and displays the solution mesh as a contour plot. Parameters ---------- in_place : bool By default it calls clear_output so that new plots replace old ones. Set to False to allow keeping of all previous outputs. """ # We make a blocking call to load the remote data from the simulation into simple named # variables we can read from the engine namespaces #view.apply_sync(load_simulation_globals) # And now we can use the view to read these variables from all the engines. Then we # concatenate all of them into single arrays for local plotting try: Z = np.concatenate(mpi_order(view['Z'])) except ValueError: print("dimension mismatch in Z, not plotting") ax = plt.gca() return ax.figure nx, nyt, j, nsteps = view.pull(['nx', 'nyt', 'j', 'nsteps'], targets=0) fig, ax = plt.subplots() ax.contourf(Z) ax.set_title('Mesh: %i x %i, step %i/%i' % (nx, nyt, j+1, nsteps)) plt.axis('off') # We clear the notebook output before plotting this if in-place plot updating is requested if in_place: clear_output(wait=True) display(fig) return fig It will also be useful to be able to check whether the simulation is still alive or not. Below we will wrap the main simulation function into a thread to allow IPython to pull data from the engines, and we will call this object simulation_thread. So to check whether the code is still running, all we have to do is call the is_alive method on all of our engines and see whether any of them returns True: def simulation_alive(): """Return True if the simulation thread is still running on any engine. """ return any(view.apply_sync(lambda : simulation_thread.is_alive())) Finally, this is a convenience wrapper around the plotting code so that we can interrupt monitoring at any point, and that will provide basic timing information: def monitor_simulation(refresh=5.0, plots_in_place=True): """Monitor the simulation progress and call plotting routine. Supress KeyboardInterrupt exception if interrupted, ensure that the last figure is always displayed and provide basic timing and simulation status. Parameters ---------- refresh : float Refresh interval between calls to retrieve and plot data. The default is 5s, adjust depending on the desired refresh rate, but be aware that very short intervals will start having a significant impact. plots_in_place : bool If true, every new figure replaces the last one, producing a (slow) animation effect in the notebook. If false, all frames are plotted in sequence and appended in the output area. """ import datetime as dt, time if not simulation_alive(): plot_current_results(in_place=plots_in_place) plt.close('all') print('Simulation has already finished, no monitoring to do.') return t0 = dt.datetime.now() fig = None try: while simulation_alive(): fig = plot_current_results(in_place=plots_in_place) plt.close('all') # prevent re-plot of old figures time.sleep(refresh) # so we don't hammer the server too fast except (KeyboardInterrupt, error.TimeoutError): msg = 'Monitoring interrupted, simulation is ongoing!' else: msg = 'Simulation completed!' tmon = dt.datetime.now() - t0 if plots_in_place and fig is not None: clear_output(wait=True) plt.close('all') display(fig) print(msg) print('Monitored for: %s.' % tmon) %%px from threading import Thread stop = False nsteps = 100 delay=0.5 # Create a thread wrapper for the simulation. The target must be an argument-less # function so we wrap the call to 'simulation' in a simple lambda: simulation_thread = Thread(target = lambda : simulation()) # Now we actually start the simulation simulation_thread.start() monitor_simulation(refresh=1); Simulation completed! Monitored for: 0:00:50.653178. If you execute the following cell before the MPI code is finished running, it will stop the simulation at that point, which you can verify by calling the monitoring again: view['stop'] = True %%px --target 0 from IPython.parallel import bind_kernel; bind_kernel() %connect_info { "stdin_port": 65310, "ip": "127.0.0.1", "control_port": 58188, "hb_port": 58187, "key": "e4f5cda8-faa8-48d3-a62c-dbde67db9827", "shell_port": 65083, "transport": "tcp", "iopub_port": 54934 } Paste the above JSON into a file, and connect with: $> ipython <app> --existing <file> or, if you are local, you can connect with just: $> ipython <app> --existing kernel-64604.json or even just: $> ipython <app> --existing if this is the most recent IPython session you have started. %%px --target 0 %qtconsole
https://nbviewer.jupyter.org/github/ipython/ipython/blob/2.x/examples/Parallel%20Computing/Monitoring%20an%20MPI%20Simulation%20-%201.ipynb
CC-MAIN-2018-39
en
refinedweb
an part 1 I describe how to set up a Flask service on an AWS EC2 instance. In this post I'll set up the server to respond to queries against a SQL database. Source code for a basic Flask app Creating a database 1. The data We'll use sqlite3 to provide an interface from python to SQL. For this example we'll create a simple database of national parks, the data is here, originally from wikipedia. A look at the data: $ head nationalparks.csv Name,Location,Year Established,Area Acadia National Park,Maine,1919,48876.58 National Park of American Samoa,American Samoa,1988,8256.67 Arches National Park,Utah,1971,76678.98 Badlands National Park,South Dakota,1978,242755.94 2. Creating the database This script populates a database with the data from the file: import csv import sqlite3 conn = sqlite3.connect('natlpark.db') cur = conn.cursor() cur.execute("""DROP TABLE IF EXISTS natlpark""") cur.execute("""CREATE TABLE natlpark (name text, state text, year integer, area float)""") with open('nationalparks.csv', 'r') as f: reader = csv.reader(f.readlines()[1:]) # exclude header line cur.executemany("""INSERT INTO natlpark VALUES (?,?,?,?)""", (row for row in reader)) conn.commit() conn.close() 3. Accessing the database from Flask Add the following lines to flaskapp.py (see part 1). This code handles managing connections to the database and provides a convenient query method. import csv import sqlite3 from flask import Flask, request, g DATABASE = '/var/www/html/flaskapp/natlpark.db' app.config.from_object(__name__) def connect_to_database(): return sqlite3.connect(app.config['DATABASE']) def get_db(): db = getattr(g, 'db', None) if db is None: db = g.db = connect_to_database() return db @app.teardown_appcontext def close_connection(exception): db = getattr(g, 'db', None) if db is not None: db.close() def execute_query(query, args=()): cur = get_db().execute(query, args) rows = cur.fetchall() cur.close() return rows 4. Add a request handler to show the database Add the following to flaskapp.py and restart the server ( sudo apachectl restart). Pointing a browser at (your public DNS)/viewdb should show the entire database. @app.route("/viewdb") def viewdb(): rows = execute_query("""SELECT * FROM natlpark""") return '<br>'.join(str(row) for row in rows) 5. Add a query url request handler To allow for queries on state, add the following to flaskapp.py and restart the server ( sudo apachectl restart). Pointing a browser at (your public DNS)/state/{state-name} will return a list of all national parks in that state. @app.route("/state/<state>") def sortby(state): rows = execute_query("""SELECT * FROM natlpark WHERE state = ?""", [state.title()]) return '<br>'.join(str(row) for row in rows) 6. Note on cross site requests Later in this series we'll want to query our app from a D3.js graph served from another site. To instruct our Flask server to respond to these requests add the following line to the /etc/apache2/sites-enabled/000-default.conf, right under <Directory flaskapp>: Header set Access-Control-Allow-Origin "*" Your apache config should now have a block that looks like this: <Directory flaskapp> Header set Access-Control-Allow-Origin "*" WSGIProcessGroup flaskapp WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> - A dynamic D3.js graph powered by Flask and SQL on EC2, Score: 0.997 - Running a Flask app on AWS EC2, Score: 0.997 - Getting csv data from requests to a SQL backed Flask app, Score: 0.992 - A D3.js plot powered by a SQL database, Score: 0.984 - Saving time and space by working with gzip and bzip2 compressed files in python, Score: 0.786
https://www.datasciencebytes.com/bytes/2015/02/28/using-flask-to-answer-sql-queries/
CC-MAIN-2018-39
en
refinedweb
(V.2.1, undocumented prior to V.2.1.3) IPCName, defaulting to FIREBIRD since V.2.0, is the kernel namespace where the XNET instance for direct local connection on Windows is created. On Vista and some other Windows platforms, it was usually necessary to edit this parameter to add the prefix “Global\” in order to ensure that the local client running under a restricted account would have the authority to create this namespace. A change in V.2.1 made it so that the connection routine would apply the prefix to the default IpcName unconditionally if the user's first attempt failed due to restricted permissions.
http://www.firebirdsql.org/file/documentation/release_notes/html/rnfb21x-fbconf-ipcname.html
CC-MAIN-2018-39
en
refinedweb
If: - Make sure SCOM 2007 Reporting is installed. - Copy MicrosoftRSChart.dll and MicrosoftRSChartDesigner.dll from SSRS bin directory to Visual Studio private assemblies directory on your development machine. Location of SSRS bin directory depends on the way you install SQL Sever but usually the path looks like this: \Program Files\Microsoft SQL Server\MSSQL.N\Reporting Services\ReportServer\bin Visual Studio private assemblies directory usually could be found under \Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies - Find RSReportDesigner.config file in the Visual Studio private assemblies directory and add the following records to> - Restart Visual Studio. Please note that these steps will only work with SCOM 2007 SP1 RC or later releases. The files mentioned here were not a part of SCOM 2007 RTM. Hi Eugene, firstly – great blog thanks for all the info. My specific question is I have followed the steps above and have downloaded the availability report locally. After copying down "Microsoft.EnterpriseManagement.Reporting.Security.dll" and "Microsoft.EnterpriseManagement.Reporting.Code.dll" in addition to the DLLs listed my report starts up but I do not see the RPB, only a series of input boxes. Is this expected behaviour? Is there anyway of having these present as they do in the operations manager console? Cheers Sean I should note that I have also modified the report.config file. Cheers Sean Hi Sean, Unfortunately the Smart Parameter block is currently only works in SCOM Windows console. You cannot use it in VS report preview window. The best report development technique I would suggest is publishing report from VS directly to SCOM SSRS instance and opening it is SCOM console for preview or "debugging". This is actually the technique we use for our reports development. Eugene. Can I work with SQL reporting services 2005 and still use the chart controls? Yes. Enterprise Management Chart Control is designed for SQL Server Reporting Services 2005. Hi Eugene, Thanks for your response. I copied the dll’s and modified the config file as mentioned in your article. However, I do not see the chart control in the tool box. Am I missing a step. Thanks again. KBS You would need to restart Visual Studio after you did all the configuration. If "Microsoft Enterprise Management Chart" is not appearing under VS Toolbox "Report Items" you can add it via Choose Toolbox Items dialog ("Choose Items…" context menu). Just select "Microsoft Enterprise Management Chart" under ".NET Framework Components" tab. Thanks Eugene for your response. I did restart Visual studio after the configuration changes. But I am still not able to select the Ent Chart Control. The obly chart control I see is "Chart" with namespace "Dundas.Charting.WebContol" and assembly name as "MicrosoftRSChart(2.0.0.151). This is already selected. However in the tool box it shows as greyed out. Here is what I have Visual Studio 2005 on a xp service pack 3 machine SQL Reporting services 2005 with SCOM 2007 R2 from where I copied the dll’s. I would appreciate any help!! Thanks KBS Eugene, I did want to update you with status. I am able to add the M Chart Control to a .net web app. However, I am unable to add the chart control to a reporting services project using Visual Studio 2005 and SSRS 2005. I followed all the steps mentioned above but still have the issue – unable to add the chart control to the tool box for a SSRS report application thanks KBS
https://blogs.msdn.microsoft.com/eugenebykov/2007/11/20/enabling-enterprisemanagementchartcontrol-in-visual-studio-2005/
CC-MAIN-2018-39
en
refinedweb
JQuery :: Get Video Path During Drag And Drop?Dec 23, 2010 I want to perform drag and drop operation on video file ,in which i want to make video carosual for all video and drag the video to the main player and play on main player.View 2 Replies I want to perform drag and drop operation on video file ,in which i want to make video carosual for all video and drag the video to the main player and play on main player.View].... My scenario is to drag an item from a repeater/datalist to another repeater(preview repeater). The preview repeater already contains some icons in some positon(for eg. in 1st and 4th items). I need to insert the icon to empty positions(2nd, 3rd and 5th items) in preview repeater.View 4 Replies I hav two listboxes, how can i drag and drop between these two using jqueryView 4 Replies. his function takes an li element and adds it to another ul element. After this code is fired the jquery events attached to the children spans of the li element do not fire the first time they are clicked.View 2 Replies I want to make content switch say there are 3 items.. Item 1, Item2, Item3 in datalist and if i drag Item 1 to item 3, the content will interchange..."item 3" will go to "item 1" and "item 1" to "item 3" What code do i write in drop function. Here is my code. Is this even possible? Default.aspx <link href="" rel="stylesheet" type="text/css"/> <script src=""></script> <script src=""></script>[code].... implementing a drag and drop feature into my website. I was wondering if anyone has any good examples on how this can be done?View 3 Replies I need to develope interface something like IGoogle with drag and drop of boxes in ASP.Net 2.0. The interface should support cross browser compatibility.View 1 Replies I would like to ask we select a file in our system and drag that file into browser, drop that file into particular location of the browser at that time the file is to upload.View 4 Replies We have an asp.net treeview control and a texarea. The childnodes of treeview need to be draggable and can be dropped into txtarea.View 2 Replies I need to change the cell postions of the gridview via drag and drop.View 1 Replies] .... I have a linkbutton whose onclick method does not fire after a jquery drag and drop, the onlclientclick does work. Y would the server side code not work only after a jquery drag and drop?View 4 Replies I wanna save the order of my list to the sql server database in jquery drag & drop using asp.net c#. How can I do this?View 1 Replies I have 2two gridview .If i have load same data from two gridvie after that i drap and drop one ID one grid to another grid that time ID same means it will show alert match or it will show not match alert using jquery.View 1 Replies When I Drag and Drop the gridview row record then update preference will be enable the Button(update preference). Otherwise it will be disable.. Please refer this link: [URL] .... I want to implement some drag and drop behaviors in my ASP.NET app. Could someone point me in the right direction for some articles and samples? For example, one example of drag and drop I want to implement is for sorting things.View 4 Replies I currently have two listboxes and I use arrow buttons to move items from one list to another. Is there a way I could implement drag and dropping between those 2 listboxes.View 3 Replies i've built a WPF application with two listBoxes.I managed to drag and drop elements from one listbox to the other, but it always gets added to the end/buttom of the second listbox.How can i drag and drop the element and place it in the other listbox, but where i want it to be, where the cursor is located/ponits and not in the end (as the last element).View 1 Replies In WPF I have a textBox . I need to drag and drop textfiles ie in notepad from desk top to textbox of wpf. I managed to get the contents of notepad to textbox. But I need file path to be in browser so that I can transfer files from client to client. I need the file path instead. privatevoid textBox1_PreviewDragEnter(object sender, DragEventArgse) { bool isCorrect = true; if (e.Data.GetDataPresent(DataFormats.FileDrop, true) == true ) { string[] filenames = (string[])e.Data.GetData(DataFormats.FileDrop, true ); [Code] .... Anyone who can give me a tip on articles explaining how I can implement a drag n drop functionality between two asp controls? I'm using Asp.net 3.5.View 1 Replies I cannot get the Drag and Drop functionality of Web Parts is to work. I have a very simple test page with two WebPartZones.. In the OnInit method of the code behind I put the page in design mode. In the first zone I have a textbox.At runtime the text box renders as a web part. When I hover over the web part header my mouse pointer changes the 'move' pointer, but I cannot drag the item. I do not see it dragging and the part never moved. I am using Visual Studio 2010 with IE 8. I have tried IE8 in compatibility mode and regular mode. The results are the same. Here is the markup from my test page: <form id="form1" runat="server"> <div> <asp:WebPartManager </asp:WebPartManager> <asp:WebPartZone <ZoneTemplate> <asp:TextBox </ZoneTemplate> </asp:WebPartZone> aa <asp:WebPartZone </asp:WebPartZone> aa <asp:EditorZone </asp:EditorZone> </div> </form> Here is the code behind: protected override void OnInit(EventArgs e) { base.OnInit(e); WebPartManager mgr = WebPartManager.GetCurrentWebPartManager(this); mgr.DisplayMode = WebPartManager.DesignDisplayMode; } What am I missing? I have to generate an organization chart, in my asp.net application and it should supports drag and drop feature to update the linkage between organization structure. What would be the best way to deal with it, (jQuery or silver light or .net chart controls). My primary needs is to support drag and drop.View 4 Replies I have a listview showing images like ImageViewer and I want to implement Drag-Drop behavior within ListView. how can i achieve the Srag-Drop inside the below kind of customized ListView. <asp:ListView <LayoutTemplate> <table id="groupPlaceholderContainer" runat="server" border="1"> <tr id="groupPlaceholder" runat="server"> </tr> </table> </LayoutTemplate> <ItemTemplate> <td id="Td4" align="center" style="background-color: #eeeeee;"> <asp:Image <br /> <asp:Label </td> </ItemTemplate> <GroupTemplate> <tr id="itemPlaceholderContainer" runat="server"> <td id="itemPlaceholder" runat="server"> </td> </tr> </GroupTemplate> <InsertItemTemplate> <td id="Td3" width="150px" height="150px" runat="server" align="center" style="background-color: #e8e8e8; color: #333333;"> <asp:FileUpload </td> </InsertItemTemplate> </asp:ListView> Code Behind: public class ImageEntity { public string PhotoName { get; set; } public int PhotoIndex { get; set; } public string PhotoURL { get; set; } } public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { IList<ImageEntity> imagesList = new List<ImageEntity>() { new ImageEntity(){ PhotoName="House1", PhotoIndex=1, PhotoURL= @"ImagesHouse-01.JPG" }, new ImageEntity(){ PhotoName="House2", PhotoIndex=2, PhotoURL= @"ImagesHouse-05.JPG" }, new ImageEntity(){ PhotoName="House3", PhotoIndex=3, PhotoURL= @"Imageshouse.jpg" }, new ImageEntity(){ PhotoName="House4", PhotoIndex=4, PhotoURL= @"Imageshouse2.jpg" } }; lvPhotoViewer.DataSource = imagesList; lvPhotoViewer.DataBind(); } }
http://asp.net.bigresource.com/JQuery-Get-Video-Path-during-drag-and-drop--RZwDdPvWA.html
CC-MAIN-2018-39
en
refinedweb
Problem You need to choose the best place to store connection strings that you need in your application to increase maintainability, simplify future modifications, and eliminate the need to recompile the application when it is modified. Solution There are several alternatives for storing connection strings, including hard-coding the connection string in your application, storing it in an application configuration file or the Windows Registry, representing it using a Universal Data Link (UDL) file, or in a custom file. Discussion A connection string is made up of a semi- colon delimited collection of attribute/value pairs that define how to connect a data source. Although connection strings tend to look similar, the available and required attributes are different depending on the data provider and on the underlying data source. There are a variety of options providing differing degrees of flexibility and security. Connecting to a database server requires passing credentialsusername and passwordto the server in a connection string. These credentials, together with the data source name , need to be kept private to protect unauthorized access to the data source. There are two approaches for obtaining these credentials: Often, it is not practical to prompt for connection credentials because of disadvantages including: Security Transferring connection information from the browser to the server can expose connection credentials if they are not encrypted. Connection pooling Each user must be recognized separately by the server. This does not allow effective connection pooling and can limit the scalability of the application. For more on connection pooling, see Recipe 1.15. Single sign-on It is difficult to integrate with single sign-on strategies, which are becoming increasingly important in enterprise environments (for example, where numerous applications are aggregated into portals). Server applications Cannot be used by applications that otherwise have no user interface, such as an XML web service. There are a number of techniques that you can use to store predetermined connection credentials. These, together with their advantages and drawbacks, are discussed in the following subsections. Hardcode in the application An obvious technique for storing connection strings is hardcoding them into the application. Although this approach results in the best performance, it has poor flexibility; the application needs to be recompiled if the connection string needs to be changed for any reason. Security is poor. The code can be disassembled to expose connection string information. Caching techniques together with external storage techniques eliminate nearly all performance benefits of hardcoding over external storage techniques. Hardcoding connection string information is not advised; external server-side storage is preferred in nearly all cases because of the increased flexibility, security, and configuration ease. A discussion of available external storage options follows . Application configuration file An application configuration file is an XML-based text file that is used to store application-specific settings used at runtime by the application. The naming convention for and deployment location of the file depend on the type of application: Executable application The name of the configuration file is the name of the application executable with a .config extensionfor example, myApplication.exe.config . It is located in the same directory as the executable file. ASP.NET application A web application can have multiple configuration files all named web.config . Each configuration file supplies configuration settings for its directory and all of its child directories; it also overrides any configuration settings inherited from parent directories. The element of the application file is used to store custom application settings as a collection of key-value pairs. You can store a connection string as shown: The AppSettings property of the System.Configuration.ConfigurationSettings class is used to retrieve the value for a specific key within the appSettings element; the ConfigurationSettings class cannot be used to write settings to a configuration file. Application configuration files facilitate deployment because the files are simply installed alongside other application files. One drawback is that application configuration files are not inherently secure since they store information as clear text in a file that is accessible through the file system. Encrypt the connection and other sensitive information within the configuration file and ensure that NTFS file permissions are set to restrict access to the file. Recipe 5.7 shows techniques to encrypt data. Universal data link (UDL) file The OLE DB .NET data providers supports UDL filenames in its connection string. The UDL file is a resource external to the application that encapsulates connection properties in a separate file. It must be protected using NTFS security to prevent connection information from being exposed or altered . The SQL Server .NET data provider does not support UDL files in its connection string. UDL files are not encrypted; cryptography cannot be used to increase security. NTFS directory and file encryption can secure a UDL file so that even if unauthorized access is gained to the file or the physical disk is stolen, the user ID and password of the user who encrypted the file would still be required to access its contents. Windows registry You can store connection strings in the Windows registry as a subkey of HKEY_LOCAL_MACHINESOFTWARE . You can encrypt these settings within the registry subkey and restrict access to the subkey to increase the security of this technique. This technique is easy to use because of programmatic support for registry access in .NET classes Registry and RegistryKey in the Microsoft.Win32 namespace. Storing connection strings in the registry is usually discouraged because of deployment issues; the registry settings must be deployed with the application, defeating benefits of xcopy deployment. Application code can also be restricted in its access to the registry, further complicating deployment..
https://flylib.com/books/en/1.105.1/storing_connection_strings.html
CC-MAIN-2018-39
en
refinedweb
Makefile is an iconic approach for compiling and building C/C++ programs. It’s mostly used by developers on Unix, Linux, and similar platforms. It aims to simplify the build process for program executables that may include several modules. In this Makefile tutorial, we’ll briefly discuss, what are its features and how to create a client-server program in C using Makefile. In the first section of this post, we are covering the Makefile essentials so that you can easily use them in your projects. And then, there is the full source code of the client-server program written in C language. We’ve used socket programming concepts to implement this basic application. Since the objective of this Makefile tutorial is to train you in using make as a build tool, so we’ll create a Makefile to build the socket program. Before you dive in further to read the post, it’s important to know the target platform version and the tools specification used. OS Used: Linux Ubuntu OS Version: ubuntu-13.10- amd64 Make Version: GNU Make 4.0 GCC Version: 4.8 GDB Version: 7.6.1 The above information was also necessary as you may need to create a similar build environment for practice. Though, it’s not mandatory to have a one-on-one match of the tools version. The code and concepts mentioned here are generic, should work ideally with any version. Need your attention here, while working on a C/C++ project, it’s inevitable to use GDB for debugging. So if you want to learn a few quick tips, then please go through the below post. Next, reading a few C/C++ tips won’t bother you much. Find out if the below tutorial does have something new for you. Now, carefully watch out how to create a client-server program in C and build it using the Makefile. Makefile Tutorial – How To. What is a Makefile and how does it work? Makefile manifest a set of rules to locate the dependencies, produces object codes and build the target modules. Processing a Makefile requires the use of Make tool. It can automatically select a Makefile available in the current directory or we can specify one as its command line argument. The first step for using the Make tool is to prepare the user-defined makefiles. As referred above, the makefile drives its significance by compiling/building a project which has multiple C/C++ files to build. Here is the syntax to use the Make tool from command line. make [options] [target] -f: With this option, we can specify a custom Makefile name. Usually, we apply the “-f” option when there are more than one Makefiles in a directory. e.g. make –f run.mk Where <run.mk> is a Makefile. Note- If we don’t give any file name, then the Make tool will search for a file which could have names like Makefile or makefile (generally this is the by default name of the makefile.) How to write a Makefile? A Makefile typically begins with a few variable definitions. Then, there comes a set of target entries for build-specific targets (e.g. “.o” and executable files in C/C++, and “.class” files in Java). Next, there could be a group of commands to execute for the target label. Below is a generic Makefile template which anyone can follow to create his own. #Hash for commenting. #Note- The <tab> in the command line is necessary for make to work. target: dependency1 dependency2 ... <tab> command #target entry for building program executable from program and object files. program: testapp.o gcc -o testapp testapp.o Create a client-server program in C using Makefile. In this part of the Makefile tutorial, we are going to implement Client-Server communication using socket programming in C. For this, we’ll create the following two separate modules. - Client Socket Module (client.c) - Server Socket Module (server.c) For establishing a connection, we need to perform the following steps. First are the steps involved in establishing a socket on the client side. 1. Create a socket with the <socket()> system call. 2. Connect the socket to the address of the server using the <connect()> system call. 3. Start sending and receiving data. There are many ways you can do this. But the simplest is by using the <read()> and <write()> system calls. Next are the steps required to implement a socket on the server side. 1. Create a socket with the <socket()> system call. 2. Bind the socket to an address using the <bind()> system call. For a server socket on the Internet, an address consists of a port number on the host machine. 3. Accept a connection by making the <accept()> system call. It’ll usually block until a client connects to the server. 4. Send and receive data. Please note that it’s the following socket structure which we’ve used in both client and server programs. #include <netinet/in.h> struct sockaddr_in { short sin_family; // e.g. AF_INET unsigned short sin_port; // e.g. htons(3490) struct in_addr sin_addr; // see structin_addr, below char sin_zero[8]; // zero this if you want to }; struct in_addr { unsigned long s_addr; // load with inet_aton() }; Let’s now check out the source code of the client socket. Client Socket Program. #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> void error(const char * msg) { perror(msg); exit(0); } int main() { int sockfd, portno, n; struct sockaddr_in serv_addr; struct hostent *server; char *hostName = "localhost"; char buffer[256]; portno = 5570; // socket function which return the file descriptor which we will further bind or connect to address of the host machine or server . sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) error("ERROR opening socket"); // here we search the host machine by their name (i.e called hostName). // on linux we find out host name by command – hostname // on window we find out the host name by command – ipconfig/all server = gethostbyname(hostName); if (server == NULL) { fprintf(stderr, "ERROR, no such host\n"); exit(0); } bzero((char *) &serv_addr, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; bcopy((char *) server->h_addr, (char *) &serv_addr.sin_addr.s_addr, server->h_length); serv_addr.sin_port = htons(portno); // here we connect to thefile descriptor with socket address if (connect(sockfd, (structsockaddr *) &serv_addr, sizeof(serv_addr)) < 0) error("ERROR connecting"); printf("Please enter the message: "); bzero(buffer, 256); // fgets() is used for the getting the message from the user or client . fgets(buffer, 255, stdin); //read or write function is used for the writing or reading the message in the socket stream. n = write(sockfd, buffer, strlen(buffer)); if (n < 0) error("ERROR writing to socket"); bzero(buffer, 256); n = read(sockfd, buffer, 255); if (n < 0) error("ERROR reading from socket"); printf("%s\n", buffer); close(sockfd); return 0; } Now, let’s see what’s inside the server-side code. Server Socket Program. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> void error(const char * msg) { perror(msg); exit(1); } int main() { int sockfd, newsockfd, portno; socklen_t clilen; char buffer[256]; struct sockaddr_in serv_addr, cli_addr; int n; sockfd = socket(AF_INET, SOCK_STREAM, 0); if (sockfd < 0) error("ERROR opening socket"); bzero((char *) &serv_addr, sizeof(serv_addr)); portno = 5570; serv_addr.sin_family = AF_INET; serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1"); serv_addr.sin_port = htons(portno); if (bind(sockfd, (structsockaddr * ) &serv_addr, sizeof(serv_addr)) < 0) error("ERROR on binding"); listen(sockfd, 5); clilen = sizeof(cli_addr); // accept function is called whose purpose is to accept the client request and return the new fileDescriptor or and the old file descriptor is for another (i.esockfd) client connections. newsockfd = accept(sockfd, (structsockaddr *) &cli_addr, &clilen); if (newsockfd < 0) error("ERROR on accept"); bzero(buffer, 256); n = read(newsockfd, buffer, 255); if (n < 0) error("ERROR reading from socket"); printf("Here is the message:\n"); n = write(newsockfd, buffer, 30); if (n < 0) error("ERROR writing to socket"); close(newsockfd); close(sockfd); return 0; } We are now attaching the Makefile created for building the above two modules simultaneously. Makefile to build Client-Server Programs. #The pond symbol is used for writing the comments. #make file overview :-- #you can add a little description here. #variable declaration :- cc=gcc // this is the variable which is used in the target. MAKE=make RM =rm #targets . all: client.cserver.c $(cc) -o client client.c $(cc) -o server server.c gnome-terminal -t server --working-directory=/home/techbeamers -e "./server" sleep 10s $(MAKE) client_target #another target for client client_target: ./client clean:server client $(RM) server $(RM) client Here are a few notes on the Makefile given above. - To use a variable defined in the Makefile, prefix it with the dollar symbol. $(variable_name) - All, client_target & clean are the targets present in the Makefile. - If you don’t provide any target in the Makefile, then the Make tool will build all of them from the top to bottom. Summary – Makefile Tutorial to Create Client-Server Program. We are hopeful that the above Makefile tutorial would help you immensely. And you’ll use it efficiently in your new C/C++ projects.. Enjoy Learning, TechBeamers.
http://www.techbeamers.com/makefile-tutorial-create-client-server-program/
CC-MAIN-2018-26
en
refinedweb
if_nametoindex, if_indextoname - mappings between network interface names and indexes Current Version: Linux Kernel - 3.80 Synopsis #include <net/if.h> unsigned int if_nametoindex(const char *ifname); char *if_indextoname(unsigned int ifindex, char *ifname); Description. Return Value On success, if_nametoindex() returns the index number of the network interface; on error, 0 is returned and errno is set appropriately. On success, if_indextoname() returns ifname; on error, NULL is returned and errno is set appropriately. Errors Attributes Conforming To RFC 3493, POSIX.1-2001. This function first appeared in BSDi. See Also getifaddrs(3), if_nameindex(3), ifconfig(8)
https://community.spiceworks.com/linux/man/3/if_indextoname
CC-MAIN-2018-26
en
refinedweb
For example I have a poorly documented library. I have an object from it and I want to know what are the types of the arguments certain method accepts. In IPython I can run In [28]: tdb.getData? Signature: tdb.getData(time, point_coords, sinterp=0, tinterp=0, data_set='isotropic1024coarse', getFunction='getVelocity', make_modulo=False) Docstring: <no docstring> File: ~/.local/lib/python3.5/site-packages/pyJHTDB/libJHTDB.py Type: method point_coords Usually, functions in Python accept arguments of any type, so you cannot define what type it expects. Still, the function probably does make some implicit assumptions about the received object. Take this function for example: def is_long(x): return len(x) > 1000 What type of argument x does this function accept? Any type, as long as it has length defined. So, it can take a string, or a list, or a dict, or any custom object you create, as long as it implements __len__. But it won't take an integer. is_long('abcd') # ok is_long([1, 2, 3, 4]) # ok is_long(11) # not ok To answer the question: How can you tell what assumtions the function makes? help(funcname)) get_value.
https://codedump.io/share/Aa32pPCODRS0/1/how-to-determine-function-parameter-type-in-python
CC-MAIN-2018-26
en
refinedweb
Which is better for teaching? C# or F# Jakob Christensen Sep 10 '17 This article originally appeared on my personal blog. Recently I have had the pleasure of training a couple of colleagues in the wonders of programming. At work we use C# for most of our applications so naturally I started preparing my material in C#. I did not get very far before it occurred to me: This is going to be a long haul... Now, my colleagues are smart, really smart, much smarter than me, but they do not have much experience in programming (and have almost no resemblance to the picture above). They have been using SQL, some VBA, and perhaps a bit of R, but none of them have been doing real application development and they know nothing about OO theory. Unfortunately, you do not get very far with a language such as C# without knowing just a little bit about OO programming. Let's start with the compulsory and useless "Hello, world" example: using System; namespace ConsoleApp { class Program { static void Main(string[] args) { Console.WriteLine("Hello, world"); } } } That's a lot of code just to print out a stupid message on the screen. "What are all those things for?" my colleague complains and I answer "We'll get to namespaces, classes, static, void, arrays, and more stuff later". He's not happy and continues "Do I really need to write all those curly braces and semicolons?". And when I tell him yes, and don't forget that it's all case sensitive, he breaks down and says "I miss VBA...". Of course curly brackets and case sensitivity has nothing to do with OO but I think we can all agree that OO is really, really hard. Heck, I don't even master it after years of C++ and C#. I find that it takes a long time for beginners to grasp OO and when they start to see the light they will abuse inheritance and create everything as singletons. And interfaces seem to be impossible to understand even though I do my best with lousy metafors such as cars and DVD playsers. Usually, beginners actually tend to completely ignore that C# is object oriented and they take a straight forward approach and create a very long Main function. So, perhaps teaching my colleagues C# is not the right approach. Perhaps I should try teaching them a functional language instead such as F#? Now, I am not saying that functional languages are easy but I do think that you can get really far with F# without knowing advanced stuff such as monads. In F# the "Hello, world" example boils down to printfn "Hello, world" Very simple. Not much to talk about. Besides, there are a couple of important points to consider when bringing F# to the table: - My colleagues are all mathematicians and functional languages are perfect for math stuff. - F# is a .NET language and will work together with all the C# code in our company. - F# can work as a scripting language for makeshift assignments. I am thinking that it would suffice to teach the basics of F# such as record types, functions, pattern matching, the Seq module, type providers, and perhaps partial application. What do you think? Would F# be easier to grasp or should I go for the usual C#? What should I be asking for salary? Hello all, I figured I'd poll the crowd and see what I get. I'm curious about ... I'm a big F# fan, so I'd be remiss if I didn't mention that your "boiled down" F# example missed the moduleand [<EntryPoint>]declarations (unless you're running in an fsxfile). :) I'd agree that F# will fit the mathematician's mind better than C# will. Of course, a lot of the .NET Framework examples assume C#, so being passingly familiar with C#'s syntax will be a benefit to your protegés. So, as BG Adrian said - don't lead with the .NET Framework, lead with "automated mathematics," and bring in the framework when they need to do something the language doesn't handle "natively". Thank you for your suggestions. I will start with real world assignments and bring in whatever is needed from the framework or from Nuget as we go. I admit that I did cheat a bit with the F# example to state my point. But one of my points is that F# can be easily used for scripting (.fsx) so it is still valid :-) C# can easily be used for scripting also - (.csx) You can use Xamarin Workbook or VS Code to start teaching your colleagues. You can just use WriteLine("Hello World"); After you have declared the using statement, which you did not do in your F# example - whence biases. Anyways, teaching one programming depends on many factors and there must be biases and preferences. People will always resist new ways of doing things until you break that barrier by motivating and influencing them. Without mincing words, C# is a powerful and wonderful language with many great features - check out C# 6, 7, 7.1 and upcoming version 8. And F# also is a great language. All of them running on a great and powerful platform - .NET or .NET Core. So if you feel F# will be better for what they will be doing for the company, teach them F#. But is C# will be useful and better for what they will be doing, teach them C#. After all, I do not think is hello world they will be developing for the company. Consider the prospect of the language, industry support, platforms they run on; how many different types of application you can develop using them. etc. Mathematicians == functional programming, there is no question. But if they are not into programming, and you want them to enter just as a hobby do not include work matters, do not call upon the HUGE languages like .net where you get lost on stack overflow. Make funny projects with them, games are always good for the morale start slow - Khan academy - JS canvas library CodeCombat.com or codingame.com or other competitive ones, where you can battle each other, a tournament is always good for spirit Unity3D - has Mono, but you can achieve a lot of things w/o scripting. Do weekend game jams. I never thought about using non-.NET languages. JavaScript may be a good place to start. I will think about it. Anyways, most of them are not completely new to programming. They have done some SQL and VBA and the intention is to level up. But you are right - none of them are really into to programming so your suggestions may show them the joys of it. Thanks for your advice. Np, as a professor is hard to find something they might like. For kids Scratch works great for example. You can try other fields too like: make a pathfinding route for the Roman empire or learn how to query one of the biggest public DB hosted at GCloud, like GDELT, make scripts to fetch those data or you download them, and make cool contests to find the weirdest popular news like how many ppl were killed by a parrot :). The point is that languages are just tools, you will learn a tool when you have a project for it and understand it's utility, and want too. Definitely F#, but highly suggest you be prepared to adjust your teaching approach on the fly depending on your colleagues. There'll be, in my experience, two ways of approaching a new topic: Definitely think about the learning curve. With your C# example it was far too steep to begin with, partially because your example had a lot of additional details that for you, it's easy to not worry about. For beginners, they have no idea what to focus on, so their attention goes everywhere and as a mathematician myself I'm obsessed with the details, so my head would also be springing with questions like "What's namespace, static, void? etc.". Start with scripting and doing things, and if there's such thing as a symbolic maths package/library for F# you can have a bit of fun with that. I know nothing about F#, so I don't have any other specific suggestions. Thank you for your comment. I think you are right that there are too many details in C#. Starting with scripting is a good idea and F# is really good at that. All you really need is a text editor. I bet to differ. There are also many details in F# hello example, it was the writer who decided to leave them out for brevity. C# also has a scripting capability both in Visual Studio, VS Code, and Xamarin WorkBook. You can just do WriteLine("Hello World"); in C# example. I would suggest the teacher do some researchers to find out what is needful and meaningful for the team based on the tasks they will be rendering the company. Anyways, F# is a great language, and C# is a great language - all taking advantage of a powerful platform - highly recommend this course: coursera.org/learn/programming-lan... It's a free online MOOC with short lecture videos, about 10 mins each. The professor has a knack for explaining functional programming concepts simply and succinctly. He teaches statically typed functional programming, and I think covers the concepts that will really open your mind to the specific way of thinking with types and functions. About a year ago, I actually started a lunchtime study group with some of my colleagues to tackle this course, with the expectation that it would take about four to six weeks to finish. The course itself is taught in Standard ML, but I prepared some supplementary notes to convert the syntax and some techniques to F# (the two languages are very similar). I can send you the notes privately if you want. In our case unfortunately we didn't have the time or discipline to keep up the course, but if you have some support and engaged learners it should be possible. Thank you for your comment. I will definitely take a look at your link. I think that C# has maybe a bit bigger learning curve at first, but afterwards you gain important knowledge in one of the most popular languages in the worlds, and knowing C# will help later on in moving to other similar languages such as Java. I've never seen a job post with F# requirements, but maybe it's just me. It seems that FP is gaining in popularity (especially Elm) but you are right about the popularity of C# and the missing job postings for F#. Thanks.
https://dev.to/t4rzsan/which-is-better-for-teaching-c-or-f
CC-MAIN-2018-26
en
refinedweb
I'm using pandas to count recurring usernames from 2 different large text files. How do I get my code to analyze the data from both files at the same time? Right now I have only been able to run one text file so nothing is occurring more than once. Here is my Code: import pandas as pd fixed_df = pd.read_csv('sample.txt', sep=';', encoding='latin1') fixed_df['User Name'].value_counts().nsmallest() Combine files like this fixed_df1 = pd.read_csv('sample1.txt', sep=';', encoding='latin1') fixed_df2 = pd.read_csv('sample2.txt', sep=';', encoding='latin1') fixed_df = pd.concat([fixed_df1, fixed_df2])
https://codedump.io/share/cnJ8k0rfW7PI/1/ipythonusing-pandas-how-do-i-combine-multiple-text-files-to-find-reacurring-usernames
CC-MAIN-2018-26
en
refinedweb
D is a general-purpose programming language with static typing, systems-level access, and C-like syntax. It combines efficiency, control and modeling power with safety and programmer productivity. Got a brief example illustrating D? Submit your code to the digitalmars.D forum specifying "[your code here]" in the subject. Upon approval it will be showcased here on a random schedule. DConf 2017 has successfully concluded! Whether you were with us in Berlin or watching from home, we thank everyone for participating. You can review the conference through this YouTube playlist. News Stay updated with lastest article in the Official D Blog from September 13, 2017: The Making of ‘D Web Development’ by Kai Nacke. Browse weekly summaries in This Week in D - September 3: New dmd release, static foreach and -betterC out Learn Take the Tour, explore major features in D, quick start with C or C++ background, setup your IDE or editor, and ask questions in the Learn forum. For a deeper dive into D check out books about D, among others Ali Çehreli's Programming in D. Community Discuss D on the forums, join the IRC channel, read our official Blog, or follow us on Twitter. Browse the wiki where among other things you can find the high-level vision of the D Language Foundation. Documentation Refer to the documentation for the language and for phobos, D's standard library. The DMD manual tells you how to use the compiler. Read various articles to deepen your understanding. Contribute Report any bugs you find to our bug tracker. If you can fix an issue, make a pull request on GitHub. There are many other ways to help, too! Packages DUB is the package manager for D. Get started with DUB, and check out the available packages. Why D? Convenience D allows writing large code fragments without redundantly specifying types, like dynamic languages do. On the other hand, static inference deduces types and other code properties, giving the best of both the static and the dynamic worlds. void main() { // Define an array of numbers, double[]. // Compiler recognizes the common // type of all initializers. auto arr = [ 1, 2, 3.14, 5.1, 6 ]; // Dictionary that maps string to int, // type is spelled int[string] auto dictionary = [ "one" : 1, "two" : 2, "three" : 3 ]; // Calls the min function defined below auto x = min(arr[0], dictionary["two"]); } // Type deduction works for function results. // This is important for generic functions, // such as min below, which works correctly // for all comparable types. auto min(T1, T2)(T1 lhs, T2 rhs) { return rhs < lhs ? rhs : lhs; } Automatic memory management makes for safe, simple, and robust code. D also supports scoped resource management (aka the RAII idiom) and scope statements for deterministic transactional code that is easy to write and read. import std.stdio; class Widget { } void main() { // Automatically managed. auto w = new Widget; // Code is executed in any case upon scope exit. scope(exit) { writeln("Exiting main."); } // File is closed deterministically at scope's end. foreach (line; File("text.txt").byLine()) { writeln(line); } writeln(); } Built-in linear and associative arrays, slices, and ranges make daily programming simple and pleasant for tasks, both small and large. The D programming language Modern convenience. Modeling power. Native efficiency. // Compute average line length for stdin void main() { import std.range, std.stdio; auto sum = 0.0; auto count = stdin.byLine .tee!(l => sum += l.length).walkLength; writeln("Average line length: ", count ? sum / count : 0); } Power The best paradigm is to not impose something at the expense of others. D offers classic polymorphism, value semantics, functional style, generics, generative programming, contract programming, and more—all harmoniously integrated. // Interfaces and classes interface Printable { void print(uint level) // contract is part of the interface in { assert(level > 0); } } // Interface implementation class Widget : Printable { void print(uint level) in{ } body{ } } // Single inheritance of state class ExtendedWidget : Widget { override void print(uint level) in { /* weakening precondition is okay */ } body { //... level may be 0 here ... } } // Immutable data shared across threads immutable string programName = "demo"; // Mutable data is thread-local int perThread = 42; // Explicitly shared data shared int perApp = 5; // Structs have value semantics struct BigNum { // intercept copying this(this) { } // intercept destructor ~this() { } } void main() { // ... } D offers an innovative approach to concurrency, featuring true immutable data, message passing, no sharing by default, and controlled mutable sharing across threads. Read more. From simple scripts to large projects, D has the breadth to scale with any application's needs: unit testing, information hiding, refined modularity, fast compilation, precise interfaces. Read more. Efficiency D compiles naturally to efficient native code. D is designed such that most "obvious" code is fast and safe. On occasion a function might need to escape the confines of type safety for ultimate speed and control. For such rare cases D offers native pointers, type casts, access to any C function without any intervening translation, manual memory management, custom allocators and even inline assembly code. import core.stdc.stdlib; void livingDangerously() { // Access to C's malloc and free primitives auto buf = malloc(1024 * 1024); // free automatically upon scope exit scope(exit) free(buf); //. asm { mov EAX,x ; mul EAX,y ; mov result,EAX ; jc Loverflow ; } return result; } else { result = x * y; if (!y || x <= uint.max / y) return result; } Loverflow: throw new Exception("multiply overflow"); } void main() { // ... } The @safe, @trusted, and @system function attributes allow the programmer to best decide the safety-efficiency tradeoffs of an application, and have the compiler check for consistency. Read more.
https://docarchives.dlang.io/v2.076.0/
CC-MAIN-2018-26
en
refinedweb
gcvt - convert a floating-point number to a string #include <stdlib.h> char *gcvt(double number, size_t ndigit, char *buf); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): gcvt(): _SVID_SOURCE || _XOPEN_SOURCE >= 500 The gcvt() function converts number to a minimal length null-terminated ASCII string and stores the result in buf. It produces ndigit significant digits in either printf(3) F format or E format. The gcvt() function returns the address of the string pointed to by buf. Marked as LEGACY in POSIX.1-2001. POSIX.1-2008 removes the specification of gcvt(), recommending the use of sprintf(3) instead (though snprintf(3) may be preferable). ecvt(3), fcvt(3), sprintf(3) This page is part of release 3.24 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at. 2009-03-15
http://huge-man-linux.net/man3/gcvt.html
CC-MAIN-2018-26
en
refinedweb
I understand how in C# closures allow access to private variables declared in the same scope as an anonymous method, so that those variables are available when the method is invoked in a different scope. But what about private constructors? This code works: class Program { static void Main(string[] args) { var someClassFactory = SomeClass.GetFactoryMethod(); var someclass = someClassFactory(); } } class SomeClass { private SomeClass() { } public static Func<SomeClass> GetFactoryMethod() { return () => new SomeClass(); } } As the compiler creates a class for the closure, how does it then reference the private constructor, or otherwise allow it to be accessed when the anonymous method is invoked by the client code? In this case, the compiler doesn't need to create a class at all - it can just create a static method: public static Func<SomeClass> GetFactoryMethod() { return __GeneratedMethod; } private static SomeClass __GeneratedMethod() { return new SomeClass(); } Even when it does need to generate a class - e.g. if GetFactoryMethod() had a parameter which was captured by the lambda expression - it would generate a nested class, and nested classes have access to the private members of their enclosing classes: public class Foo { private Foo() {} public class Bar { public Foo MakeNewFoo() { return new Foo(); // This is absolutely fine } } }
http://databasefaq.com/index.php/answer/379455/c-closures-closure-access-to-private-constructor-in-c
CC-MAIN-2018-26
en
refinedweb
mongosniff crashes on start Bug Description == Begin SRU Template == [Impact] * mongosniff crashes when it receives messages with no namespace. The result is that a user cannot even press only the enter key without the mongosniff application crashing. * mongosniff in Xenial and Yakkety is essentially broken currently because of a check in the code that gets the message namespace, but if there is no namespace it crashes. [Test Case] * lxc launch ubuntu-daily:xenial xenial * lxc exec xenial bash * apt install mongodb * mongosniff --source NET lo * # Open a 2nd terminal and run the following * lxc exec xenial bash * mongo * # press enter a few times or type 'help' * # Observe mongosniff abort, with a core dump, in the first window [Regression Potential] * Users currently experiencing this issue would be expecting a SRU fix to come from us as the application is broken in a major way. * The only work around it would would require rebuilding mongodb from source with the fix to resolve the issue. * The change was limited to the mongosniff source code only. [Other Info] Ubuntu: * Xenial x64 Packages: #user@localhost:~$ for i in `dpkg --get-selection * mongodb 2.6.10-0ubuntu1 * mongodb-clients 2.6.10-0ubuntu1 * mongodb-server 2.6.10-0ubuntu1 ---- Steps to reproduce: 1. start service 2. start sniffer 3. start shell 4. crash sniffer --- user@localhost:~$ sudo service mongodb start user@localhost:~$ mongo MongoDB shell version: 2.6.10 connecting to: test (...) user@localhost:~$ sudo mongosniff --source NET lo sniffing... 27017 127.0.0.1:37522 -->> 127.0.0.1:27017 admin.$cmd 60 bytes id:0 0 query: { whatsmyuri: 1 } ntoreturn: 1 ntoskip: 0 2016-05- 2016-05- mongosniff( mongosniff( mongosniff( mongosniff() [0x86aca8] mongosniff( /usr/lib/ /usr/lib/ /usr/lib/ mongosniff( mongosniff( /lib/x86_ mongosniff( terminate called after throwing an instance of 'mongo: what(): assertion src/mongo/ Aborted (core dumped) user@localhost:~$ Hi! Thanks for the report. I tried to reproduce this today and was able to with your comments above. I did have to execute something on the mongo shell and then got the crash. I will nominate this for Trusty, Xenial, and Yakkety as it is fixed in Zesty. I believe next steps here are an upload to proposed and then sru verification. Can someone confirm? I've just got round to this again - sorry for the delay. AFAICT, the quilt patch doesn't apply cleanly neither in Xenial nor in Yakkety. I don't know if I have a tooling problem here though. I don't remember if I verified this when I reviewed. Please could you take a look? Both merge requests updated with fixed patches for when other patches applied. Marking yakkety invalid as it is now EOL. Working to get xenial merge unstuck. Sponsored via git workflow. Hello ahsdkjhkbvnmxcv, or anyone else affected, Accepted mongod:/ Looks like the test starting mongod during the build on armhf failed with: [Errno 111] Connection refused [Errno 111] Connection refused timeout starting mongod https:/ This succeeds on every other arch and I did not see any issues with it on the latest rebuild document: http:// Can a rebuild be attempted? I've retried the build just now. it appears to be this bug https:/ /jira.mongodb. org/browse/ SERVER- 14843
https://bugs.launchpad.net/ubuntu/+source/mongodb/+bug/1584431
CC-MAIN-2018-26
en
refinedweb
EXIF: and TIFF: metadata is missing from XMP block in Lightroom 4RussPitcher Apr 13, 2012 2:44 PM I've recently purchased Lightroom 4 and on the whole I'm very happy with it, but I have run into a problem. I have a few scripts which grab information from the XML-based XMP metadata block that's embedded in the DNG and JPG files that I use. I've found that images processed with Lightroom 4 no longer export the exif: and tiff: data. To illustrate, a photo I exported with a previous version of Lightroom has the following data in the XMP block ... tiff:Make="Canon" tiff:Model="Canon EOS 40D" tiff:ImageWidth="850" tiff:ImageLength="567" tiff:XResolution="240/1" tiff:YResolution="240/1" tiff:ResolutionUnit="2" exif:ExifVersion="0221" exif:ExposureTime="1/800" exif:ShutterSpeedValue="9643856/1000000" exif:FNumber="71/10" exif:ApertureValue="5655638/1000000" exif:ExposureProgram="3" exif:DateTimeOriginal="2010-08-22T10:52:07.58+01:00" exif:DateTimeDigitized="2010-08-22T10:52:07.58+01:00" exif:ExposureBiasValue="0/1" exif:MaxApertureValue="4625/1000" exif:SubjectDistance="428/100" exif:MeteringMode="5" exif:FocalLength="80/1" exif:CustomRendered="0" exif:ExposureMode="0" exif:WhiteBalance="0" exif:SceneCaptureType="0" exif:FocalPlaneXResolution="3888000/876" exif:FocalPlaneYResolution="2592000/583" exif:FocalPlaneResolutionUnit="2" exif:PixelXDimension="850" exif:PixelYDimension="567" ... There is, of course, a lot more information in the XMP block, but in a file exported using Lightroom 4 there is nothing in the XMP block with the exif: or tiff: namespaces so none of this information is available to any script which queries the XMP metadata. I'm pretty sure that the metadata is still there, embedded in the original EXIF data, as I can view it using the metadata panel in the Library module, but that's not accessible to my scripts as it's not in the XMP block. I've made doubly sure that the metadata has been saved and also double-checked all my settings and even tried to export the files multiple times with every different setting that I can think of (even though my current settings worked fine in previous versions) but the files never get the exif: or tiff: data. I have called Adobe, but the best help they could give me so far was to post here and hope someone can help! 1. Re: EXIF: and TIFF: metadata is missing from XMP block in Lightroom 4LRuser24 Apr 13, 2012 3:47 PM (in response to RussPitcher) I just compared two JPEGs exported with LR 3.6 and LR 4.1RC. The tags you mentioned are exported neither by 4.1 nor by 3.6. These tags are only present in the normal Exif metadata, but not in XMP. Which version of LR 3.x did you use before? Perhaps Adobe changed something already in the later versions of LR 3.x. If this is the case, you have to use a script or tool that is able to read the Exif metadata directly. In the XMP metadata in the file exported by LR 3.6, I see only crs (camera raw), aux (e.g. serial no.) and some other XMP namespaces, but no exif or tiff. P.S. I viewed the metadata of the exported files with exiftool. File format was JPEG (with "quality" setting, not with "limit file size", because apparently there are still some XMP differences between these two modes). 2. Re: EXIF: and TIFF: metadata is missing from XMP block in Lightroom 4PhotoGAP Apr 13, 2012 3:49 PM (in response to RussPitcher)1 person found this helpful I suspect this may be due to Adobe adhering to the latest recommendations of the Metadata Working Group. If I recall correctly, certain information that natively exists in the image file is no longer replicated in the XMP block. You may need to adjust your scripts accordingly, as the MWG approach is likely to be the standard for the foreseeable future. I believe the change occured around the LR 3.5 timeframe. 3. Re: EXIF: and TIFF: metadata is missing from XMP block in Lightroom 4PhotoGAP Apr 13, 2012 7:52 PM (in response to PhotoGAP) To follow up some more... The latest MWG spec may be found here. A discussion of the issue is on page 22; specifically: "However, this document changes this earlier XMP guidance and recommends that Exif and Tiff device properties only be mapped to XMP in the case the file format does not support Exif natively." The MWG spec dates to Nov 2010, and as I noted earlier, Adobe adopted this guidance sometime last year for LR and, I believe, Photoshop as well. 4. Re: EXIF: and TIFF: metadata is missing from XMP block in Lightroom 4RussPitcher Apr 14, 2012 1:07 AM (in response to PhotoGAP) That sounds like the answer then. I have been using Lightroom 3.2 until I upgraded to 4 so that would also fit with your observations. I must say that's a really frustrating change as it makes the information a lot harder to retrieve. I'd certainly appreciate it if Adobe gave us the option to include the data for backwards compatibility, but I guess that's unlikely. Thanks a lot for your help, Russ 5. Re: EXIF: and TIFF: metadata is missing from XMP block in Lightroom 4PhotoGAP Apr 14, 2012 7:28 AM (in response to RussPitcher) I hear you. I too got caught by the MWG standard, and had to go through many thousands of my scanned images and remap the digitized dates that I had set. In the big picture, however, the goals of the MWG are very good, and I applaud the effort to create a more unified standard.
https://forums.adobe.com/message/4333814
CC-MAIN-2018-26
en
refinedweb
The proposal to merge lp:~zorba-coders/zorba/bug924987 into lp:zorba has been updated. Commit Message changed to: fixes bug 924987 - extended TypeIdentifier to also support schema-element, schema-attribute and namespace-node sequence types - fixed TypeOps::get_type_identifier - added a test to the staticcollectionmanager unit test - added operator<< for TypeIdentifier For more details, see: -- Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: Post to : zorba-coders@lists.launchpad.net Unsubscribe : More help :
https://www.mail-archive.com/zorba-coders@lists.launchpad.net/msg04269.html
CC-MAIN-2018-39
en
refinedweb
I'd like to use aspectj to profile a library. My plan was to mark methods that require profiling with an annotation: @Profiled("logicalUnitOfWork") And then have an aspect that would fire before and ... @Profiled("logicalUnitOfWork") If I put: public CountryState CountryState.find(long id) { return (CountryState) findById(CountryState.class, id); } I am writing a program, and I would only like the user to be able to make certain method calls every 1 second. I'm having trouble figuring out the best way ... I am attempting to write an aspect which monitors calls to public methods on a variety of objects, but ignore calls to self. For this, I have an aspect like this: abstract ... ThisJoinPoint can only get the current method information, anyway to get the caller method information? I was wondering if there is anyway of determing what mehtod was active when this aspect was triggered. I found the method JointPoint.getSourceLocation() which returns the source code line. I realised ... Is it possible to set pointcut on native method call with AspectJ? I tried following aspect: public aspect EmailAspect { pointcut conn() : call(* java.net.PlainSocketImpl.socketConnect(..)); before() ... I want to create a pointcut to target a call to a method from specific methods. take the following: class Parent { public foo() { //do something ... I've read some articles of aspectj, I know it can enhance classes, which is attractive. I've a very stupid question that I can't find a clear answer: Can aspectj add methods to ... I've got generic method Foo.foo(): Foo.foo() class Foo { static native T <T> foo(); } Bar bar = Foo.foo(); I am doing some profiling with Aspectj. I need to identify uniquely the instances of a method where the field been accessed For example: public class Class{ int a; int b; public void method1(){ ... Here is code: IDefaultInterface.aj: public interface IDefaultInterface { public void m1(); static aspect Impl{ public int f1; ... Let's imagine the following aspect: aspect FaultHandler { pointcut services(Server s): target(s) && call(public * *(..)); before(Server s): services(s) { // How to ... I have a Hibernate transactional method "doImportImpl" which runs multi-threaded. Certain records however need to be imported in sequence, so the code structure is roughly like this: public RecordResult doImportImpl(String data) { ... Hi. I'm relatively new to AspectJ (used in the past, but not for a while, so I'm a little bit rusty). I've setup a pointcut to catch all method calls, which it does, and then in the advice, I'm trying to print out the actual method that was called. I can do that using the following: thisJoinPoint.getSignature().toString() and that works just ...
http://www.java2s.com/Questions_And_Answers/Java-Enterprise/aspectj/method.htm
CC-MAIN-2018-39
en
refinedweb
Hi all! I got stucked in this exercise and I don't know why. I executed that code, using my installed python interpreter and received correct results. Here on codecademy the following error return: "Oops, try again. Your function fails on purify([4, 5, 5, 4]). It returns [4] when it should return [4, 4]." def purify(lst): nwlst=[] for item in lst: if item % 2 == 0: nwlst.append(item) return nwlst
https://discuss.codecademy.com/t/purify-whats-wrong/64269
CC-MAIN-2018-39
en
refinedweb
It's not the same without you Join the community to find out what other Atlassian users are discussing, debating and creating. If you use Script Runner you can add scripted fields to your instance: Cheers Hi Czaia, Thanks for reply, I have created scripted field successfully and i have added the Inline also. But i have one Issue please can you help me. Can you see below image. image2015-9-16 14:1:33.png I have enter above fields values and updated then i can't see reported name. but i can see Anonymous name please can you see for more details below. image2015-9-16 14:0:41.png where Iam missing just guide me and what is the Inline script for we can get the correct reporter name. thanks. I get the same behavior (not when using the text searcher though). But why would you want to do that anyways? Why don't you just use a post function to update the custom field? Hi Christian Czaia, Good news, I have solved the Anonymous Issue. We should use the below code(Inline script), If you use the User Picker (single user) or User Picker (multiple users) templates you need to return an ApplicationUser, or List of ApplicationUser in the multiuser case. For Example: ------------------------------------------------------------------------------------------------- import com.atlassian.jira.user.ApplicationUsers ApplicationUsers.from(issue.reporter) --------------------------------------------------------------------------------------------------------- For more details see below. image2015-9-18 12:49:28.png I have one Question Is it possible to update the scripted fields using Java Rest API?, if you know can you Help me out or provide me related Likes. Thanks. You can not update scripted fields, they are.
https://community.atlassian.com/t5/Jira-questions/How-to-create-add-scripted-type-fields-in-Jira/qaq-p/199398
CC-MAIN-2018-39
en
refinedweb
This is my personal time to learn habinate test case. Established before using MyEclipse habinate (this is not to say, Oh, that is, to be with a good data source) . Package Name: cn.hdu .***( entity; service; test; util) First, write the two entity classes Address (private int add_id; private String city; private String country; private Company company;) and the Company (private int c_id; private String c_name; private Address address;), generating get, set methods, and then configure the mapping entity class file Address.hbm.xml and Company . hbm.xml. Code: ---------- Address. Hbm.xm <? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE hibernate-mapping PUBLIC "- / / Hibernate / Hibernate Mapping DTD 3.0 / / EN "" "> <hibernate-mapping> <class name="cn.hdu.entity.Address" table="ADDRESS"> <id name="add_id" column="ADD_ID"> <generator> <param name = "sequence"> ADDRESS_SEQUENCES </ param> </ generator> </ Id> <property name="city" column="CITY"> </ property> <property name="country" column="COUNTRY"> </ property> <One-to-one </ one-to-one> </ Class> </ Hibernate-mapping> ----------- Company. Hbm.xml <? Xml version = "1.0" encoding = "UTF-8"?> <! DOCTYPE hibernate-mapping PUBLIC "- / / Hibernate / Hibernate Mapping DTD 3.0 / / EN "" "> <hibernate-mapping> <class name="cn.hdu.entity.Company" table="COMPANY"> <id name="c_id" column="C_ID"> <generator> <param name="sequence"> COMPANY_SEQUENCES </ param> </ generator> </ Id> <property name="c_name" column="C_NAME"> </ property> <Many-to-one </ many-to-one> </ Class> </ Hibernate-mapping> NOTE: The above many-to-one, not to say that is many to one, this is only Company in the address attribute that points to Address the add_id property, ie one to one is an entity that may correspond to another entity in an attribute of a property. COMPANY_SEQUENCES and ADDRESS_SEQUENCES representatives of the two sequences in the database, Needs its own database and then create; id on behalf of the primary key, name = "" strictly equal to the entity class property name, column = "" representative of the database table field names, usually capitalized; lazy = "false" said do not delay load, the main approach is to ensure that get the value from the database to avoid delay when the error occurred. cascade that when carrying out the operation at the same time habinate-one operation. Do not forget to finish mapping the mapping file after the write hibernate.cfg.xml; Code: <session-factory> ......... <property name="show_sql"> true </ property> <mapping resource="cn/hdu/entity/Company.hbm.xml" /> <mapping resource="cn/hdu/entity/Address.hbm.xml" /> </ Session-factory> One show_sql .. true; behalf of the Executive when the output sql statements. Go after the test, write an implementation class public class ServiceImp { public void insertCompany (Company company) { Session session = HibernateSessionFactory.getSession (); Transaction tc = session.beginTransaction (); session.save (company); tc.commit (); HibernateSessionFactory.closeSession (); } } Test Class: public class Test { public static void main (String [] args) { Service service = new ServiceImp (); Company company = new Company (); Address address = new Address (); address.setCity ("beijin"); address.setCountry ("zhonguo"); company.setC_name ("CP"); company.setAddress (address); service.insertCompany (company); System.out.print ("OK ..."); } Two tables in the database and then have a look, should be inserted into the data. Oh, what I do not understand you can send mail ah, we learn from each other progress ~! ! ! ! Specific code in the annex src.
http://www.quweiji.com/hibernate-one-to-one-configuration-details/
CC-MAIN-2018-39
en
refinedweb
Update (26-Aug-2017): C++11 changes the guarantees for thread safety of function static variable. See this page for an example discussion. This article should still be interesting for historical reasons and to better understand the underlying issue and behavior of older compilers. Here's a short quiz. What will the following code print: #include <iostream> using namespace std; class Foo { public: Foo(const char* s = "") { cerr << "Constructing Foo with " << s << endl; } }; void somefunc() { static Foo funcstatic("funcstatic"); Foo funcauto("funcauto"); } static Foo glob("global"); int main() { cerr << "Entering main\n"; somefunc(); somefunc(); somefunc(); return 0; } Try to think about it for a moment before reading on. Foo is a dummy class with the sole purpose of demonstrating when its constructor is being called. There are a few Foo instances here: one global, one function static (by which I mean static in a function scope) and one function local (automatic). Recently I ran into (a variation of) this code and was surprised that its output is: Constructing Foo with global Entering main Constructing Foo with funcstatic Constructing Foo with funcauto Constructing Foo with funcauto Constructing Foo with funcauto What's surprising here is the construction of funcstatic happening after entering main. Actually, it's happening when somefunc is first called. Why was I surprised? Because I always kind-of assumed that function static variables are handled similarly to global static variables, except their visibility is limited only to the function. While this is true in C, it's only partially true in C++, and here's why. In C++, variables not only have to be initialized - sometimes, they also have to be constructed. While for POD (Plain Old Data) types the behavior is C-like (the compiler just writes the initialization value into the .data segment, no special code required), for types with custom constructors this can't work. Some code has to be generated to call these constructors. It turns out that in case of function static variables, this code can be placed in the function and thus is executed when the function is first called. This behavior is actually allowed by the C++ standard. Here's an excerpt from section 6.7 of a working draft (N1095) of the current C++ standard (C++98): The zero-initialization (8.5) of all local objects with static storage duration (3.7.1) is performed before any other initialization takes place. A local object of POD type (3.9) with static storage duration initialized with constant-expressions is initialized before its block is first entered. An implementation is permitted to perform early initialization of other local objects with static storage duration under the same conditions that an implementation is permitted to statically initialize an object with static storage duration in namespace scope (3.6.2). Otherwise such an object is initialized the first time control passes through its declaration; such an object is considered initialized upon the completion of its initialization. Highlight is mine. What this means, less formally, is that while the compiler is permitted to invoke the constructors of function static variables at global scope, it's free to do this in the function if it wants. And apparently, most modern compilers indeed choose to construct function static objects when the function is first called. This makes sense as an optimization - calling too many constructors before main runs can have a negative impact on program start-up. Not to mention that dependencies between statically constructed objects are one of the biggest headaches C++ has to offer. But herein lies a problem: this construction of static function variables is not thread safe! If somefunc is being called from multiple threads, it may so happen that the constructor of funcstatic will be called multiple times. After all, being static, funcstatic is shared between all threads. The C++ standard doesn't protect us from this happening - it doesn't even acknowledge the existence of threads (this is C++98 we're talking about). So keep this in mind: such code is not thread safe - you can not assume that in the presence of multiple threads the function static variable will be constructed only once. It is the job of the programmer to guarantee this won't happen. This is the main point I wanted to make in this post. The rest is going to examine in more detail the code generated by popular compilers for this scenario and discuss the implications. Let's start with MS Visual C++ 2008. Here's the disassembly of somefunc, skipping the function prologue: static Foo funcstatic("funcstatic"); 00E314FD mov eax,dword ptr [$S1 (0E3A148h)] 00E31502 and eax,1 00E31505 jne somefunc+71h (0E31531h) 00E31507 mov eax,dword ptr [$S1 (0E3A148h)] 00E3150C or eax,1 00E3150F mov dword ptr [$S1 (0E3A148h)],eax 00E31514 mov dword ptr [ebp-4],0 00E3151B push offset string "funcstatic" (0E3890Ch) 00E31520 mov ecx,offset funcstatic (0E3A14Ch) 00E31525 call Foo::Foo (0E31177h) 00E3152A mov dword ptr [ebp-4],0FFFFFFFFh Foo funcauto("funcauto"); 00E31531 push offset string "funcauto" (0E38900h) 00E31536 lea ecx,[ebp-11h] 00E31539 call Foo::Foo (0E31177h) Here's what this does: a special flag is being kept in memory (in address 0x0E3A148 for this particular run). Its goal is to make sure the constructor of funcstatic is only called once. The code fetches the flag into eax and looks at its lowest bit. If that bit is already turned on, it just skips the call and goes to the next line. Otherwise, it places 1 in the lowest bit and calls the constructor. The idea here is obvious - this flag is used to ensure the constructor is only being called once. Note how it blissfully ignores the existence of threads. Suppose two threads - A and B enter somefunc simultaneously. Both can check the flag at the same time, see it's still 0 and then call the constructor. Nothing here prevents that from happening. And this is all good and fine according to the C++ standard. With GCC, however, things get more interesting. Here's the same function compiled with g++ -O0 -g: 0000000000400a9d <_Z8somefuncv>: 400a9d: 55 push rbp 400a9e: 48 89 e5 mov rbp,rsp 400aa1: 48 83 ec 40 sub rsp,0x40 400aa5: b8 a8 21 60 00 mov eax,0x6021a8 400aaa: 0f b6 00 movzx eax,BYTE PTR [rax] 400aad: 84 c0 test al,al 400aaf: 75 76 jne 400b27 <_Z8somefuncv+0x8a> 400ab1: bf a8 21 60 00 mov edi,0x6021a8 400ab6: e8 cd fd ff ff call 400888 <__cxa_guard_acquire@plt> 400abb: 85 c0 test eax,eax 400abd: 0f 95 c0 setne al 400ac0: 84 c0 test al,al 400ac2: 74 63 je 400b27 <_Z8somefuncv+0x8a> 400ac4: c6 45 df 00 mov BYTE PTR [rbp-0x21],0x0 400ac8: be aa 0c 40 00 mov esi,0x400caa 400acd: bf b0 21 60 00 mov edi,0x6021b0 400ad2: e8 89 00 00 00 call 400b60 <_ZN3FooC1EPKc> 400ad7: c6 45 df 01 mov BYTE PTR [rbp-0x21],0x1 400adb: bf a8 21 60 00 mov edi,0x6021a8 400ae0: e8 03 fe ff ff call 4008e8 <__cxa_guard_release@plt> 400ae5: eb 40 jmp 400b27 <_Z8somefuncv+0x8a> 400ae7: 48 89 45 c8 mov QWORD PTR [rbp-0x38],rax 400aeb: 48 89 55 d0 mov QWORD PTR [rbp-0x30],rdx 400aef: 8b 45 d0 mov eax,DWORD PTR [rbp-0x30] 400af2: 89 45 ec mov DWORD PTR [rbp-0x14],eax 400af5: 48 8b 45 c8 mov rax,QWORD PTR [rbp-0x38] 400af9: 48 89 45 e0 mov QWORD PTR [rbp-0x20],rax 400afd: 0f b6 45 df movzx eax,BYTE PTR [rbp-0x21] 400b01: 83 f0 01 xor eax,0x1 400b04: 84 c0 test al,al 400b06: 74 0a je 400b12 <_Z8somefuncv+0x75> 400b08: bf a8 21 60 00 mov edi,0x6021a8 400b0d: e8 06 fe ff ff call 400918 <__cxa_guard_abort@plt> 400b12: 48 8b 45 e0 mov rax,QWORD PTR [rbp-0x20] 400b16: 48 89 45 c8 mov QWORD PTR [rbp-0x38],rax 400b1a: 48 63 45 ec movsxd rax,DWORD PTR [rbp-0x14] 400b1e: 48 8b 7d c8 mov rdi,QWORD PTR [rbp-0x38] 400b22: e8 11 fe ff ff call 400938 <_Unwind_Resume@plt> 400b27: 48 8d 7d ff lea rdi,[rbp-0x1] 400b2b: be b5 0c 40 00 mov esi,0x400cb5 400b30: e8 2b 00 00 00 call 400b60 <_ZN3FooC1EPKc> 400b35: c9 leave 400b36: c3 ret What's going on here? It turns out that since version 4, GCC generates "guard" calls that ensure multi-threaded safety for this kind of initialization. To better understand what's going on in the code above, there's a relevant section in the Itanium C++ ABI (which GCC follows) right here. GCC also allows to disable these guards by passing -fno-threadsafe-statics flag during compilation. With this flag, the code generated by GCC for our code sample is quite similar to the one generated by MSVC. On one hand, this is nice of GCC to do. On the other hand, it's one of those things that introduce insidious portability problems. Develop the code for GCC and everything is peachy for function static constructors - no multithreading problems because of the guard code. Then port the code to Windows and start witnessing intermittent failures due to races between threads. Not fun. The only solution is, of course, to write code that adheres to the C++ standard and doesn't make assumptions that must not be made.
https://eli.thegreenplace.net/2011/08/30/construction-of-function-static-variables-in-c-is-not-thread-safe
CC-MAIN-2019-22
en
refinedweb
Tutorials In the following sections we work through some illustrative tutorials demonstrating some functional areas of the product. Starting a business process on a schedule There are times when we want a Business Process to be started on a repeatable schedule. Perhaps we want to run a process to start re-stocking at the end of each day. Fortunately, IBPM provides an elegant solution for just this capability. UCAs can be triggered to start at defined intervals and using a Start Message Event activity in a BPD allows a BPD to be associated with a UCA such that when the UCA is fired, the process instance can run. Create a new General System service called Scheduled Start. Define an output variable called " correlId" of type string. Define a Server Script node to set the value of the output variable to be " XXX". This will be the General Service that is started by the Scheduled UCA. Add a new Under Cover Agent (UCA) called Scheduled Start and associate this with the General Service that we just created (also called Scheduled Start) In the UCA implementation, selected all the entries in the right column that says that the start time for the UCA will be every 5 minutes: Create a new BPD called Scheduled BPD. Build an wire the BPD as follows: Add a private variable called " correlId" of type String. For the implementation of the Log activity, define it to be a piece of in-line JavaScript that logs that the BPD was started: For the Start Message Event, associate it with the Scheduled Start UCA. For the UCA output mapping, map to the " correlId" variable. In the Pre & Post settings of the Start Message Event, give the correlId variable an initial value of " XXX": Create a snap shot of the Process App and deploy to a Process Server (not the Process Center). If we now start a Process Admin session and visit Event Manager → Monitor, we will see a scheduled entry for our new Process App: This shows the next time it will fire. BUG!!! It seems that I have to create a new snapshot and deploy twice before it works. Building a Monitor Model for BPMN events In this tutorial we are going to walk through the construction of a Monitor Model from scratch to handle the processing of incoming Tracking Group events. This techniques does not start with a generated monitor model. It is assumed that you have skills in: This is not a tutorial for newbies to either IBPM or Business Monitor. In our story, we want to generate tracking events. To start we assume a new process application. Into this we create a new Tracking Group that, in this story is called " sale": The fields that we want to monitor when the process instances run are: After having constructed this Tracking Group, we next build a BPD that includes an Intermediate Tracking Event to externalize the event for monitor consumption: The fields of the tracking group are populated from a variable (not shown in this diagram). The construction of the Monitoring Model is performed in Integration Developer. Start a copy of that and open the Business MonitoringPerspective. This perspective owns all the editors and views needed to build the model. We start by creating a Business Monitoring Project to hold all our artifacts. We choose to call the project " OrdersMon". The incoming events that arrive from IBPM are in an XML data format. In order for Monitor to be able to work with these events, we need to describe the format of the events through XSD descriptions. The XSD descriptions are surprisingly not supplied with the products. Instead they are found in the InfoCenter here: These three XSD files should be added into the Event Definitionssection. An individual Monitor Project can contain multiple Monitor Models. We have now created our project and now need to build our model. In the Monitor project, we create a new Monitor Model. We call our new model " OrdersMM". Although we have added our event descriptions to our project, we have not yet said that they are to be associated with the model. In the model editor, select the Event Model tab and add each of the XSDs to the model. It appears that order of addition is important so add them in the order shown: As we build out the XPath entries later on in the model, we will refer to some namespaces that need to be explicitly defined with their own prefixes. || |Prefix|Namespaces| |wle| When the model was created, it was given a default key and name. We want the key of this monitoring context to be the Process ID instance. We rename the ID of the key to be " processId" And then rename the Name field to be " Process ID". We are now at the point where we start to add the core artifacts into the model. We start with an inbound event that signifies a new instance of a BPD process has started. We add a new inbound event. And call it " PROCESS_STARTED". The input data is an " eventPointData" object and we need to take care to explicitly say where this eventPointObject can be found within the incoming event. Notice the addition of the " mon:monitorEvent" part as shown in the following figure. The final event types definition looks as follows: Next comes the Filter Condition. It is the Filter Condition which specifies whether or not the incoming message is an instance of this kind of event. We look at the mon:kind field of the EventPointData and check to see if it is a PROCESS_STARTED event. If it is, we have a match. xs:string(PROCESS_STARTED/EventPointData/mon:kind) = '{}PROCESS_STARTED' Next comes the correlation. Here we ask if we have seen this event before for an instance of a process. If all is well, we will NOT have an existing instance and we create a new monitoring context as a result. PROCESS_STARTED/EventPointData/mon:correlation/wle:starting-process-instance = processId In the preceding definition, we added a new inbound event type. Now we update the key metric to when an instance of this event is found. The expression used to source the process instance will be: PROCESS_STARTED/EventPointData/mon:correlation/wle:starting-process-instance We have previously defined what constitutes a start process event and seen how this creates a new monitoring context when seen. Each creation of a monitoring context should have a mechanism to complete that context. Now we define an inbound event that will be an indication that the process has completed. We call this event PROCESS_COMPLETED. We define the event type details the same as we defined for the PROCESS_STARTED event. The filter condition which indicates that this is a Completion event is shown next. xs:string(PROCESS_COMPLETED/EventPointData/mon:kind) = '{}PROCESS_COMPLETED' Finally, we need to correlate to the correct monitoring context. PROCESS_COMPLETED/EventPointData/mon:correlation/wle:starting-process-instance = processId Now when a process completes, the monitor model will see it as a PROCESS_COMPLETED event. The way we terminate a monitoring context is through a trigger. We create a new trigger definition. we call the new trigger " Terminate Context". We next say that the trigger is fired when a PROCESS_COMPLETED event is detected. Finally, in the definition of the trigger, we flag it as causing the termination of the monitoring context. Now we are able to detect the start and end of the process in a monitoring model. It is possible that the recipe we have followed up until now will be repeated in many monitor models. Now we build out more definitions specific for our sample. If we think back we have an intermediate tracking event in our process. We want to be able to catch this type of event so once again, we create a new inbound event definition. We will call this new inbound event "TRACKING GROUP SALE" Just as before, we add an Event Part for the EventPointData but this time we add a second Event Part for the tracking point definitions. We call this event "TrackingPoint". The path to this entry will be: cbe:CommonBaseEvent/mon:monitorEvent/mon:applicationData/wle:tracking-point The final result for the events parts looks as follows: The filter condition that should be applied to an incoming event to see if this is an instance of our tracking event is more superficially complex but at a high level, it is true when: xs:string(TRACKING_GROUP_SALE/EventPointData/mon:kind) = '{}EVENT_THROWN' and xs:string(TRACKING_GROUP_SALE/EventPointData/mon:model[1]/@mon:type) = '{}intermediateThrowEvent' and TRACKING_GROUP_SALE/TrackingPoint/@wle:groupName = 'sale' As before, we want to determine which of the possible process instances and hence monitoring contexts the event should be associated with. TRACKING_GROUP_SALE/EventPointData/mon:correlation/wle:starting-process-instance = processId Now we are at the point where we can detect our tracking group event. This is the last of the inbound events we need to work with. In our model, we wish to create a metric to hold the " orderAmount". We create a new metric. and give the metric the name " orderAmount" and set its type to be " Decimal". The metric's value will be taken from the following expression. Note that it names the Tracking Group event as the source and hence will only be evaluated when a Tracking Group event is detected. xs:decimal(TRACKING_GROUP_SALE/TrackingPoint/wle:tracked-field[@wle:name='orderAmount']) We create a second metric to hold the US state in which the sale occurred. TRACKING_GROUP_SALE/TrackingPoint/wle:tracked-field[@wle:name = 'usState'] Having completed all the steps in our model's development, what remains for us to do is generate the JEE artifacts and deploy them to a Monitor server. At the completion of this step, the JEE projects will have been built and will be ready for deployment. We then deploy the project to a Monitor server through the Servers view. After deployment we will see the application representing the monitor model deployed to the server. Our construction is finished and now what remains is for us to run an instance of the BPD process. After having run an instance of the process, we can bring up Business Space and an a monitoring instances widget to a page. In the configuration of the widget, select the metrics that we build in the model for display. If all has gone as planned, we will see the following in the widget populated with data. And this concludes the tutorial. At this point we have a Business Monitor model that is as clean as can possibly be and contains no superfluous processing. The construction of KPIs, diagrams, cube views and the other powerful capabilities of monitor usage are now as standard with the product with no involvement in its linking to IBPM. Page 11
https://learn.salientprocess.com/books/ibm-bpm/page/tutorials
CC-MAIN-2019-22
en
refinedweb
26.4 The billpayment Example: Using Events and Interceptors The billpayment example shows how to use both events and interceptors. The example simulates paying an amount using a debit card or credit card. When the user chooses a payment method, the managed bean creates an appropriate event, supplies its payload, and fires it. A simple event listener handles the event using observer methods. The example also defines an interceptor that is set on a class and on two methods of another class. The source files are located in the tut-install /examples/cdi/billpayment/src/main/java/javaeetutorial/billpayment/ directory. 26.4.1 The PaymentEvent Event Class The event class, event.PaymentEvent, is a simple bean class that contains a no-argument constructor. It also has a toString method and getter and setter methods for the payload components: a String for the payment type, a BigDecimal for the payment amount, and a Date for the timestamp. public class PaymentEvent implements Serializable { ... public String paymentType; public BigDecimal value; public Date datetime; public PaymentEvent() { } @Override public String toString() { return this.paymentType + " = $" + this.value.toString() + " at " + this.datetime.toString(); } ... The event class is a simple bean that is instantiated by the managed bean using new and then populated. For this reason, the CDI container cannot intercept the creation of the bean, and hence it cannot allow interception of its getter and setter methods. 26.4.2 The PaymentHandler Event Listener The event listener, listener.PaymentHandler, contains two observer methods, one for each of the two event types: @Logged @SessionScoped public class PaymentHandler implements Serializable { ... public void creditPayment(@Observes @Credit PaymentEvent event) { logger.log(Level.INFO, "PaymentHandler - Credit Handler: {0}", event.toString()); // call a specific Credit handler class... } public void debitPayment(@Observes @Debit PaymentEvent event) { logger.log(Level.INFO, "PaymentHandler - Debit Handler: {0}", event.toString()); // call a specific Debit handler class... } } Each observer method takes as an argument the event, annotated with @Observes and with the qualifier for the type of payment. In a real application, the observer methods would pass the event information on to another component that would perform business logic on the payment. The qualifiers are defined in the payment package, described in The billpayment Facelets Pages and Managed Bean. The PaymentHandler bean is annotated @Logged so that all its methods can be intercepted. 26.4.3 The billpayment Facelets Pages and Managed Bean The billpayment example contains two Facelets pages, index.xhtml and the very simple response.xhtml. The body of index.xhtml looks like this: <h:body> <h3>Bill Payment Options</h3> <p>Enter an amount, select Debit Card or Credit Card, then click Pay.</p> <h:form> <p> <h:outputLabel <h:inputText </p> <h:outputLabel <h:selectOneRadio <f:selectItem <f:selectItem </h:selectOneRadio> <p><h:commandButton</p> <p><h:commandButton</p> </h:form> ... </h:body> The input field takes a payment amount, passed to paymentBean.value. Two options ask the user to select a Debit Card or Credit Card payment, passing the integer value to paymentBean.paymentOption. Finally, the Pay command button's action is set to the method paymentBean.pay, and the Reset button's action is set to the paymentBean.reset method. The payment.PaymentBean managed bean uses qualifiers to differentiate between the two kinds of payment event: @Named @SessionScoped public class PaymentBean implements Serializable { ... @Inject @Credit Event<PaymentEvent> creditEvent; @Inject @Debit Event<PaymentEvent> debitEvent; The qualifiers, @Credit and @Debit, are defined in the payment package along with PaymentBean. Next, the PaymentBean defines the properties it obtains from the Facelets page and will pass on to the event: public static final int DEBIT = 1; public static final int CREDIT = 2; private int paymentOption = DEBIT; @Digits(integer = 10, fraction = 2, message = "Invalid value") private BigDecimal value; private Date datetime; The paymentOption value is an integer passed in from the option component; the default value is DEBIT. The value is a BigDecimal with a Bean Validation constraint that enforces a currency value with a maximum number of digits. The timestamp for the event, datetime, is a Date object initialized when the pay method is called. The pay method of the bean first sets the timestamp for this payment event. It then creates and populates the event payload, using the constructor for the PaymentEvent and calling the event's setter methods, using the bean properties as arguments. It then fires the event. @Logged public String pay() { this.setDatetime(Calendar.getInstance().getTime()); switch (paymentOption) { case DEBIT: PaymentEvent debitPayload = new PaymentEvent(); debitPayload.setPaymentType("Debit"); debitPayload.setValue(value); debitPayload.setDatetime(datetime); debitEvent.fire(debitPayload); break; case CREDIT: PaymentEvent creditPayload = new PaymentEvent(); creditPayload.setPaymentType("Credit"); creditPayload.setValue(value); creditPayload.setDatetime(datetime); creditEvent.fire(creditPayload); break; default: logger.severe("Invalid payment option!"); } return "response"; } The pay method returns the page to which the action is redirected, response.xhtml. The PaymentBean class also contains a reset method that empties the value field on the index.xhtml page and sets the payment option to the default: @Logged public void reset() { setPaymentOption(DEBIT); setValue(BigDecimal.ZERO); } In this bean, only the pay and reset methods are intercepted. The response.xhtml page displays the amount paid. It uses a rendered expression to display the payment method: <h:body> <h:form> <h2>Bill Payment: Result</h2> <h3>Amount Paid with <h:outputText <h:outputText <h:outputText <f:convertNumber </h:outputText> </h3> <p><h:commandButton</p> </h:form> </h:body> 26.4.4 The LoggedInterceptor Interceptor Class The interceptor class, LoggedInterceptor, and its interceptor binding, Logged, are both defined in the interceptor package. The Logged interceptor binding is defined as follows: @Inherited @InterceptorBinding @Retention(RUNTIME) @Target({METHOD, TYPE}) public @interface Logged { } The LoggedInterceptor class looks like this: @Logged @Interceptor public class LoggedInterceptor implements Serializable { ... public LoggedInterceptor() { } @AroundInvoke public Object logMethodEntry(InvocationContext invocationContext) throws Exception { System.out.println("Entering method: " + invocationContext.getMethod().getName() + " in class " + invocationContext.getMethod().getDeclaringClass().getName()); return invocationContext.proceed(); } } The class is annotated with both the @Logged and the @Interceptor annotations. The @AroundInvoke method, logMethodEntry, takes the required InvocationContext argument and calls the required proceed method. When a method is intercepted, logMethodEntry displays the name of the method being invoked as well as its class. To enable the interceptor, the beans.xml file defines it as follows: <interceptors> <class>javaeetutorial.billpayment.interceptor.LoggedInterceptor</class> </interceptors> In this application, the PaymentEvent and PaymentHandler classes are annotated @Logged, so all their methods are intercepted. In PaymentBean, only the pay and reset methods are annotated @Logged, so only those methods are intercepted. 26.4.5 Running the billpayment Example You can use either NetBeans IDE or Maven to build, package, deploy, and run the billpayment application. 26.4.5.1 To Build, Package, and Deploy the billpayment Example Using NetBeans IDE Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server). From the File menu, choose Open Project. In the Open Project dialog box, navigate to: tut-install/examples/cdi Select the billpaymentfolder. Click Open Project. In the Projects tab, right-click the billpaymentproject and select Build. This command builds and packages the application into a WAR file, billpayment.war, located in the targetdirectory, and then deploys it to GlassFish Server. 26.4.5.2 To Build, Package, and Deploy the billpayment Example Using Maven Make sure that GlassFish Server has been started (see Starting and Stopping GlassFish Server). In a terminal window, go to: tut-install/examples/cdi/billpayment/ Enter the following command to deploy the application: mvn install This command builds and packages the application into a WAR file, billpayment.war, located in the targetdirectory, and then deploys it to GlassFish Server. 26.4.5.3 To Run the billpayment Example In a web browser, enter the following URL: On the Bill Payment Options page, enter a value in the Amount field. The amount can contain up to 10 digits and include up to two decimal places. For example: 9876.54 Select Debit Card or Credit Card and click Pay. The Bill Payment: Result page opens, displaying the amount paid and the method of payment: Amount Paid with Credit Card: $9,876.34 Click Back to return to the Bill Payment Options page. You can also click Reset to return to the initial page values. Examine the server log output. In NetBeans IDE, the output is visible in the GlassFish Server Output tab. Otherwise, view domain-dir /logs/server.log. The output from each interceptor appears in the log, followed by the additional logger output defined by the constructor and methods: INFO: Entering method: pay in class billpayment.payment.PaymentBean INFO: PaymentHandler created. INFO: Entering method: debitPayment in class billpayment.listener.PaymentHandler INFO: PaymentHandler - Debit Handler: Debit = $1234.56 at Tue Dec 14 14:50:28 EST 2010
https://docs.oracle.com/javaee/7/tutorial/cdi-adv-examples004.htm
CC-MAIN-2019-22
en
refinedweb
Here's a general degree-n polynomial: To evaluate such a polynomial using a computer program, several approaches can be employed. The simplest, naive method is to compute each term of the polynomial separately and then add them up. Here's the Python code for it: def poly_naive(A, x): p = 0 for i, a in enumerate(A): p += (x ** i) * a return p A is an array of coefficients, lowest first, until . This method is quite inefficient. It requires n additions (since there are n+1 terms to be added) and multiplications. Iterative method It's obvious that there's a lot of repetitive computations being done by raising x to successive powers. We can make things much more efficient by simply keeping the previous power of x between iterations. This is the "iterative method": def poly_iter(A, x): p = 0 xn = 1 for a in A: p += xn * a xn *= x return p In this code xn is the current power of x. We don't need to raise x to a power on each iteration of the loop, a single multiplication suffices. It's easy to see that there are 2n multiplications and n additions for each computation. The algorithm is now linear instead of quadratic. Horner's rule It can be further improved, however. Take a look at this polynomial: It can be rewritten as follows: And in general, we can always rewrite the polynomial: As: This rearrangement is usually called "Horner's rule". We can write the code to implement it as follows: def poly_horner(A, x): p = A[-1] i = len(A) - 2 while i >= 0: p = p * x + A[i] i -= 1 return p Here we start by assigning to p and then successively multiplying by x and adding the next coefficient. This code requires n multiplications and n additions (I'm ignoring here the modification of the loop variable i, as I ignored it in all other algorithms, where it was implicit in the Python for loop). While asymptotically similar to the iterative method, Horner's method has better constants and thus is faster. Curiously, Horner's rule was discovered in the early 19th century, far before the advent of computers. It's obviously useful for manual computation of polynomials as well, for the same reason: it requires less operations. I've timed the 3 algorithms on a random polynomial of degree 500. The one using Horner's rule is about 5 times faster than the naive approach, and 15% faster than the iterative method.
https://eli.thegreenplace.net/2010/03/30/horners-rule-efficient-evaluation-of-polynomials
CC-MAIN-2019-22
en
refinedweb
#include <remconcoreapitargetobserver.h> Link against: remconcoreapi.lib Clients must implement this interface in order to instantiate objects of type CRemConCoreApiTarget. This interface passes incoming commands from RemCon to the client. In order to minimise the number of virtual functions the client has to implement, (a) they aren't pure, and (b) most commands are presented via 'Command' with an operation ID. Commands which are associated with command-specific data come instead through specific methods, e.g. 'Play', which comes with a play speed. Incoming commands are given to client via the MRemConCoreApiTargetObserver mixin.. A command has been received. A 'play' command has been received. A 'select audio input function' has been received. A 'select AV input function' has been received. A 'select disk function' has been received.
http://devlib.symbian.slions.net/belle/GUID-C6E5F800-0637-419E-8FE5-1EBB40E725AA/GUID-50F877E1-F630-3960-8DB4-37B6AD807308.html
CC-MAIN-2019-22
en
refinedweb
Optimized Angular apps: Maxim Salnikov Angular GDE smaller, faster, better How to create Angular apps that loaded and executed faster To make the users (and us) happier Maxim Salnikov Google Developer Expert in Angular Angular Oslo / PWA Oslo meetups organizer ngVikings / ngCommunity organizer Products from the future UI Engineer at ForgeRock How does it work? How to start? More info? Web App Performance Network bandwidth Device performance } } Generate smaller bundles Optimize the code to display UI updates faster Network performance strategy Make overall bundle size smaller Split bundle and download only what we need for the starting-up Cache network responses for the future usage Build the app using prod $ ng build --prod Using Ahead of Time compilation Using Build Optimizer Registering Angular Service Worker (if enabled) Executes enableProdMode() via setting prod environment Recipe #1 How to $ ng build --prod --source-map $ npx source-map-explorer main.bundle.js Use lazy loading Download the only code needed to start the app Use CanLoad guard to mediate navigation Preload all the modules (except the ones protected by CanLoad) by using PreloadAllModules strategy 100% flexibility with your custom PreloadingStrategy Recipe #2 How to const appRoutes: Routes = [{ path: 'tweets', loadChildren: 'tweets/tweets.module#TweetsModule' }] const tweetsRoutes: Routes = [{ path: '', component: TweetFeedsComponent }]; app-routing.module.ts tweets/tweets-routing.module.ts Preloading strategy @NgModule({ imports: [RouterModule.forRoot(appRoutes, { preloadingStrategy: PreloadAllModules })], exports: [RouterModule] }) app-routing.module.ts Add features Application shell Possibility to optimize runtime requests Web App Manifest Recipe #3 $ ng add @angular/pwa $ ng build --prod } Online: load all app assets from the cache Offline: same as offline App Browser App Service worker Cache Browser NGSW configuration file src/ngsw-config.json { "assetGroups": [ Smart defaults for the app shell ], "dataGroups": [ Settings for your API, etc ], ... } Runtime caching ngsw-config.js / dataGroups { "name": "myApi", "urls": [ "/api/archive/**" ], } "cacheConfig": { "strategy": "performance", "maxSize": 100, "maxAge": "365d" } } performance: cache-first freshness: network-first Keep in mind App assets are downloaded twice during the first app start Good to have the message to notify user about the new app version There are alternatives to Angular Service Worker Can only be as a part of progressive enhancement strategy Consider server-side rendering Better first-load experience Social links with previews of a web site Better for SEO Recipe #4 Bootstrap Load HTML First meaningful paint Bootstrap Load HTML First meaningful paint No SSR SSR <app-root>Loading</app-root> How to Official $ ng add @ng-toolkit/universal $ npm run build:prod && npm run server $ ng add @nguniversal/express-engine $ npm run build:ssr && npm run serve:ssr Community Angular change detection (CD) Data bindings Update DOM Event handlers } Change detection } UI render Trigger Ready } 60FPS / 17ms Code performance strategy Make each change detection faster Reduce number of change detections Render as few as possible DOM changes Use pure pipes instead of methods <span>{{ relativeDate(tweet.createdAt) }}</span> Calculated on every change detection Recipe #5 <span>{{ tweet.createdAt | relativeDate }}</span> Calculated only if the value was changed Using method Using pipe How to import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'relativeDate', pure: true }) export class RelativeDatePipe implements PipeTransform { transform(date) { // Transformations... return newDate; } } Memoization Memoization is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again Memoization How to import { memoize } from 'lodash-decorators'; ... @memoize() relativeDate(date) { // Calculations return newDate; } Use OnPush CD strategy Recipe #6 Every time Any event happens All components } By default Use OnPush CD strategy Recipe #6 Every time Any event happens All components } By default Use OnPush CD strategy Recipe #6 Every time Any event happens All components } By default Use OnPush CD strategy Recipe #6 Every time Any event happens All components } By default How to import { ..., ChangeDetectionStrategy } from '@angular/core'; @Component({ changeDetection: ChangeDetectionStrategy.OnPush }) The @Input reference changes An event occurres from the component or one of its children Running change detection explicitly Observable linked to the template via the async pipe emits a new value ChangeDetectionStrategy.Default ChangeDetectionStrategy.OnPush Go for your own CD schedule Disabling CD for the component completely Running some code outside Angular CD Recipe #7 How to import { ..., ChangeDetectorRef } from '@angular/core'; class RealTimeList { constructor(private ref: ChangeDetectorRef) { ref.detach(); setInterval(() => { this.ref.detectChanges(); }, 1000); } } detach() / reattach() detectChanges() / tick() / markForCheck() How to import { ..., NgZone } from '@angular/core'; class MyComponent implements OnChanges { constructor(private _ngZone: NgZone ) {} log() { this._ngZone.runOutsideAngular(() => { // Any code will not cause CD }})); } } Use trackBy in ngFor loops DOM manipulations are expensive Immutable practices generate a new DOM collection Recipe #8 How to export class TweetListComponent implements OnInit { ... trackById(index, tweet) { return tweet.id; } } <div * Angular App Performance Networking Code execution } } Production mode Lazy loading Service worker Server-side rendering Using pure pipes OnPush CD strategy Custom CD strategy Using trackBy Thank you! @webmaxru Maxim Salnikov Questions? Optimized Angular apps: smaller, faster, better By Maxim Salnikov.
https://slides.com/webmax/angular-perf-jfokus
CC-MAIN-2019-22
en
refinedweb
the application boundaries supplied by Windows and the .NET Framework. You'll understand how application boundaries protect applications from poorly designed or faulty code. You'll also learn how application boundaries make it difficult to design applications that want to communicate beyond. Process boundaries are a good thing because they allow processes to coexist. However, it takes lot of system resources to create, monitor, and terminate a process. In addition, when the processor switches between the processes, the processor must save and reset the execution context of the processes. Often an application would involve several short-lived processes, which require the system to spend a lot of resources just for process management. Application Domain Boundary The Common Language Runtime (CLR) provides a managed execution environment for the .NET applications. The managed execution environment provides various services to the executing code; including cross-language integration, code access security, object lifetime management, and debugging and profiling support. This is why code executed by the CLR is also known as managed code. Unlike Windows, the CLR can verify the type-safety of programs to guarantee that a program does not request resources outside of its own boundary. The characteristics of the CLR help provide isolation between running programs at a lower cost than the process boundary. Instead of a process, the basic unit of isolation for running applications in the CLR is an application domain. An application domain (also known as an AppDomain) is the smallest execution unit for a .NET application. The CLR allows several application domains to run within a single Windows process and still provides the same level of isolation between applications as provided by a Windows process.. Creating, monitoring, and maintaining an application domain uses fewer resources than performing the same operations with a process. In addition, the capability of an application domain to run multiple applications within the same process reduces the overhead of process switching. Thus, application domains increase the performance of the applications. You can create an application domain in a program using the AppDomain class of System namespace. However, in most cases the application domains are created and managed by the runtime hosts that execute your code. Runtime hosts provide the environment to run managed code on behalf of the user. When you install the .NET Framework, you get three runtime hosts already configuredthe Windows shell, ASP.NET, and Internet Explorer.
http://www.informit.com/articles/article.aspx?p=31261&seqNum=2
CC-MAIN-2019-22
en
refinedweb
Studio Running the first Hello World Application (Kotlin) Zulfi Khan Ranch Hand Posts: 107 posted 10 months ago Hi, I tried to run hello world program using tutorial kart. The link is: Android Programming usingKotlin Tutorial It does not ask to write any code nor does it ask for altering any built in code. I ran it by connecting both by mobile phone and using emulator. Error log when connected to mobile ph: “Session app” Error installing APK Error log file shows : 12:30 PM Gradle build finished in 21s 332ms 12:33 PM Instant Run is not supported on devices with API levels 20 or lower. (Don't show again) 12:33 PM Executing tasks: [:app:assembleDebug] 12:34 PM Gradle build finished in 1m 33s 345ms 12:34 PM Session 'app': Error Installing APK Error log file when connected to emulator: Error log file while running using an emulator (visual studio android 23 arm ph) 12:34 PM Session 'app': Error Installing APK 12:44 PM Executing tasks: [:app:assembleDebug] 12:44 PM Emulator: emulator: WARNING: UpdateCheck: Failure: Error 12:45 PM Emulator: Process finished with exit code -1073741819 (0xC0000005) 12:46 PM Gradle build finished in 2m 0s 438ms Also another run: 12:57 PM Executing tasks: [:app:assembleDebug] 12:57 PM Emulator: emulator: WARNING: UpdateCheck: Failure: Error 12:57 PM Gradle build finished in 10s 856ms 12:58 PM ADB rejected shell command (getprop): closed 12:58 PM Emulator: Process finished with exit code -1073741819 (0xC0000005) Files: activity_main.xml main_activity.kt package com.example.hp.kotlinandroiddemotk import android.support.v7.app.AppCompatActivity import android.os.Bundle class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) } } Some body please guide me. Zulfi. Pete Letkeman Bartender Posts: 1868 81 I like... posted 10 months ago Looks like from the supplied stacktrace that issue you are experiencing is related to "Instant Run". You do not need to have this feature enabled and some devices do not. You stated that you ran this on both an emulator and a physical device, what versions of Android were you running? You may not be aware of this, but Google supplies free tutorials on Android development which can be found here . Google has supplied not only the instructions on how to get started, but usually the code needed and a functional sample project. You may need to update the project to use newer versions of Gradle, but the process is the same for all of the projects that need it. Google has even provided Kotlin code and project resources. “The strongest of all warriors are these two — Time and Patience.” ― Leo Tolstoy, War and Peace Pete Letkeman Bartender Posts: 1868 81 I like... posted 10 months ago I just noticed this line: Error log file while running using an emulator (visual studio android 23 arm ph) Are you using Visual Studio when following along with the tutorial that you initially posted? If there, there very well could be an issue with Visual Studio and you may get better/different results with Android Studio. If you are choosing to stay with Visual Studio, then which version and edition of Visual Studio are you using? “The strongest of all warriors are these two — Time and Patience.” ― Leo Tolstoy, War and Peace Zulfi Khan Ranch Hand Posts: 107 posted 10 months ago Hi Pete Letkeman, I am using Android Studio 3.3. I am getting emulator error: 0xc0000005 which is discussed here How to fix application error 0xc0000005 I am attaching a picture which would tell you the version. I am also attaching 2 pictures caught during running of application.I am not running visual studio along with android studio but I choose the emulator "visual studio android 23 arm ph android-version_coderanch.jpg Run1-screen.jpg Run2-screen.jpg Zulfi Khan Ranch Hand Posts: 107 posted 10 months ago Hi, Visual studio's version is VS2017 Zulfi. Pete Letkeman Bartender Posts: 1868 81 I like... posted 10 months ago I'm using the same version of Android Studio, so I do not think that is the issue. Here are a few things that you could try out: - Create a simple "hello world" app using only Java code. - Make sure that your environment variables are set up correctly as noted here . - Do not use Visual Studio's Android images, but use Android Studio's Android images. - Update your Android SDKs, if there is a update to be had that is. - Try different Android versions like 5, 5.1, 6 etc to see if you get the same result. - Some people have experienced issues with anti-virus software including Windows Defender. So try temporarily disabling them while running Android Studio. - How about your system? Over all is it running as it should? Have you recently run a spyware and adware and virus check? This could be part of the problem. - DANGER/WARNING: You could try the non stable channels of Android Studio, but this may cause problems as well. “The strongest of all warriors are these two — Time and Patience.” ― Leo Tolstoy, War and Peace Zulfi Khan Ranch Hand Posts: 107 posted 10 months ago Hi, I was trying to execute the android application at the following link: Install Android Studio and Run Hello World After step 14, it shows a figure which does not match with mine. Is this a problem? What should i do? Kindly guide me. Zulfi. mismatch-with-fig.jpg Zulfi Khan Ranch Hand Posts: 107 posted 10 months ago Hi, Number 3 component is not matching. Zulfi. given-fig.jpg Pete Letkeman Bartender Posts: 1868 81 I like... posted 10 months ago All is fine. In the example provided on the web the person selected the MainActivity class in Android Studio. In the picture provided by you, you have not. Have you tried the HelloWorld app walk through provided by Google which can be found here ? If you are looking for a learning resource you may be interested in know that Google provides a number of tutorials for Android developers for free along with the required source code found here . Were you able to get past the problem which you posted previously regarding Kotlin? “The strongest of all warriors are these two — Time and Patience.” ― Leo Tolstoy, War and Peace Ever since I found this suit I've felt strange new needs. And a tiny ad: Create Edit Print & Convert PDF Using Free API with Java Post Reply Bookmark Topic Watch Topic New Topic Boost this thread! Similar Threads Android HAX issues? how to pass an array of strings as an argument to a web service "Application has unexpectedly stopped error" when adding onClickListener ERROR [Jsr168Dispatcher] Could not execute action head first, very basic servlet More...
https://coderanch.com/t/695632/android-studio/ide/Running-World-Application-Kotlin
CC-MAIN-2019-22
en
refinedweb
Hey guys. I know little about programming. I have made this code with some help, but there is still a problem with it. I am basically trying to create a random number generator that will calculate the average of 1000 numbers and then go on and produce the average of square of those numbers, the cube, etc, up to power of 15. In this case I think I am missing a bracket around the j loop, but I am not sure where. Can anyone see it? I have to learn to really see the code through as well. Thank you. Code: #include <stdio.h> #include <stdlib.h> #include <time.h> int main (int argc, char *argv[]) { unsigned int iseed = (unsigned int)time(NULL); srand (iseed); int i,average; //defines i and average as integers int j; double x, y; double ran; double sum [15]; for (i=0; i<15; i++) sum [i]=0; for (j=0; j<1000; j++) { //printf ("%u\n", rand ()); x=y=(rand() / (RAND_MAX + 1.0)); for (i=0; i<15; i++) //error here averages less than 1 sum[i]+=y; y=y*x; } printf("The Sum of Random Numbers : %d ", sum); for (i=0; i<15; i++) { average=sum[i]/j; //j values retained from the loop (1000); alternatively: sum[15] printf("The Average of Random Numbers : %d i=%d",average, i); } return 0; }
https://cboard.cprogramming.com/c-programming/129756-random-number-generator-error-printable-thread.html
CC-MAIN-2017-51
en
refinedweb
I'm trying to overload the [] operator, so I made a simple vector class. I was looking through some of the directx headers and how they overloaded the operator. I made a completely const version that returns the value at a certain pos, and a non-const one that returns a pointer to a pos in the array (I think...) Anyway, it sorta works. On my machine it prints V[1] as 15 and V[0] as 34, but the program always crashes and I'm not sure why. Any help would be great, thanks! Here's the code: Code:#include <iostream.h> class CVect { private: int *dat; int len; public: CVect (); CVect (int); CVect (CVect&); ~CVect () {}; const int operator [] (int) const; int get_len (void) const; int& operator [] (int); void set_len (int); }; const int CVect::operator [] (int a) const { return dat [a]; } int& CVect::operator [] (int a) { return *(dat + (a * sizeof (int))); } inline int CVect::get_len (void) const { return len; } inline void CVect::set_len (int l) { len = l; } CVect::CVect () : len (1) { dat = new int (len); } CVect::CVect (int l) : len (l) { dat = new int (l); } int main (void) { CVect V (10); V[1] = 16; V[0] = 34; for (int i = 0; i < V.get_len() - 1; ++i) cout << V[i] << endl; return (0); }
https://cboard.cprogramming.com/cplusplus-programming/22825-overloading-%5B%5D-operator-trouble.html
CC-MAIN-2017-51
en
refinedweb
Help:Collections/Feedback< Help:Collections Wikibooks Collections Create a collection · About printed books · Help for beginners · Help for experts · Questions · Post feedback · All collections Proposal: require javascriptEdit Please make it possible, that javascript is not needed to use this nice service. Thanks! - Added it to their bug tracker. — Mike.lifeguard | talk 23:41, 28 October 2008 (UTC) Question: QuizEdit Is there a way to use the quiz together with collections? For example: it would be nice if the software could show the answers that are in the quiz code in a section after the exercises... But until now, even the questions are not displayed correctly... Helder 00:00, 1 April 2009 (UTC) - As far as I know the quiz extension is not supported by wikibooks. If it was, you should be able to use the standard tricks to have a different on-screen and print version, i.e. <includeonly> and <noinclude> if you use the traditional print version approach and substitution templates if you use collections. --Martin Kraus (talk) 13:31, 1 April 2009 (UTC) Question: image and codeEdit Hi, I have made pdf from page : Fractals/Iterations_in_the_complex_plane/Julia_set Julia set. It looks good. The only problem is that the code is on the image . See for example section "External distance estimation" in pdf file. Here psedocode : "if (LastIteration==IterationMax) then { /* interior of Julia set: color = black */ }...." Is on the image : Julia set : image with C source code. How can I change it ? Regards. --Adam majewski (talk) 07:47, 30 May 2009 (UTC) Bug: Errors in creating ODF bookEdit Trying to createžaliems:_openSUSE gets this error: An error occured on the render server: traceback Traceback (most recent call last): File "/home/pp/local/lib/python2.6/site-packages/mwlib-0.12.13-py2.6-linux-x86_64.egg/mwlib/apps/render.py", line 177, in __call__ writer(env, output=tmpout, status_callback=self.status, **writer_options) File "/home/pp/local/lib/python2.6/site-packages/mwlib-0.12.13-py2.6-linux-x86_64.egg/mwlib/odfwriter.py", line 775, in writer w.writeBook(book, output=output) File "/home/pp/local/lib/python2.6/site-packages/mwlib-0.12.13-py2.6-linux-x86_64.egg/mwlib/odfwriter.py", line 146, in writeBook self.write(e, self.doc.text) 234, in write if not saveAddChild(parent, e): File "/home/pp/local/lib/python2.6/site-packages/mwlib-0.12.13-py2.6-linux-x86_64.egg/mwlib/odfwriter.py", line 191, in saveAddChild p.addElement(c) File "/home/pp/local/lib/python2.6/site-packages/mwlib-0.12.13-py2.6-linux-x86_64.egg/mwlib/odfwriter.py", line 85, in addElement log("ParagraphProxy:addElement() ", e.type, "not allowed in any parents, failed, should have been added to", self.type) AttributeError: Element instance has no attribute 'type' sys.argv=['/home/pp/local/bin/mw-render', '--logfile', '/home/pp/cache/serve/1c/1cd5dd77142f3cd2/mw-render.log.odf', '--error-file', '/home/pp/cache/serve/1c/1cd5dd77142f3cd2/errors.odf', '--status-file', '/home/pp/cache/serve/1c/1cd5dd77142f3cd2/status.odf', '--writer', 'odf', '--output', '/home/pp/cache/serve/1c/1cd5dd77142f3cd2/output.odf', '--pid-file', '/home/pp/cache/serve/1c/1cd5dd77142f3cd2/pid.odf', '--metabook', '/home/pp/cache/serve/1c/1cd5dd77142f3cd2/metabook.json', '--keep-zip', '/home/pp/cache/serve/1c/1cd5dd77142f3cd2/collection.zip', '--config', '', '--template-blacklist', 'MediaWiki:PDF Template Blacklist', '--template-exclusion-category', 'Exclude in print', '--print-template-prefix', 'Spausdinti', '--print-template-pattern', '$1/Print', '--script-extension', '.php', '--language', 'lt'] I found that this related to: - Some links has # symbol - There is some <!-- ... --> markup - Name of article has : symbol But PDF generates sucessfully! Can somebody fix this ODF book creation error? Bug: repeats the first 5 entries in the table of contentsEdit On the first page, the first five items are shown with page numbers twice Pearts (talk) 23:11, 31 July 2010 (UTC) as in Contents Editing Wikitext/Pictures/Images in Containers 43 Editing Wikitext/Tables 58 Editing Wikitext/Tables Ready to Use 70 Editing Wikitext/Making Templates A101 75 Bug: pdf book font is kinda smallEdit the book font look like it's a 8pt font, thats really small, it should be a 10 or 12 point font. Pearts (talk) 23:16, 31 July 2010 (UTC) Images can be improperly positionned in generated PDFEdit Hi, I've generated a PDF form the Blender_3D:_Noob_to_Pro wikibook. Resulting PDF is : here (A4 format). Result is good, except for some pages where images (which appeared centered on the online version) are moved partially outside the right margin in the generated PDF. Example of such page incorreclty generated is Blender_3D:_Noob_to_Pro/Coordinate_Transformations (the 3rd image of the LEM is centered online, but incorrect in the generated PDF). Please help. A.M.Reng. (discuss • contribs) 11:11, 19 August 2011 (UTC) Cannot save collection,using Collections toolEdit I use IE9, and I have been a user here for over a month. I cannot fill in a collection file name for either my namespace or the wiki space -- the input field is disabled. And so is the "submit" button for the field. If I modify the HTML on-the-fly from my browser to fill in the collection name and enable the submit button, then hit the submit button, the save never happens. Yesterday, when I tried this, I got a bunch of wiki errors.--AngelinaBelle (discuss • contribs) 11:25, 19 October 2011 (UTC) - I have filed a bug report for this, as I see it's also been reported at Wikipedia and I was able to reproduce the error when saving. I had to try to save to the Wikibooks namespace, as I was able to fill in the text field for the Wikibooks namespace, but not the user namespace. – Adrignola discuss 14:20, 19 October 2011 (UTC) A few issues with PDF renderEdit I like collections, but the output just isn't up to it at the moment and it looks like I'll have to go back to print versions. You can find the issues here in a collection I've been trying to build:User:Pluke/Collections/Unit2 - <syntaxhighlight> tag not working - passing <syntaxhighlight> to a template causes the template parameter to not be passed correctly, defaulting back to {{{1}}} - You can't have an exercise box that spreads over more than one page - See Boolean gate combination - internal wikipedia links are not highlighted, but present ie. using: [[w:apple|apple]] - inconsistent rendering of CSS / styles - box widths not 100% when they are in wiki view - background colours missing from most css - style formatting of text in tables doesn't seem to work - wikitable display is inconsistent - table caption is displayed incorrectly |+ '''Examples of Boolean Algebra shown in a truth table''' (this may be a result of nested tables not being handled correctly) - transparency on SVGs appears as plain black - <big> tag not working - {{cquote}} rendering is a little clumsy, the speech marks over lap the text Pluke (discuss • contribs) 22:12, 20 December 2011 (UTC) Section NumbersEdit I'm in the process of adding chapter and section numbers for a collection, specifically Wikibooks:Collections/GLSL_Programming_in_Unity. The idea is to hard code chapter and section numbers in that page and to have a template ({{GLSL Programming Unity SectionRef}}) with hard coded chapter and section numbers to produce numbered references in the output for print. Whenever the numbering changes (e.g. when sections are added, removed, or moved around), these two pages but no other pages have to be changed. Is there an easier way to achieve a similar result? --Martin Kraus (discuss • contribs) 22:01, 19 May 2012 (UTC) Positive FeedbackEdit I am not sure whether this is the proper venue for submitting such feedback, but it's the only one I've found so far. I am very impressed with the quality of the output of the PDF generation. I mean, I'm no document expert or anything, but it exceeds anything I expected. Quite excellent. If anyone could pass on my congratulations and my thanks to the people who made the PDF generation system possible, I would be grateful. A job well done. -- 00:39 28 January 2013 (UTC) A request for HTML outputEdit Some time ago I downloaded the wikibook Blender 3D: Noob to Pro. Originally it was in three large HTML files, "Beginner Tutorials", "Advanced Tutorials", and "Miscellaneous Tutorials". This was very convenient and made it very easy to use offline while teaching myself how to use Blender. Unfortunately, in the intervening period some misguided person has spent a lot of effort cutting up the three large pages into what are now 254 small pages, some consisting of only a single paragraph. I'm sure this person meant well and undoubtedly had in mind the oft-repeated saying that webpages should consist of little more than a screenful of data. (I have tried to find the origin of this suggestion that smaller pages are somehow "better". It always seemed to me a rather patronising belief, as if we "ordinary folk" are not capable of maintaing our attention for more than a few minutes at a time. It seems very out of place on the Wikibooks site, where people have deliberately come to look for long-form content.) Sadly, this decimation has made what was a wonderful resource into something completely unusable for offline reading. So I tried today to collect all 254 pages into a downloadable book, with disastrous results. It took about 4 hours going through all the pages to click on the "Add this page to your collection" link at the head of each page. (The hover "Add this page to your collection" links on the main index page don't display.) I finally had the collection ready to be rendered and downloaded. Away it went rendering for what may have been half an hour, then presented me with the link to download the epub. (I intended to unzip the epub later and pull out the HTML files that comprise it.) I clicked the link and I'm not sure how long it took then displaying a blank page (20 minutes?) before finally saying that an error had occurred. I went back to the earlier page and tried downloading again. Another error and a note saying that my collection seems to have been deleted (though I don't think it was). I tried a few more times, including attempting to download as OpenDocument format (I could convert that to HTML later). Interestingly I looked around in the /tmp directory on my machine and found three 13MB files that are incomplete PDF documents with times corresponding to my attempts to download the epub and OpenDocument files... but I never requested PDF. (I've since tried a test on a single page, and the collection process only delivers PDF.) May I request adding HTML format to the book collection formats? It would be much easier to do than the other three formats. PDF is terribly bloated and suited only to printing on paper. OpenDocument format is similar, but at least possible to convert to other formats. The epub format is a conveniently compact reader format, but none of the three formats allow animated gifs or sounds and videos to play. HTML alone is capable of printing, displaying animated gifs and playing sound and video. Can I also request that the policy of slicing pages into ever smaller and smaller pieces be reversed? It is a terribly retrograde step that makes books virtually unusable unless you are lucky enough to have cheap, fast, always-on internet. Most of the planet still has expensive, slow, occasional internet. Remember, this isn't Wikipages or Wikiparagraphs, it is Wikibooks. People come here looking for large chunks of information: books. To serve it up to them in tiny chunks is to sorely underestimate them, and as it did for me today, makes life far more difficult than it need be. It has sadly made Blender 3D: Noob to Pro completely unusable for offline work. It's like tearing the pages out of a paper book and handing them to a reader one at a time as they request them, instead of letting the reader have the whole book to read as they wish. It makes no sense. Miriam e (discuss • contribs) 08:47, 9 December 2013 (UTC) - Splitting the tutorials into smaller pages was done to make it easier to find specific tutorials. Having them all on one page is great for reading through the entire contents, in order, or for reference offline, but it isn't so useful for being able to find the specific thing you're looking up. Also, splitting these into separate pages makes it considerably easier to see which tutorials need to be fleshed out (those with just a single paragraph, for example), which is one of the areas in which this particular book needs lots of improvement. - I agree that HTML export would be useful, though there is one important caveat that isn't noted here. Images don't come with HTML files - with animated GIFs being one of your listed concerns, that's a big deal, here. So it'd have to be an HTML archive of some sort. Still. It'd be useful. - That said, PDF actually does support animated GIFs, audio files, and video. These files can easily be embedded into the PDF. I'm not sure whether the PDF renderer is smart enough to actually do that, but it does seem like a good idea to add if not. HTML Printable VersionEdit If Collections could be output as HTML, than the Collections feature could supersede the current {{printable}} feature, and all forms could easily stay in sync with one another. Pat Hawks (discuss • contribs) 03:29, 25 August 2016 (UTC)
https://en.m.wikibooks.org/wiki/Help:Collections/Feedback
CC-MAIN-2017-51
en
refinedweb