问:
Antd Virtual table fixed header
Based on this documentation https://4x.ant.design/components/table/#components-table-demo-virtual-list I've created VirtualTable component.

import React, { useState, useRef, useEffect } from 'react'
import { Table } from 'antd'
import classNames from 'classnames'
import ResizeObserver from 'rc-resize-observer'
import { VariableSizeGrid as Grid } from 'react-window'

const VirtualTable = (props) => {
  const { columns, scroll } = props
  const [tableWidth, setTableWidth] = useState(0)
  const widthColumnCount = columns.filter(({ width }) => !width).length
  const mergedColumns = columns.map((column) => {
    if (column.width) {
      return column
    }

    return { ...column, width: Math.floor(tableWidth / widthColumnCount) }
  })
  const gridRef = useRef()
  const [connectObject] = useState(() => {
    const obj = {}
    Object.defineProperty(obj, 'scrollLeft', {
      get: () => {
        if (gridRef.current) {
          return gridRef.current?.state?.scrollLeft
        }

        return null
      },
      set: (scrollLeft) => {
        if (gridRef.current) {
          gridRef.current.scrollTo({
            scrollLeft,
          })
        }
      },
    })
    return obj
  })

  const resetVirtualGrid = () => {
    gridRef?.current?.resetAfterIndices({
      columnIndex: 0,
      shouldForceUpdate: true,
    })
  }

  useEffect(() => resetVirtualGrid, [tableWidth])

  const renderVirtualList = (rawData, { scrollbarSize, ref, onScroll }) => {
    ref.current = connectObject
    const totalHeight = rawData.length * 54
    return (
      <Grid
        ref={gridRef}
        className="virtual-grid"
        columnCount={mergedColumns.length}
        columnWidth={(index) => {
          const { width } = mergedColumns[index]
          return totalHeight > scroll.y && index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width
        }}
        height={scroll.y}
        rowCount={rawData.length}
        rowHeight={() => 54}
        width={tableWidth}
        onScroll={({ scrollLeft }) => {
          onScroll({
            scrollLeft,
          })
        }}
      >
        {({ columnIndex, rowIndex, style }) => (

            {mergedColumns[columnIndex].dataIndex !== '' && !mergedColumns[columnIndex].render ? (

 {rawData[rowIndex][mergedColumns[columnIndex].dataIndex]}

            ) : (

                {mergedColumns[columnIndex].render(
                  rawData[rowIndex][mergedColumns[columnIndex].dataIndex],
                  rawData[rowIndex]
                )}

            )}

        )}
      </Grid>
    )
  }

  return (
    <ResizeObserver
      onResize={({ width }) => {
        setTableWidth(width)
      }}
    >

    </ResizeObserver>
  )
}

export default VirtualTable
```

However, when I tried to create a fixed header like this https://4x.ant.design/components/table/#components-table-demo-fixed-header I broke this table.

Any thoughts on how to implement a fixed header for Antd table based on the virtual table?

UPDATE:

I found that ant table based on https://table-react-component.vercel.app/demo/virtual-list but in my case renderVirtualList is not called

Title: Antd Virtual table fixed header

Body:
Based on this documentation https://4x.ant.design/components/table/#components-table-demo-virtual-list I've created VirtualTable component.

import React, { useState, useRef, useEffect } from 'react'
import { Table } from 'antd'
import classNames from 'classnames'
import ResizeObserver from 'rc-resize-observer'
import { VariableSizeGrid as Grid } from 'react-window'

const VirtualTable = (props) => {
  const { columns, scroll } = props
  const [tableWidth, setTableWidth] = useState(0)
  const widthColumnCount = columns.filter(({ width }) => !width).length
  const mergedColumns = columns.map((column) => {
    if (column.width) {
      return column
    }

    return { ...column, width: Math.floor(tableWidth / widthColumnCount) }
  })
  const gridRef = useRef()
  const [connectObject] = useState(() => {
    const obj = {}
    Object.defineProperty(obj, 'scrollLeft', {
      get: () => {
        if (gridRef.current) {
          return gridRef.current?.state?.scrollLeft
        }

        return null
      },
      set: (scrollLeft) => {
        if (gridRef.current) {
          gridRef.current.scrollTo({
            scrollLeft,
          })
        }
      },
    })
    return obj
  })

  const resetVirtualGrid = () => {
    gridRef?.current?.resetAfterIndices({
      columnIndex: 0,
      shouldForceUpdate: true,
    })
  }

  useEffect(() => resetVirtualGrid, [tableWidth])

  const renderVirtualList = (rawData, { scrollbarSize, ref, onScroll }) => {
    ref.current = connectObject
    const totalHeight = rawData.length * 54
    return (
      <Grid
        ref={gridRef}
        className="virtual-grid"
        columnCount={mergedColumns.length}
        columnWidth={(index) => {
          const { width } = mergedColumns[index]
          return totalHeight > scroll.y && index === mergedColumns.length - 1 ? width - scrollbarSize - 1 : width
        }}
        height={scroll.y}
        rowCount={rawData.length}
        rowHeight={() => 54}
        width={tableWidth}
        onScroll={({ scrollLeft }) => {
          onScroll({
            scrollLeft,
          })
        }}
      >
        {({ columnIndex, rowIndex, style }) => (

            {mergedColumns[columnIndex].dataIndex !== '' && !mergedColumns[columnIndex].render ? (

 {rawData[rowIndex][mergedColumns[columnIndex].dataIndex]}

            ) : (

                {mergedColumns[columnIndex].render(
                  rawData[rowIndex][mergedColumns[columnIndex].dataIndex],
                  rawData[rowIndex]
                )}

            )}

        )}
      </Grid>
    )
  }

  return (
    <ResizeObserver
      onResize={({ width }) => {
        setTableWidth(width)
      }}
    >

    </ResizeObserver>
  )
}

export default VirtualTable

However, when I tried to create a fixed header like this https://4x.ant.design/components/table/#components-table-demo-fixed-header I broke this table.

Any thoughts on how to implement a fixed header for Antd table based on the virtual table?

UPDATE:

I found that ant table based on https://table-react-component.vercel.app/demo/virtual-list but in my case renderVirtualList is not called


来源: stackexchange

问:
Have error installing pandas profiling vs code
error with pandas profiling

```<code>Cell In [7], line 8
      6 import seaborn as sns
      7 import os
----> 8 import pandas_profiling as pp

File ~\AppData\Roaming\Python\Python311\site-packages\pandas_profiling\__init__.py:6
      1 """Main module of pandas-profiling.
      2
      3 .. include:: ../../README.md
      4 """
----> 6 from pandas_profiling.controller import pandas_decorator
      7 from pandas_profiling.profile_report import ProfileReport
      8 from pandas_profiling.version import __version__

File ~\AppData\Roaming\Python\Python311\site-packages\pandas_profiling\controller\pandas_decorator.py:4
      1 """This file add the decorator on the DataFrame object."""
      2 from pandas import DataFrame
----> 4 from pandas_profiling.profile_report import ProfileReport
      7 def profile_report(df: DataFrame, **kwargs) -> ProfileReport:
      8     """Profile a DataFrame.
      9
     10     Args:
   (...)
...
----> 8 from pandas.core.base import DataError
     10 from pandas_profiling.config import Settings
     13 class Correlation:

ImportError: cannot import name 'DataError' from 'pandas.core.base' (C:\Users\Asus\AppData\Roaming\Python\Python311\site-packages\pandas\core\base.py)
</code>```

ERROR: Package 'pandas-profiling' requires a different Python: 3.11.1 not in '<3.11,>=3.7

ContentLicense: CC BY-SA 4.0

Body:
error with pandas profiling

Cell In [7], line 8
      6 import seaborn as sns
      7 import os
----> 8 import pandas_profiling as pp

File ~\AppData\Roaming\Python\Python311\site-packages\pandas_profiling\__init__.py:6
      1 """Main module of pandas-profiling.
      2
      3 .. include:: ../../README.md
      4 """
----> 6 from pandas_profiling.controller import pandas_decorator
      7 from pandas_profiling.profile_report import ProfileReport
      8 from pandas_profiling.version import __version__

File ~\AppData\Roaming\Python\Python311\site-packages\pandas_profiling\controller\pandas_decorator.py:4
      1 """This file add the decorator on the DataFrame object."""
      2 from pandas import DataFrame
----> 4 from pandas_profiling.profile_report import ProfileReport
      7 def profile_report(df: DataFrame, **kwargs) -> ProfileReport:
      8     """Profile a DataFrame.
      9
     10     Args:
   (...)
...
----> 8 from pandas.core.base import DataError
     10 from pandas_profiling.config import Settings
     13 class Correlation:

ImportError: cannot import name 'DataError' from 'pandas.core.base' (C:\Users\Asus\AppData\Roaming\Python\Python311\site-packages\pandas\core\base.py)

ERROR: Package 'pandas-profiling' requires a different Python: 3.11.1 not in '<3.11,>=3.7


问:
How to overview .py extension file in pycharm
I’ve unzip my .py file on pycharm and run it but there’s nothing come out? Is it possible to overview the file data inside pycharm? How?

I did try unzipping the file in the pycharm


问:
Include DEF file in compile
I have simple Visual C++  dll project. Project contains .def file that is not included in build. I can write anything in in this file and compiler does not complains. How to make project include def file in compile?

DEF content:

```<code>LIBRARY

EXPORTS

    setSettingDEREncrypt                            @1
</code>```

Title: Include DEF file in compile

Body:
I have simple Visual C++  dll project. Project contains .def file that is not included in build. I can write anything in in this file and compiler does not complains. How to make project include def file in compile?

DEF content:

LIBRARY

EXPORTS

    setSettingDEREncrypt                            @1


问:
How to use first 50 data from hashmap data
I have data on the hashmap, and the data in the hashmap changes every second. Hashmap size will 347 at times and 197 at other times. such as below:

```<code>2022-12-25 16:48:27.140 8081-8081/com.harrysoft.androidbluetoothserial D/ContentValues: rightdatadict size(): 347
2022-12-25 16:48:28.115 8081-8081/com.harrysoft.androidbluetoothserial D/ContentValues: rightdatadict size(): 218
2022-12-25 16:48:29.231 8081-8081/com.harrysoft.androidbluetoothserial D/ContentValues: rightdatadict size(): 194
</code>```

What if I only want to get the first 50 items in the HashMap every second?

I try use this code but it does not work:

Map<String,Object> rightDataDict = new TreeMap<>();
Date date = new Date();
rightDataDict.put(String.valueOf(formatter.format(date)),Arrays.toString(r_data_double_arr));
right_timer.scheduleAtFixedRate(new TimerTask() {
    @Override
    public void run() {
        runOnUiThread(new Runnable() {
            public void run() {
                if(rightDataDict.size()==50){
                    rightDataDict.clear();
                }
            }
        });
    }
},1000, 1000);
```

Body:
I have data on the hashmap, and the data in the hashmap changes every second. Hashmap size will 347 at times and 197 at other times. such as below:

2022-12-25 16:48:27.140 8081-8081/com.harrysoft.androidbluetoothserial D/ContentValues: rightdatadict size(): 347
2022-12-25 16:48:28.115 8081-8081/com.harrysoft.androidbluetoothserial D/ContentValues: rightdatadict size(): 218
2022-12-25 16:48:29.231 8081-8081/com.harrysoft.androidbluetoothserial D/ContentValues: rightdatadict size(): 194

What if I only want to get the first 50 items in the HashMap every second?

I try use this code but it does not work:

Map<String,Object> rightDataDict = new TreeMap<>();
Date date = new Date();
rightDataDict.put(String.valueOf(formatter.format(date)),Arrays.toString(r_data_double_arr));
right_timer.scheduleAtFixedRate(new TimerTask() {
    @Override
    public void run() {
        runOnUiThread(new Runnable() {
            public void run() {
                if(rightDataDict.size()==50){
                    rightDataDict.clear();
                }
            }
        });
    }
},1000, 1000);


问:
How i get the value (content) of a form in html
I wanna get the value of {{q.op1}} in html. How can I fix this?

```<code> <div class="form-check">
     <input class="form-check-input" type="radio" name="answer" id="gridRadios1" value="option1" checked>
     <label class="form-check-label" for="gridRadios1">
            {{q.op1}} # here
     </label>
</div>

</code>```

If I use in views.py request.POST.get(q.op1) I get None but I want the value of the choice.

Body:
I wanna get the value of {{q.op1}} in html. How can I fix this?

     <input class="form-check-input" type="radio" name="answer" id="gridRadios1" value="option1" checked>

            {{q.op1}} # here

If I use in views.py request.POST.get(q.op1) I get None but I want the value of the choice.


问:
how to retain cursor in mask input feild in angular
Retaining cursor in mask input field
I have mask input field phone number, when I updating any number cursor goes at the end ,how to retain it and tried with start and end position</p>


问:
React Redux delay with updating dropdown menu
I have a form with two dropdown menus. One for category, and one for subcategory. I get the category list for the first dropdown based on all my categories in my database - which is working fine. My subcategory list gets populated based on which category is selected in the first dropdown, then is supposed to populate the second dropdown using a multiple select field. The issue I'm having is that there is a delayed response between selecting the category and populating the subcategory field. For example if the category 'Electronics' is preselected, nothing is shown in the subcategory dropdown. Then I'll select 'Household & Essentials' category, but then it shows the subcategories from the electronics section. Then if I switch back to Electronics, it will show Household & Essentials. I'm using a module called react-multiple-dropdown-lite. And to populate the options within this module, it requires a label and value. Coming from my database I have the name (which will be label) and slug (which will be the value).

```<code>import React, { useState, useEffect } from 'react'
import MultiSelect from 'react-multiple-select-dropdown-lite'
import 'react-multiple-select-dropdown-lite/dist/index.css'
import { Link, useNavigate, useParams } from 'react-router-dom'
import { Form, Button, Dropdown } from 'react-bootstrap'
import FormContainer from '../../components/forms/FormContainer'
import { useDispatch, useSelector } from 'react-redux'
import Message from '../../components/Message'
import Loader from '../../components/Loader'
import { listProductDetails, updateProduct } from '../../actions/productActions'
import {
    listCategories,
    listSubcategories,
} from '../../actions/categoryActions'
import { PRODUCT_UPDATE_RESET } from '../../constants/productConstants'

const ProductEditScreen = () => {
    const params = useParams()
    const slug = params.slug

    const [currentCategory, setCurrentCategory] = useState('')
    const [category, setCategory] = useState('')
    const [subcategoriesList, setSubcategoriesList] = useState([])

    const productDetails = useSelector((state) => state.productDetails)
    const { loading, error, product } = productDetails

    const categoryList = useSelector((state) => state.categoryList)
    const {
        loading: loadingCategories,
        error: errorCategories,
        categories,
    } = categoryList

    const subcategoryList = useSelector((state) => state.subcategoryList)
    const {
        loading: loadingSubList,
        error: errorSubList,
        subcategories,
    } = subcategoryList

    const navigate = useNavigate()
    const dispatch = useDispatch()

    useEffect(() => {
        if (successUpdate) {
            dispatch({ type: PRODUCT_UPDATE_RESET })
            navigate('/admin/productlist')
        } else {
            if (!product.name || product.slug != slug) {
                dispatch(listProductDetails(slug))
                dispatch(listCategories())
            } else {                    setCurrentCategory(product.category)
            }
        }
    }, [dispatch, navigate, slug, product, category])

    const generateSubList = () => {
        let s = []
        subcategories.map((sub) => {
            s.push({ label: sub.name, value: sub.slug })
        })
        setSubcategoriesList(s)
    }

    // Handlers
    const submitHandler = (e) => {
        e.preventDefault()
        dispatch(
            updateProduct({
                name,
                slug,
                price,
                images,
                brand,
                description,
                barcode,
                countInStock,
                category,
            })
        )
    }

    const handleCategoryChange = (e) => {
        e.preventDefault()
        setCategory(e.target.value)
        dispatch(listSubcategories(e.target.value))
        generateSubList()
    }

    const handleSubChange = (e) => {
        e.preventDefault()
        console.log(subcategories)
    }

    const onSelectSubcategories = (subcategories) => {
        // TODO
    }

    return (
        <FormContainer>
            {loading ? (
                <Loader />
            ) : error ? (
                <Message variant='danger'>{error}</Message>
            ) : (
                <Form onSubmit={submitHandler}>
                    <Form.Group controlId='category'>
                        <Form.Label>Category</Form.Label>
                        <Form.Select onChange={(e) => handleCategoryChange(e)}>
                            <option value='default'>Choose Category</option>
                            {categories.map((category) => (
                                <option
                                    key={category.slug}
                                    value={category._id}
                                    selected={category._id == currentCategory}
                                >
                                    {category.name}
                                </option>
                            ))}
                        </Form.Select>
                    </Form.Group>
                    <Form.Group controlId='subcategory'>
                        <Form.Label>Subcategories</Form.Label>
                        {/* <Form.Select
                            multiple
                            onChange={(e) => handleSubcategoryChange(e)}
                        >
                            {subcategories.map((sub) => (
                                <option key={sub.slug} value={sub._id}>
                                    {sub.name}
                                </option>
                            ))}
                        </Form.Select> */}
                        <MultiSelect
                            options={subcategoriesList}
                            onChange={(e) => handleSubChange(e)}
                        />
                    </Form.Group>

                </Form>
            )}
        </FormContainer>
    )
}

export default ProductEditScreen
</code>```

The commented section using the <Form.Select> works because I was able to map through subcategories. I've tried doing the same for the  but it just shows up blank as I can't add a label and value to the subcategories using map, which is why I use generateSubList() to help create a new subcategory list with only the label and value. Suggestions?

Body:
I have a form with two dropdown menus. One for category, and one for subcategory. I get the category list for the first dropdown based on all my categories in my database - which is working fine. My subcategory list gets populated based on which category is selected in the first dropdown, then is supposed to populate the second dropdown using a multiple select field. The issue I'm having is that there is a delayed response between selecting the category and populating the subcategory field. For example if the category 'Electronics' is preselected, nothing is shown in the subcategory dropdown. Then I'll select 'Household & Essentials' category, but then it shows the subcategories from the electronics section. Then if I switch back to Electronics, it will show Household & Essentials. I'm using a module called react-multiple-dropdown-lite. And to populate the options within this module, it requires a label and value. Coming from my database I have the name (which will be label) and slug (which will be the value).

import React, { useState, useEffect } from 'react'
import MultiSelect from 'react-multiple-select-dropdown-lite'
import 'react-multiple-select-dropdown-lite/dist/index.css'
import { Link, useNavigate, useParams } from 'react-router-dom'
import { Form, Button, Dropdown } from 'react-bootstrap'
import FormContainer from '../../components/forms/FormContainer'
import { useDispatch, useSelector } from 'react-redux'
import Message from '../../components/Message'
import Loader from '../../components/Loader'
import { listProductDetails, updateProduct } from '../../actions/productActions'
import {
    listCategories,
    listSubcategories,
} from '../../actions/categoryActions'
import { PRODUCT_UPDATE_RESET } from '../../constants/productConstants'

const ProductEditScreen = () => {
    const params = useParams()
    const slug = params.slug

    const [currentCategory, setCurrentCategory] = useState('')
    const [category, setCategory] = useState('')
    const [subcategoriesList, setSubcategoriesList] = useState([])

    const productDetails = useSelector((state) => state.productDetails)
    const { loading, error, product } = productDetails

    const categoryList = useSelector((state) => state.categoryList)
    const {
        loading: loadingCategories,
        error: errorCategories,
        categories,
    } = categoryList

    const subcategoryList = useSelector((state) => state.subcategoryList)
    const {
        loading: loadingSubList,
        error: errorSubList,
        subcategories,
    } = subcategoryList

    const navigate = useNavigate()
    const dispatch = useDispatch()

    useEffect(() => {
        if (successUpdate) {
            dispatch({ type: PRODUCT_UPDATE_RESET })
            navigate('/admin/productlist')
        } else {
            if (!product.name || product.slug != slug) {
                dispatch(listProductDetails(slug))
                dispatch(listCategories())
            } else {                    setCurrentCategory(product.category)
            }
        }
    }, [dispatch, navigate, slug, product, category])

    const generateSubList = () => {
        let s = []
        subcategories.map((sub) => {
            s.push({ label: sub.name, value: sub.slug })
        })
        setSubcategoriesList(s)
    }

    // Handlers
    const submitHandler = (e) => {
        e.preventDefault()
        dispatch(
            updateProduct({
                name,
                slug,
                price,
                images,
                brand,
                description,
                barcode,
                countInStock,
                category,
            })
        )
    }

    const handleCategoryChange = (e) => {
        e.preventDefault()
        setCategory(e.target.value)
        dispatch(listSubcategories(e.target.value))
        generateSubList()
    }

    const handleSubChange = (e) => {
        e.preventDefault()
        console.log(subcategories)
    }

    const onSelectSubcategories = (subcategories) => {
        // TODO
    }

    return (
        <FormContainer>
            {loading ? (
                <Loader />
            ) : error ? (
                <Message variant='danger'>{error}</Message>
            ) : (
                <Form onSubmit={submitHandler}>
                    <Form.Group controlId='category'>
                        <Form.Label>Category</Form.Label>
                        <Form.Select onChange={(e) => handleCategoryChange(e)}>
                            <option value='default'>Choose Category</option>
                            {categories.map((category) => (
                                <option
                                    key={category.slug}
                                    value={category._id}
                                    selected={category._id == currentCategory}
                                >
                                    {category.name}
                                </option>
                            ))}
                        </Form.Select>
                    </Form.Group>
                    <Form.Group controlId='subcategory'>
                        <Form.Label>Subcategories</Form.Label>
                        {/* <Form.Select
                            multiple
                            onChange={(e) => handleSubcategoryChange(e)}
                        >
                            {subcategories.map((sub) => (
                                <option key={sub.slug} value={sub._id}>
                                    {sub.name}
                                </option>
                            ))}
                        </Form.Select> */}
                        <MultiSelect
                            options={subcategoriesList}
                            onChange={(e) => handleSubChange(e)}
                        />
                    </Form.Group>

                </Form>
            )}
        </FormContainer>
    )
}

export default ProductEditScreen

The commented section using the <Form.Select> works because I was able to map through subcategories. I've tried doing the same for the  but it just shows up blank as I can't add a label and value to the subcategories using map, which is why I use generateSubList() to help create a new subcategory list with only the label and value. Suggestions?


问:
How do I add sliders to the Mac menu bar?
I'm using Swing with Kotlin to make a Tetris clone, and I want to use JSliders in the menu bar to control some settings (in this case, how rounded the edges of the pieces' squares are, and the size of the gap between them).

The sliders show up and work as intended when I keep the menu bar in the main frame, but I don't want it there; I want to use the native macOS menu bar at the top of the screen.

The problem is that when I try to add sliders to the macOS menu bar, neither the JSliders nor their associated JLabels show up in it, even though everything else does just fine.

This is how it looks on Windows:

This is how it looks on mac:

I'd like the slider in the mac menu bar to look like this playback slider from vlc:

This is the code I'm using to add the sliders to my menu on both platforms. It produces the results shown above.

This creates a visual preferences menu

```<code>fun createVisualPrefsMenu(): JMenu {
    /* omitted some other menu items for clarity */
    val menu = JMenu("Visual Preferences")
    val gapLabel = JLabel("Gap: " + Theme.gap)
    val gapSlider = JSlider(JSlider.HORIZONTAL, 0, 42, Theme.gap)
    gapSlider.addChangeListener {
        Theme.gap = gapSlider.value // doesn't show up on the menu for some reason
        gapLabel.text = "Gap: " + Theme.gap
    }

    val bevelLabel = JLabel("Roundness: " + Theme.bevelPercent)
    val bevelSlider = JSlider(JSlider.HORIZONTAL, 0, 100, (Theme.bevelPercent * 100).toInt())
    bevelSlider.addChangeListener {
        Theme.bevelPercent = bevelSlider.value.toFloat() / 100 // doesn't show up on the menu for     some reason
        bevelLabel.text = "Roundness: " + Theme.bevelPercent
    }

    menu.add(bevelLabel)
    menu.add(bevelSlider)
    menu.add(gapLabel)
    menu.add(gapSlider)
    return menu
}
</code>```

Which is added to the JMenuBar that this method creates

```<code>private fun createTableMenuBar(): JMenuBar {
    val menuBar = JMenuBar()
    /* omitted some other additions to the menuBar for clarity */
    menuBar.add(createVisualPrefsMenu())
    menuBar.validate()
    return menuBar
}
</code>```

That JMenuBar is then set as the frame's overall JMenuBar

```<code>init {
    /* stuff */
    menuBar = createTableMenuBar() // menuBar is a field
    frame.jMenuBar = menuBar
    /* other stuff */
}
</code>```

This code is called before anything else in my main method. This sets the JMenu and only if the operating system is detected to be macOS.

```<code>fun main() {
    if (SystemInfo.isMacOS) {
        /* stuff */
        System.setProperty("apple.laf.useScreenMenuBar", Theme.hasTransparentWindowBar.toString())
        // hasTransparentWindowBar is true for this demonstration
        /* stuff */
    }

    val g = GraphicsPanel
    g.run()
}
</code>```

Body:
I'm using Swing with Kotlin to make a Tetris clone, and I want to use JSliders in the menu bar to control some settings (in this case, how rounded the edges of the pieces' squares are, and the size of the gap between them).

The sliders show up and work as intended when I keep the menu bar in the main frame, but I don't want it there; I want to use the native macOS menu bar at the top of the screen.

The problem is that when I try to add sliders to the macOS menu bar, neither the JSliders nor their associated JLabels show up in it, even though everything else does just fine.

This is how it looks on Windows:

This is how it looks on mac:

I'd like the slider in the mac menu bar to look like this playback slider from vlc:

This is the code I'm using to add the sliders to my menu on both platforms. It produces the results shown above.

This creates a visual preferences menu

fun createVisualPrefsMenu(): JMenu {
    /* omitted some other menu items for clarity */
    val menu = JMenu("Visual Preferences")
    val gapLabel = JLabel("Gap: " + Theme.gap)
    val gapSlider = JSlider(JSlider.HORIZONTAL, 0, 42, Theme.gap)
    gapSlider.addChangeListener {
        Theme.gap = gapSlider.value // doesn't show up on the menu for some reason
        gapLabel.text = "Gap: " + Theme.gap
    }

    val bevelLabel = JLabel("Roundness: " + Theme.bevelPercent)
    val bevelSlider = JSlider(JSlider.HORIZONTAL, 0, 100, (Theme.bevelPercent * 100).toInt())
    bevelSlider.addChangeListener {
        Theme.bevelPercent = bevelSlider.value.toFloat() / 100 // doesn't show up on the menu for     some reason
        bevelLabel.text = "Roundness: " + Theme.bevelPercent
    }

    menu.add(bevelLabel)
    menu.add(bevelSlider)
    menu.add(gapLabel)
    menu.add(gapSlider)
    return menu
}

Which is added to the JMenuBar that this method creates

private fun createTableMenuBar(): JMenuBar {
    val menuBar = JMenuBar()
    /* omitted some other additions to the menuBar for clarity */
    menuBar.add(createVisualPrefsMenu())
    menuBar.validate()
    return menuBar
}

That JMenuBar is then set as the frame's overall JMenuBar

init {
    /* stuff */
    menuBar = createTableMenuBar() // menuBar is a field
    frame.jMenuBar = menuBar
    /* other stuff */
}

This code is called before anything else in my main method. This sets the JMenu and only if the operating system is detected to be macOS.

fun main() {
    if (SystemInfo.isMacOS) {
        /* stuff */
        System.setProperty("apple.laf.useScreenMenuBar", Theme.hasTransparentWindowBar.toString())
        // hasTransparentWindowBar is true for this demonstration
        /* stuff */
    }

    val g = GraphicsPanel
    g.run()
}


问:
How to use Gnuplot Preview extension?
The Gnuplot Preview extension allows us to preview the plot generated by the gnu script.  The guide says:

```<code>Just open your gnuplot script and use command gnuplot.view.
</code>```

I would like to ask where I can run this gnuplot.view command.  I have tried the terminal but that didn't work.

Title: How to use Gnuplot Preview extension?

Body:
The Gnuplot Preview extension allows us to preview the plot generated by the gnu script.  The guide says:

Just open your gnuplot script and use command gnuplot.view.

I would like to ask where I can run this gnuplot.view command.  I have tried the terminal but that didn't work.


问:
How to update an certain row value using gota dataframe?
I'm trying to parse data from certain server, and need to export it to excel or csv.

before I export, I need to do some post processing such as merging values between parsed data.

for example,

There are two series out of all data.

series#1 - {Name: "MATH", Student:"Zay",Id:"MATH-123", Date:"12/25/2022", Status:"Good"}
series#2 - {Name: "MATH", Student:"Zay",Id:"MATH-124", Date:"12/26/2022", Status:"Bad"}

What I want to do is,

I want to update series#1's Status to

{Name: "MATH", Student:"Zay", Id:"MATH-123,MATH-124", Date:"12/25/2022,12/26/2022", Status:"Bad"}

Id, Date ==> combining with ","
Status ==> changing to latest result

Now I'm using Filter method of DataFrames,

```<code>type MyDataSet struct{
   Name string
   Student string
   Id string
   Date string
   Status string
}

totalDF:=series1_result //overall result dataframe

df := dataframe.LoadStructs(series2_result) //new dataframe which needs to be compared to previous data `totalDF`

length := df.Nrow()

for i:=0;i<length;i++ {
   name:=df.Subset(i).Col("Name")
   student:=df.Subset(i).Col("Student")

   query:= totalDF.Filter(
          dataframe.F {
             Colname:"Name",
             Comparator:series.Eq,
             Comparando:name,
          },
   ).Filter(
      dataframe.F {
           Colname:"Student",
           Comparator:series.Eq,
           Comparando:student,
      }
   )

   if query.Nrow()==0 {
     totalDF = totalDF.Concat(df.Subset(i))
   } else {
     newDF:= dataframe.LoadStructs([]MyDataSet{
      {
         Name:query.Col("Name").String(),
         Student:query.Col("Student").String(),
         Id:query.Col("Id").String()+","+df.Subset(i).Col("Id").String(),
         Date:query.Col("Date").String()+","+df.Subset(i).Col("Date").String(),
         Status:df.Subset(i).Col("Status").String(),
      }
     })
     query.Set(
        series.Ints([]int{0}, newDF) //It's not updated as query was not an pointer
     )
   }
}
</code>```

Even though I updated values on result of query, it's not updated on totalDF

How can I query the data from totalDF and update the data on that totalDF?

How can I get index number of Filtered item using Filter function?

Should I implement search function instead of using Filter function?

I would really appreciate it if you could help me.

Thanks everyone!

Merry Christmas!

*I tried to find out from official docs.
*But every method returns Value, not Pointer.

Body:
I'm trying to parse data from certain server, and need to export it to excel or csv.

before I export, I need to do some post processing such as merging values between parsed data.

for example,

There are two series out of all data.

series#1 - {Name: "MATH", Student:"Zay",Id:"MATH-123", Date:"12/25/2022", Status:"Good"}
series#2 - {Name: "MATH", Student:"Zay",Id:"MATH-124", Date:"12/26/2022", Status:"Bad"}

What I want to do is,

I want to update series#1's Status to

{Name: "MATH", Student:"Zay", Id:"MATH-123,MATH-124", Date:"12/25/2022,12/26/2022", Status:"Bad"}

Id, Date ==> combining with ","
Status ==> changing to latest result

Now I'm using Filter method of DataFrames,

type MyDataSet struct{
   Name string
   Student string
   Id string
   Date string
   Status string
}

totalDF:=series1_result //overall result dataframe

df := dataframe.LoadStructs(series2_result) //new dataframe which needs to be compared to previous data `totalDF`

length := df.Nrow()

for i:=0;i<length;i++ {
   name:=df.Subset(i).Col("Name")
   student:=df.Subset(i).Col("Student")

   query:= totalDF.Filter(
          dataframe.F {
             Colname:"Name",
             Comparator:series.Eq,
             Comparando:name,
          },
   ).Filter(
      dataframe.F {
           Colname:"Student",
           Comparator:series.Eq,
           Comparando:student,
      }
   )

   if query.Nrow()==0 {
     totalDF = totalDF.Concat(df.Subset(i))
   } else {
     newDF:= dataframe.LoadStructs([]MyDataSet{
      {
         Name:query.Col("Name").String(),
         Student:query.Col("Student").String(),
         Id:query.Col("Id").String()+","+df.Subset(i).Col("Id").String(),
         Date:query.Col("Date").String()+","+df.Subset(i).Col("Date").String(),
         Status:df.Subset(i).Col("Status").String(),
      }
     })
     query.Set(
        series.Ints([]int{0}, newDF) //It's not updated as query was not an pointer
     )
   }
}

Even though I updated values on result of query, it's not updated on totalDF

How can I query the data from totalDF and update the data on that totalDF?

How can I get index number of Filtered item using Filter function?

Should I implement search function instead of using Filter function?

I would really appreciate it if you could help me.

Thanks everyone!

Merry Christmas!

*I tried to find out from official docs.
*But every method returns Value, not Pointer.


问:
What is the ID of the 'MessageReceived' sound on macOS?
I'm trying to use the 'ReceivedMessage' sound on macOS using AudioServicesPlaySystemSound() but I can't seem to find the ID anywhere.
What I've tried:

I've looked under /System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds and couldn't find it either - although MessageSent is there.

I've tried AudioServicesPlaySystemSound(1003) as well following this link but that just results in silence. Any help would be greatly appreciated!

I've tried looking in Messages > Show Package Contents which only led to more disappointment.

I found the file here but I was a hoping to just link to it directly rather than including the .caf file in my app bundle.


问:
How to fetch data from url with changing key in Dart?
I want to fetch the Artificial brightness data from this Website: https://www.lightpollutionmap.info/  in Dart.

If you click on the map it sends a get request to another url that looks something like this:
https://www.lightpollutionmap.info/QueryRaster/?qk=MTY3MTk1Nzk2NjUwNztpc3Vja2RpY2tzOik=&ql=wa_2015&qt=point&qd=14.850636168450944,50.09611381452743

My question is, how can I get the qk part, it seems to be different every time you click on the map?

My Code currently looks like this:

```<code>Future initiate() async {
  var client = Client();
  Response response = await client.get(
      "https://www.lightpollutionmap.info/QueryRaster/?qk=MTY3MTk1Nzk2NjUwNztpc3Vja2RpY2tzOik=&ql=wa_2015&qt=point&qd=14.850636168450944,50.09611381452743");

  print(response.body.toString());
 }
</code>```

Body:
I want to fetch the Artificial brightness data from this Website: https://www.lightpollutionmap.info/  in Dart.

If you click on the map it sends a get request to another url that looks something like this:
https://www.lightpollutionmap.info/QueryRaster/?qk=MTY3MTk1Nzk2NjUwNztpc3Vja2RpY2tzOik=&ql=wa_2015&qt=point&qd=14.850636168450944,50.09611381452743

My question is, how can I get the qk part, it seems to be different every time you click on the map?

My Code currently looks like this:

Future initiate() async {
  var client = Client();
  Response response = await client.get(
      "https://www.lightpollutionmap.info/QueryRaster/?qk=MTY3MTk1Nzk2NjUwNztpc3Vja2RpY2tzOik=&ql=wa_2015&qt=point&qd=14.850636168450944,50.09611381452743");

  print(response.body.toString());
 }


问:
How isPresented of view.sheet becomes false?
I study cs193p, and there's question considering Lesson 12. here's the code snippet

```<code>    func body(for palette: Palette) -> some View {
        HStack {
            Text(palette.name)
            ScrollingEmojisView(emojis: palette.emojis)
                .font(.system(size: emojiFontSize))
        }
        .id(palette.id)
        .transition(rollTransition)
        .popover(item: $paletteToEdit) { palette in
            PaletteEditor(palette: $store.palettes[palette])
        }
        .sheet(isPresented: $managing, onDismiss: {
            print("dismiss: \(managing)")
        }) {
            PaletteManager()
        }
    }

    @State private var managing = false
</code>```

The managing is controlled by a button to set it to true. After set managing to true, a sheet will be shown. And after click somewhere the sheet dismiss.
in console it prints dismiss: false

The question is i don't set the managing, so there must somewhere to set it to false. I guess this is in the sheet implementation code. but i cannot find it.

So the question is: where to set the managing to false, what's the mechanism.

Body:
I study cs193p, and there's question considering Lesson 12. here's the code snippet

    func body(for palette: Palette) -> some View {
        HStack {
            Text(palette.name)
            ScrollingEmojisView(emojis: palette.emojis)
                .font(.system(size: emojiFontSize))
        }
        .id(palette.id)
        .transition(rollTransition)
        .popover(item: $paletteToEdit) { palette in
            PaletteEditor(palette: $store.palettes[palette])
        }
        .sheet(isPresented: $managing, onDismiss: {
            print("dismiss: \(managing)")
        }) {
            PaletteManager()
        }
    }

    @State private var managing = false

The managing is controlled by a button to set it to true. After set managing to true, a sheet will be shown. And after click somewhere the sheet dismiss.
in console it prints dismiss: false

The question is i don't set the managing, so there must somewhere to set it to false. I guess this is in the sheet implementation code. but i cannot find it.

So the question is: where to set the managing to false, what's the mechanism.


问:
Django HttpRequest object not getting the json parameter
I have been trying to parse the request object to get the json parameters but that json is not passing into the request object

this is my client side, where I am requesting with json.

```<code>import requests

endpoint = 'http://127.0.0.1:8000/api'

get_response = requests.get(endpoint, params={"abc":345}, json={"query":"hi, this is what you are lookig for!"} )

print(get_response.json())
</code>```

and this is my view

```<code>from django.http import JsonResponse
import json

def api_home(request, *args, **kwargs):
    body = request.body
    data = {}
    try:
        data = json.loads(body)
    except:
        pass

    print(data)
    return JsonResponse({'message': 'hi there, this is your Django API response'})
</code>```

the output is

```<code>25/Dec/2022 09:41:49] "GET /api?abc=345 HTTP/1.1" 301 0
{}
</code>```

I am expecting to get this data into my view function

```<code>{"query":"hi, this is what you are looking for!"}
</code>```

Body:
I have been trying to parse the request object to get the json parameters but that json is not passing into the request object

this is my client side, where I am requesting with json.

import requests

endpoint = 'http://127.0.0.1:8000/api'

get_response = requests.get(endpoint, params={"abc":345}, json={"query":"hi, this is what you are lookig for!"} )

print(get_response.json())

and this is my view

from django.http import JsonResponse
import json

def api_home(request, *args, **kwargs):
    body = request.body
    data = {}
    try:
        data = json.loads(body)
    except:
        pass

    print(data)
    return JsonResponse({'message': 'hi there, this is your Django API response'})

the output is

25/Dec/2022 09:41:49] "GET /api?abc=345 HTTP/1.1" 301 0
{}

I am expecting to get this data into my view function

{"query":"hi, this is what you are looking for!"}


问:
coingecko api returns a response of 400 with [object%20object] in the url
This is my base URL:

```<code>import axios from "axios";

export default axios.create({
  baseURL: "https://api.coingecko.com/api/v3/",
});
</code>```

my initial state

```<code>const initialState = {
  coins: [],
  market: {},
};
</code>```

this is my slice

```<code>export const fetchAsyncHistoricData = createAsyncThunk(
  "coins/fetchAsyncHistoricData",
  async (id, currency, days = 365) => {
    const response = await Api.get(
      `coins/${id}/market_chart?vs_currency=${currency}&days=${days}`
    );
    return response.data;
  }
);
</code>```

Here i'm exportind the data

```<code>export const getMarketData = (state) => state.coins.market;
</code>```

How i'm calling the dispatch in my charts component.

```<code>const Charts = ({ symbol }) => {
  const [days, setDays] = useState(1);
  const currency = useSelector((state) => state.currencyFilter.currency);

  console.log(" ~ file: Charts.jsx:9 ~ symbol", symbol);

  console.log(" ~ file: Charts.jsx:9 ~ currency", typeof currency);

  const dispatch = useDispatch();

  const [loading, setLoading] = useState(false);

  const coinId = useSelector((state) => state.currencyFilter.id);

  useEffect(() => {
    setLoading(true);
    dispatch(fetchAsyncHistoricData(coinId, currency, days));
    setLoading(false);
  }, [dispatch, currency, coinId, days]);

  return loading ? <div>Loading...</div> : <div>Fetched</div>;
};
</code>```

when i try to dispatch for fetching the market is returns a response of 400
https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=[object%20Object]&days=365

ps: typeof currency is a string

i'm exepecting the url to pass currency and days param correctly

Body:
This is my base URL:

import axios from "axios";

export default axios.create({
  baseURL: "https://api.coingecko.com/api/v3/",
});

my initial state

const initialState = {
  coins: [],
  market: {},
};

this is my slice

export const fetchAsyncHistoricData = createAsyncThunk(
  "coins/fetchAsyncHistoricData",
  async (id, currency, days = 365) => {
    const response = await Api.get(
      `coins/${id}/market_chart?vs_currency=${currency}&days=${days}`
    );
    return response.data;
  }
);

Here i'm exportind the data

export const getMarketData = (state) => state.coins.market;

How i'm calling the dispatch in my charts component.

const Charts = ({ symbol }) => {
  const [days, setDays] = useState(1);
  const currency = useSelector((state) => state.currencyFilter.currency);

  console.log(" ~ file: Charts.jsx:9 ~ symbol", symbol);

  console.log(" ~ file: Charts.jsx:9 ~ currency", typeof currency);

  const dispatch = useDispatch();

  const [loading, setLoading] = useState(false);

  const coinId = useSelector((state) => state.currencyFilter.id);

  useEffect(() => {
    setLoading(true);
    dispatch(fetchAsyncHistoricData(coinId, currency, days));
    setLoading(false);
  }, [dispatch, currency, coinId, days]);

  return loading ?
Loading...
 :
Fetched
;
};

when i try to dispatch for fetching the market is returns a response of 400
https://api.coingecko.com/api/v3/coins/bitcoin/market_chart?vs_currency=[object%20Object]&days=365

ps: typeof currency is a string

i'm exepecting the url to pass currency and days param correctly


问:
Publish Branch to Master without another branch changes - Github
I have one issue regarding git. I hope you can understand.

There is two branches from develop.

feature-login

roles-permission

Now roles-permission branch is developed perfectly with database changes and all the things. But we don't want to deploy it on develop.

Now we are working on feature-login branch and we want to pull roles-permission branch. So I can pull this branch. But if we are going to deploy only feature-login branch than the changes of roles-permission branch is also deploy. So we don't require this thing. I want only feature-login changes.

So Can anyone help me with this. I hope you all understand this question.


问:
classNotFoundException in maven multi module project
I have maven multi module project. where module A added module B as it's dependency,

module A pom :-

```<code><dependency>
     <groupId>com.xxx.xxxx</groupId>
     <artifactId>module-B</artifactId>
     <version>${project.version}</version>
</dependency>
</code>```

module B added one dependency,

```<code><dependency>
    <groupId>com.sybase.jconnect</groupId>
    <artifactId>jconn4</artifactId>
    <version>7.07-27307</version>
</dependency>
</code>```

Both the jars for module A and B are packaged in JAR with maven-assembly-plugin. Both the jars A.jar and B.jar are present in classpath. As the lib folder containing these jars is given in -classpath argument.

module A starts as a web service and uses some functionality present in module B. module B in turn loads some classes dynamically present in com.sybase.jconnect dependency.

when checked module A jar I can see com.sybase.jconnect jar. when it is added as dependency in module B then why it is added in module A jar ?

same dependency is not present in module B jar. why ?

when same setup is running on jdk8 it runs fine but on jdk11 or jdk17 it gives classNotFoundException  for the class module B tries to load at runtime.

Can someone please help in understanding this and resolving classNotFoundException.

Body:
I have maven multi module project. where module A added module B as it's dependency,

module A pom :-

<dependency>
     <groupId>com.xxx.xxxx</groupId>
     <artifactId>module-B</artifactId>
     <version>${project.version}</version>
</dependency>

module B added one dependency,

<dependency>
    <groupId>com.sybase.jconnect</groupId>
    <artifactId>jconn4</artifactId>
    <version>7.07-27307</version>
</dependency>

Both the jars for module A and B are packaged in JAR with maven-assembly-plugin. Both the jars A.jar and B.jar are present in classpath. As the lib folder containing these jars is given in -classpath argument.

module A starts as a web service and uses some functionality present in module B. module B in turn loads some classes dynamically present in com.sybase.jconnect dependency.

when checked module A jar I can see com.sybase.jconnect jar. when it is added as dependency in module B then why it is added in module A jar ?

same dependency is not present in module B jar. why ?

when same setup is running on jdk8 it runs fine but on jdk11 or jdk17 it gives classNotFoundException  for the class module B tries to load at runtime.

Can someone please help in understanding this and resolving classNotFoundException.


问:
org.hibernate.MappingException: Could not locate CollectionPersister for role : com.jbk.Entity.Product.productName
`Whenever, I try to run below method it is giving above error

```<code>    public static List<Product> productGettingWithSize(int size) {
        Session session = factory.openSession();
        List<Product> list = null;
        try {
            Criteria criteria = session.createCriteria(Product.class);
            criteria.add(Restrictions.sizeEq("productName", size));
            list = criteria.list();
            if (list.isEmpty()) {
                System.out.println("No Data Found..!!");
            } else {
                System.out.println(list);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }
</code>```

So, here in this code in DB productName is REDMI so, I m passing 5 as an size but, I m not getting the expected output.
So could anyone help me regarding this code or Can any anyone Tell how to use Restrictions(Size), all method related to size or can anyone send me the documentation where it is been explained explicitly.
Thank You...!!!

Expecting a solution on This..!!`

Body:
`Whenever, I try to run below method it is giving above error

    public static List<Product> productGettingWithSize(int size) {
        Session session = factory.openSession();
        List<Product> list = null;
        try {
            Criteria criteria = session.createCriteria(Product.class);
            criteria.add(Restrictions.sizeEq("productName", size));
            list = criteria.list();
            if (list.isEmpty()) {
                System.out.println("No Data Found..!!");
            } else {
                System.out.println(list);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return list;
    }

So, here in this code in DB productName is REDMI so, I m passing 5 as an size but, I m not getting the expected output.
So could anyone help me regarding this code or Can any anyone Tell how to use Restrictions(Size), all method related to size or can anyone send me the documentation where it is been explained explicitly.
Thank You...!!!

Expecting a solution on This..!!`


问:
Google Workspace Addon: Do I need a workspace admin account to test AdminDirectorySDK feature?
I am currently trying to make a google workspace Add-on. The Addon will have a feature to browse a list of users using AdminDirectorySDK.

```<code>let page = AdminDirectory.Users?.list({
    query: query,
    domain: "gmail.com", //what domain to use for testing?
    maxResults: 100,
    projection: "full",
    viewType: "domain_public",
  });
</code>```

I want to query users by domain. Do I need a google admin account to use this feature?  From what I understand, you need a domain tied to good workspace account to be able to query users.

Can I somehow test this feature using a basic gmail account? I mean I don't currently own such google account so was hoping if I could avoid setting up a domain just to test this use case.

Also query = 'myemail@gmail.com'

Body:
I am currently trying to make a google workspace Add-on. The Addon will have a feature to browse a list of users using AdminDirectorySDK.

let page = AdminDirectory.Users?.list({
    query: query,
    domain: "gmail.com", //what domain to use for testing?
    maxResults: 100,
    projection: "full",
    viewType: "domain_public",
  });

I want to query users by domain. Do I need a google admin account to use this feature?  From what I understand, you need a domain tied to good workspace account to be able to query users.

Can I somehow test this feature using a basic gmail account? I mean I don't currently own such google account so was hoping if I could avoid setting up a domain just to test this use case.

Also query = 'myemail@gmail.com'


问:
GridView alternate row color depending by group of value in a column
i would to change a gridview row color when the value of a specific column change...

for example... when the ID_PRODUCT column have value=1 then all row with this value=1 in this column must have the same cell style... when the value of this column change have to change also the cell style of all row with have the same value in this column...

How could i do this in VB.NET ?

Actually i use IDE settings for setup alternating row different color but it change every row so is not what i need.

Thanks for your time.

******* UPDATE *******

i used this code for iterate rows on bindingcomplete event.... what i want is the rows colored depending by column 1 value... if different row have the same column1 value so must have the same color, when change the color have to change too...

```<code>For i As Integer = 0 To Me.DataGridViewVistaDatiBase.Rows.Count - 1
        If i = 0 Then '+++ prima riga +++
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.White
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.RoyalBlue
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
        ElseIf i = 1 Then '+++ prima riga +++
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.LightSteelBlue
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.Black
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
        Else
            If CInt(DataGridViewVistaDatiBase.Rows(i).Cells(0).Value) = CInt(DataGridViewVistaDatiBase.Rows(i - 1).Cells(0).Value) Then

                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.White
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.RoyalBlue
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
            Else

                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.LightSteelBlue
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.Black
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
            End If

        End If

    Next
</code>```

Followind debug it run correctly and set the defaultstyle right... but the behaviour is not right... the change of color appear in row not right....

Body:
i would to change a gridview row color when the value of a specific column change...

for example... when the ID_PRODUCT column have value=1 then all row with this value=1 in this column must have the same cell style... when the value of this column change have to change also the cell style of all row with have the same value in this column...

How could i do this in VB.NET ?

Actually i use IDE settings for setup alternating row different color but it change every row so is not what i need.

Thanks for your time.

******* UPDATE *******

i used this code for iterate rows on bindingcomplete event.... what i want is the rows colored depending by column 1 value... if different row have the same column1 value so must have the same color, when change the color have to change too...

For i As Integer = 0 To Me.DataGridViewVistaDatiBase.Rows.Count - 1
        If i = 0 Then '+++ prima riga +++
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.White
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.RoyalBlue
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
        ElseIf i = 1 Then '+++ prima riga +++
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.LightSteelBlue
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.Black
            DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
        Else
            If CInt(DataGridViewVistaDatiBase.Rows(i).Cells(0).Value) = CInt(DataGridViewVistaDatiBase.Rows(i - 1).Cells(0).Value) Then

                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.White
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.RoyalBlue
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
            Else

                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.BackColor = Color.LightSteelBlue
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.ForeColor = Color.Black
                DataGridViewVistaDatiBase.Rows(i).DefaultCellStyle.SelectionBackColor = Color.Red
            End If

        End If

    Next

Followind debug it run correctly and set the defaultstyle right... but the behaviour is not right... the change of color appear in row not right....


问:
HAXM does not support emulating a 64-bit on mac
I'm facing issue with android emulator with any API above 29 or any API x64, BLACK SCREEN

after searching I found that quote

```<code>HAXM driver does not support emulating a 64-bit system image on Intel systems based on Core microarchitecture (Core, Core 2 Duo etc.). All systems based on Nehalem and beyond are supported (Core i3, Core i5 and Core i7 machines).
</code>```

I'm working on
hackintosh opencore montery 12.6
2.11 GHz 12-Core Intel Core i7

is there any solve for this issue ! or I can't work with x64 API any more ?

Body:
I'm facing issue with android emulator with any API above 29 or any API x64, BLACK SCREEN

after searching I found that quote

HAXM driver does not support emulating a 64-bit system image on Intel systems based on Core microarchitecture (Core, Core 2 Duo etc.). All systems based on Nehalem and beyond are supported (Core i3, Core i5 and Core i7 machines).

I'm working on
hackintosh opencore montery 12.6
2.11 GHz 12-Core Intel Core i7

is there any solve for this issue ! or I can't work with x64 API any more ?


问:
Android, updating the recyclerview UI to reflect time in a format I prefer(Kotlin)

The image above is a New's application, to display the news I am using a recyclerview, however I can't seem to get the time format right. For example, I want the time to be shown in minutes if it is less than 60 minutes and in hours if it is more than or equal to 60 minutes.

Here is the code in my recyclerview adapter.

```<code>            val currentTimeInHours = Instant.now().atZone(ZoneId.of("Asia/Kolkata"))

        val newsTimeInHours = Instant.parse(time).atZone(ZoneId.of("Asia/Kolkata"))

        val hoursDifference = Duration.between(currentTimeInHours, newsTimeInHours)

val hoursAgos = if(hoursDifference.toMinutes() < 60){
                hoursDifference.toMinutes().toString().substring(1) + " minutes ago"
            }else{
             hoursDifference.toHours().toString().substring(1) + " hour ago"
            }

//Assigning the logic to the textview
holder.tvPublishedAt.text = hoursAgos
</code>```

All of these code is located in the onbindviewholder method within the adapter.

Body:
The image above is a New's application, to display the news I am using a recyclerview, however I can't seem to get the time format right. For example, I want the time to be shown in minutes if it is less than 60 minutes and in hours if it is more than or equal to 60 minutes.

Here is the code in my recyclerview adapter.

            val currentTimeInHours = Instant.now().atZone(ZoneId.of("Asia/Kolkata"))

        val newsTimeInHours = Instant.parse(time).atZone(ZoneId.of("Asia/Kolkata"))

        val hoursDifference = Duration.between(currentTimeInHours, newsTimeInHours)

val hoursAgos = if(hoursDifference.toMinutes() < 60){
                hoursDifference.toMinutes().toString().substring(1) + " minutes ago"
            }else{
             hoursDifference.toHours().toString().substring(1) + " hour ago"
            }

//Assigning the logic to the textview
holder.tvPublishedAt.text = hoursAgos

All of these code is located in the onbindviewholder method within the adapter.


问:
using mongodb and express , i created a crud api for a taskmanager app,but getting error in dispalying it using fetch api method
in fetch api method ,for each loop is throwing error
it seeems json data in api in which for each method is not applicable.pls help</p>
```<code>const postslist = document.querySelector('postslist')

    fetch('http://localhost:3000/api/v1/tasks')
    .then(resp => resp.json())
    .then(data => {
      data.forEach(task => {
        console.log(task)
        postslist.innerHTML += `
       <div class="card">
       <h3>${task.name}</h3>

            <button class="Edit-btn">Edit</button>
            <button class="delete-btn">Delete</button>
       </div>
      `

    } )
  })

</code>```

Body:
in fetch api method ,for each loop is throwing error
it seeems json data in api in which for each method is not applicable.pls help

const postslist = document.querySelector('postslist')

    fetch('http://localhost:3000/api/v1/tasks')
    .then(resp => resp.json())
    .then(data => {
      data.forEach(task => {
        console.log(task)
        postslist.innerHTML += `

${task.name}

            <button class="Edit-btn">Edit</button>
            <button class="delete-btn">Delete</button>

      `

    } )
  })


问:
Using tweepy with elevated access to scrape tweets by a list of handles in a time frame

I currently have a list of twitter handles that I would like to scrape tweets from in a certain period of time (about a year) using tweepy. I have elevated access to Twitter API but I am new to this and have failed using many methods.

For expample, I tried using Cursor with api.search_full_archive, but it seemed like it was for premium users only.

I have also tried to scrape them with tweepy.Client, but it kept saying that I don't have access (401 unauthorized).
It would be really helpful if someone could provide a sample code.

Thank you.


问:
Image and Hitbox in pygame
Pic 1 and 2 are animation skill of player. How can I create a hitbox like Pic 3 when collide with wall, floor, ...? Pic 4 is problem I got

Moreover, when player face to the left, the Image of player turns over and Character appear in  different position its like Pic 5. I want when I face to the left, the Character stand still

1:

2:

3:

4:

5:

My sprites code:

```<code>import pygame
from settings import *
from pygame.math import Vector2 as vecto
from support import import_folder
from pygame.transform import scale
from pygame.transform import flip

class Player(pygame.sprite.Sprite):
    def __init__(self, pos, group, collision_group):
        super().__init__(group)
        # self.image = scale(self.animations['right'][0], (64, 64))
        self.image = pygame.image.load('../Fantasy/img/player/right/right.png')
        self.rect = self.image.get_rect(topleft = pos)
        self.import_player_assets()

        #player movement
        self.direction = vecto()
        self.speed = 8
        self.gravity = 0.8
        self.jump_speed = 16

        self.status = 'right'
        self.frame_index = 0
        self.animation_speed = 0.15

        self.collsion_group = collision_group
        self.on_floor = False

        self.isRight = True
        self.attacking = False

        self.attack_time = None
        self.attack_cooldown = 400
    def import_player_assets(self):
        player_path = '../Fantasy/img/player/'
        self.animations = {'left':[],'left_idle':[],'right':[],'right_idle':[],'move': [], 'right_attack': [], 'left_attack':[], 'get_hit': [], 'die': []}

        for animation in self.animations.keys():
            full_path = player_path + animation
            self.animations[animation] = import_folder(full_path)

    def get_status(self):
        if self.direction.x == 0 and self.direction.y == 0:
            if not 'idle' in self.status and not 'attack' in self.status:
                self.status = self.status + '_idle'

        if self.attacking:
            self.direction.x = 0
            self.direction.y = 0
            if not 'attack' in self.status:
                if 'idle' in self.status:
                    self.status =self.status.replace('idle', 'attack')
                else:
                    self.status = self.status + '_attack'

        else:
            self.status = self.status.replace('_attack', '')

    def animate(self):
        animation = self.animations[self.status]

        self.frame_index += self.animation_speed

        if self.frame_index >= len(animation):
            self.frame_index = 0

        self.image = animation[int(self.frame_index)]
        self.display_surface = pygame.display.get_surface()

    def input(self):
        if not self.attacking:
        #move left and right
            key = pygame.key.get_pressed()
            if key[pygame.K_LEFT]:
                self.direction.x = -1
                self.status = 'left'
            elif key[pygame.K_RIGHT]:
                self.direction.x = 1
                self.status = 'right'
            else: self.direction.x = 0

            # jump
            if key[pygame.K_SPACE] and self.on_floor:
                self.direction.y -= self.jump_speed

            #attack
            if key[pygame.K_c] and not self.attacking:
                self.attacking = True
                self.attack_time = pygame.time.get_ticks()
    def move(self):
        self.rect.x += self.direction.x * self.speed

    def att_cooldown(self):
        current_time = pygame.time.get_ticks()
        if self.attacking:
            if current_time - self.attack_time >= self.attack_cooldown:
                self.attacking = False
    def horizontal_collision(self):
        for sprite in self.collsion_group.sprites():
            if sprite.rect.colliderect(self.rect):
                if self.direction.x < 0:
                    self.rect.left = sprite.rect.right
                if self.direction.x > 0:
                    self.rect.right = sprite.rect.left
    def vertical_collision(self):
        for sprite in self.collsion_group.sprites():
            if sprite.rect.colliderect(self.rect):
                if self.direction.y < 0:
                    self.rect.top = sprite.rect.bottom
                    self.direction.y = 0
                if self.direction.y > 0:
                    self.rect.bottom = sprite.rect.top
                    self.on_floor = True
                    self.direction.y = 0
        if self.on_floor and self.direction.y != 0:
            self.on_floor = False
    def apply_gravity(self):
        self.direction.y += self.gravity
        self.rect.y += self.direction.y

    def update(self):
        self.input()
        self.move()
        self.horizontal_collision()
        self.apply_gravity()
        self.vertical_collision()
        self.get_status()
        self.animate()
        self.att_cooldown()

class Tile(pygame.sprite.Sprite):
    def __init__(self, pos, group):
        super().__init__(group)
        self.image = pygame.Surface((TILE_SIZE, TILE_SIZE))
        self.image.fill(TILE_COLOR)
        self.rect = self.image.get_rect(topleft = pos)

</code>```

Title: Image and Hitbox in pygame

Body:
Pic 1 and 2 are animation skill of player. How can I create a hitbox like Pic 3 when collide with wall, floor, ...? Pic 4 is problem I got

Moreover, when player face to the left, the Image of player turns over and Character appear in  different position its like Pic 5. I want when I face to the left, the Character stand still

1:

2:

3:

4:

5:

My sprites code:

import pygame
from settings import *
from pygame.math import Vector2 as vecto
from support import import_folder
from pygame.transform import scale
from pygame.transform import flip

class Player(pygame.sprite.Sprite):
    def __init__(self, pos, group, collision_group):
        super().__init__(group)
        # self.image = scale(self.animations['right'][0], (64, 64))
        self.image = pygame.image.load('../Fantasy/img/player/right/right.png')
        self.rect = self.image.get_rect(topleft = pos)
        self.import_player_assets()

        #player movement
        self.direction = vecto()
        self.speed = 8
        self.gravity = 0.8
        self.jump_speed = 16

        self.status = 'right'
        self.frame_index = 0
        self.animation_speed = 0.15

        self.collsion_group = collision_group
        self.on_floor = False

        self.isRight = True
        self.attacking = False

        self.attack_time = None
        self.attack_cooldown = 400
    def import_player_assets(self):
        player_path = '../Fantasy/img/player/'
        self.animations = {'left':[],'left_idle':[],'right':[],'right_idle':[],'move': [], 'right_attack': [], 'left_attack':[], 'get_hit': [], 'die': []}

        for animation in self.animations.keys():
            full_path = player_path + animation
            self.animations[animation] = import_folder(full_path)

    def get_status(self):
        if self.direction.x == 0 and self.direction.y == 0:
            if not 'idle' in self.status and not 'attack' in self.status:
                self.status = self.status + '_idle'

        if self.attacking:
            self.direction.x = 0
            self.direction.y = 0
            if not 'attack' in self.status:
                if 'idle' in self.status:
                    self.status =self.status.replace('idle', 'attack')
                else:
                    self.status = self.status + '_attack'

        else:
            self.status = self.status.replace('_attack', '')

    def animate(self):
        animation = self.animations[self.status]

        self.frame_index += self.animation_speed

        if self.frame_index >= len(animation):
            self.frame_index = 0

        self.image = animation[int(self.frame_index)]
        self.display_surface = pygame.display.get_surface()

    def input(self):
        if not self.attacking:
        #move left and right
            key = pygame.key.get_pressed()
            if key[pygame.K_LEFT]:
                self.direction.x = -1
                self.status = 'left'
            elif key[pygame.K_RIGHT]:
                self.direction.x = 1
                self.status = 'right'
            else: self.direction.x = 0

            # jump
            if key[pygame.K_SPACE] and self.on_floor:
                self.direction.y -= self.jump_speed

            #attack
            if key[pygame.K_c] and not self.attacking:
                self.attacking = True
                self.attack_time = pygame.time.get_ticks()
    def move(self):
        self.rect.x += self.direction.x * self.speed

    def att_cooldown(self):
        current_time = pygame.time.get_ticks()
        if self.attacking:
            if current_time - self.attack_time >= self.attack_cooldown:
                self.attacking = False
    def horizontal_collision(self):
        for sprite in self.collsion_group.sprites():
            if sprite.rect.colliderect(self.rect):
                if self.direction.x < 0:
                    self.rect.left = sprite.rect.right
                if self.direction.x > 0:
                    self.rect.right = sprite.rect.left
    def vertical_collision(self):
        for sprite in self.collsion_group.sprites():
            if sprite.rect.colliderect(self.rect):
                if self.direction.y < 0:
                    self.rect.top = sprite.rect.bottom
                    self.direction.y = 0
                if self.direction.y > 0:
                    self.rect.bottom = sprite.rect.top
                    self.on_floor = True
                    self.direction.y = 0
        if self.on_floor and self.direction.y != 0:
            self.on_floor = False
    def apply_gravity(self):
        self.direction.y += self.gravity
        self.rect.y += self.direction.y

    def update(self):
        self.input()
        self.move()
        self.horizontal_collision()
        self.apply_gravity()
        self.vertical_collision()
        self.get_status()
        self.animate()
        self.att_cooldown()

class Tile(pygame.sprite.Sprite):
    def __init__(self, pos, group):
        super().__init__(group)
        self.image = pygame.Surface((TILE_SIZE, TILE_SIZE))
        self.image.fill(TILE_COLOR)
        self.rect = self.image.get_rect(topleft = pos)


问:
css-iframe determine location
I just started studying CSS
I'm trying to upload the video to the top of the page but I can't
Would appreciate help

Would appreciate help
`

```<code><div class="video">
        <iframe
          width="560"
          height="315"
          src="https://www.youtube.com/embed/YhK8tIfyVwI"
          frameborder="0"
          allow=" autoplay;  picture-in-picture"
          allowfullscreen
        ></iframe>
      </div>
</code>```

`

Title: css-iframe determine location


问:
How do I solve fultter app not installed in my device?
I'm getting a prompt on my mobile device asking if I want to install the app on my device. I give yes, then nothing happens! for the first time and the app never installed before

I tried to use the cmd to connect my mobile device , I tried to restart my device and I've done the same steps in my device setting again


问:
Svelte + Tailwind: "Semicolon or block is expected"
I have a Svelte project using Tailwind, with this style in a component:

```<code><style global lang="postcss">
  input {
    @apply block border-black border-2 mb-4 p-2 outline-none focus:border-blue-500;
  }
</style>
</code>```

The error that I'm getting, caused by the focus: class:

```<code>Semicolon or block is expected
</code>```

My postcss.config.cjs file:

```<code>import tailwind from 'tailwindcss'
import tailwindConfig from './tailwind.config.cjs'
import autoprefixer from 'autoprefixer'

export default {
  plugins: [tailwind(tailwindConfig), autoprefixer]
}
</code>```

tailwind.config.cjs:

```<code>/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    extend: {},
  },
  plugins: [],
  content: ["./index.html", './src/**/*.{svelte,js,ts}'], // for unused CSS
  variants: {
    extend: {},
  },
  darkMode: 'media', // or 'media' or 'class'
}
</code>```

vite.config.js:

```<code>import postcss from './postcss.config.cjs'
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [svelte()],
  css: {
    postcss
  }
})
</code>```

Body:
I have a Svelte project using Tailwind, with this style in a component:

The error that I'm getting, caused by the focus: class:

Semicolon or block is expected

My postcss.config.cjs file:

import tailwind from 'tailwindcss'
import tailwindConfig from './tailwind.config.cjs'
import autoprefixer from 'autoprefixer'

export default {
  plugins: [tailwind(tailwindConfig), autoprefixer]
}

tailwind.config.cjs:

/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    extend: {},
  },
  plugins: [],
  content: ["./index.html", './src/**/*.{svelte,js,ts}'], // for unused CSS
  variants: {
    extend: {},
  },
  darkMode: 'media', // or 'media' or 'class'
}

vite.config.js:

import postcss from './postcss.config.cjs'
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [svelte()],
  css: {
    postcss
  }
})


问:
is there someone who can clarify this error assignment to expression with array type
find my code down

```<code>#include<stdlib.h>
main()
{

    int BT[15]={0};
    int TAT[15]={0};
    int WT[15]={0};
    int P[15]={0};
    int pos=0;
    int i=0;
    int n=0;
    int temp=0;
    int j=0;
    system("clear");
    printf("\nEnter no.of processes:");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        printf("\nEnter P[%d] burst time:",i+1);
        scanf("%d",&BT[i]);
        P[i]=i+1;
    }
    for(i=0;i<n;i++)
    {
        pos=i;
        for(j=i+1;j<n;j++)
        {
            if(BT[j]<BT[pos])
                pos=j;
        }
        temp=BT[i];
        BT[i]=BT[pos];
        BT[pos]=temp;
        temp=P[i];
        P[i]=P[pos];
        P[pos]=temp;
    }
    WT[0]=0;
    for(i=1;i<n;i++)
    {
        WT[i]=0;
        for(j=0;j<i;j++)
            WT[i]+=BT[j];
    }
    printf("\nProcess \t BurstTime \t WT \t TAT\n");
    for(i=0;i<n;i++)
    {
        TAT+=WT[i]+BT[i];
        printf("\nP%d\t\t %d\t\t %d\t\t %d",P[i],BT[i],WT[i],TAT[i]);
    }

}
</code>```

the error is on TAT+=WT[i] + BT[i];
and all my variables are arrays but i don't why i'm getting this error, i tried to manipulated the other variables, to see if i'll find a solution but i did not.
can you please show or help me for this error

Body:
find my code down

#include<stdlib.h>
main()
{

    int BT[15]={0};
    int TAT[15]={0};
    int WT[15]={0};
    int P[15]={0};
    int pos=0;
    int i=0;
    int n=0;
    int temp=0;
    int j=0;
    system("clear");
    printf("\nEnter no.of processes:");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        printf("\nEnter P[%d] burst time:",i+1);
        scanf("%d",&BT[i]);
        P[i]=i+1;
    }
    for(i=0;i<n;i++)
    {
        pos=i;
        for(j=i+1;j<n;j++)
        {
            if(BT[j]<BT[pos])
                pos=j;
        }
        temp=BT[i];
        BT[i]=BT[pos];
        BT[pos]=temp;
        temp=P[i];
        P[i]=P[pos];
        P[pos]=temp;
    }
    WT[0]=0;
    for(i=1;i<n;i++)
    {
        WT[i]=0;
        for(j=0;j<i;j++)
            WT[i]+=BT[j];
    }
    printf("\nProcess \t BurstTime \t WT \t TAT\n");
    for(i=0;i<n;i++)
    {
        TAT+=WT[i]+BT[i];
        printf("\nP%d\t\t %d\t\t %d\t\t %d",P[i],BT[i],WT[i],TAT[i]);
    }

}

the error is on TAT+=WT[i] + BT[i];
and all my variables are arrays but i don't why i'm getting this error, i tried to manipulated the other variables, to see if i'll find a solution but i did not.
can you please show or help me for this error


问:
hashicorp nomad .. why my app is not connecting to the database (Postgres , golang api) provider="nomad"
Help required.. I tried in many ways but unfortunately app is not connecting to the database.
DB_CONN is the env variable that app is expecting

service provider is nomad.
so it must be a simple service discovery. Created two groups in same job file,infact I tried differently as well but it did not work.

```<code>variable "datacenters" {
  description = "A list of datacenters in the region which are eligible for task placement."
  type        = list(string)
  default     = ["dc1"]
}

variable "region" {
  description = "The region where the job should be placed."
  type        = string
  default     = "global"
}

variable "postgres_db" {
  description = "Postgres DB name"
  default     = "vehicle_master_bd"
}

variable "postgres_user" {
  description = "Postgres DB User"
  default     = "postgres"
}

variable "postgres_password" {
  description = "Postgres DB Password"
  default     = "postgres"
}

# Begin Job Spec
job "cres-vehicleMaster" {
  type        = "service"
  region      = var.region
  datacenters = var.datacenters
  group "db" {
    network {
      port "db" {
        to = 5432
      }
    }

    task "postgres" {
      driver = "docker"

      meta {
        service = "database"
      }
      service {
        name     = "database"
        port     = "db"
        provider = "nomad"
      }
      config {
        image = "postgres"
        ports = ["db"]
      }
      resources {
        cpu    = 500
        memory = 500
      }
      env {

        POSTGRES_DB       = var.postgres_db
        POSTGRES_USER     = var.postgres_user
        POSTGRES_PASSWORD = var.postgres_password
      }
    }
  }
  group "vehicleMaster-api" {
    count = 1
    network {
      port "api" {
        to = 50080
      }
    }

    restart {
      attempts = 2
      interval = "30m"
      delay    = "15s"
      mode     = "fail"
    }

    task "vehicleMaster-api" {
      driver = "docker"
      service {
        name     = "vehicleMaster-api"
        tags     = ["vehicleMaster", "RESTAPI"]
        port     = "api"
        provider = "nomad"
      }
      template {
        data        = <<EOH
{{ range nomadService "database" }}
DB_CONN="host={{ .Address }} port={{ .Port }} user=${var.postgres_user} password=${var.postgres_password} dbname=${var.postgres_db} sslmode=disable"
{{ end }}
EOH
        destination = "local/env.txt"
        env         = true
      }
      env {
        // DB_CONN = "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=vehicle_master_bd sslmode=disable"
        // DB_CONN = "host=${NOMAD_IP_postgres} port=${NOMAD_PORT_postgres} user=${var.postgres_user} password=${var.postgres_password} dbname=${var.postgres_db} sslmode=disable"
        PORT    = "50080"
      }
      config {
        image = "jpalaparthi/vehiclemaster:v0.0.3"
        ports = ["api"]
      }
      resources {
        cpu    = 500 # 500 MHz
        memory = 512 # 256MB
      }
    }
  }
}
</code>```

Body:
Help required.. I tried in many ways but unfortunately app is not connecting to the database.
DB_CONN is the env variable that app is expecting

service provider is nomad.
so it must be a simple service discovery. Created two groups in same job file,infact I tried differently as well but it did not work.

variable "datacenters" {
  description = "A list of datacenters in the region which are eligible for task placement."
  type        = list(string)
  default     = ["dc1"]
}

variable "region" {
  description = "The region where the job should be placed."
  type        = string
  default     = "global"
}

variable "postgres_db" {
  description = "Postgres DB name"
  default     = "vehicle_master_bd"
}

variable "postgres_user" {
  description = "Postgres DB User"
  default     = "postgres"
}

variable "postgres_password" {
  description = "Postgres DB Password"
  default     = "postgres"
}

# Begin Job Spec
job "cres-vehicleMaster" {
  type        = "service"
  region      = var.region
  datacenters = var.datacenters
  group "db" {
    network {
      port "db" {
        to = 5432
      }
    }

    task "postgres" {
      driver = "docker"

      meta {
        service = "database"
      }
      service {
        name     = "database"
        port     = "db"
        provider = "nomad"
      }
      config {
        image = "postgres"
        ports = ["db"]
      }
      resources {
        cpu    = 500
        memory = 500
      }
      env {

        POSTGRES_DB       = var.postgres_db
        POSTGRES_USER     = var.postgres_user
        POSTGRES_PASSWORD = var.postgres_password
      }
    }
  }
  group "vehicleMaster-api" {
    count = 1
    network {
      port "api" {
        to = 50080
      }
    }

    restart {
      attempts = 2
      interval = "30m"
      delay    = "15s"
      mode     = "fail"
    }

    task "vehicleMaster-api" {
      driver = "docker"
      service {
        name     = "vehicleMaster-api"
        tags     = ["vehicleMaster", "RESTAPI"]
        port     = "api"
        provider = "nomad"
      }
      template {
        data        = <<EOH
{{ range nomadService "database" }}
DB_CONN="host={{ .Address }} port={{ .Port }} user=${var.postgres_user} password=${var.postgres_password} dbname=${var.postgres_db} sslmode=disable"
{{ end }}
EOH
        destination = "local/env.txt"
        env         = true
      }
      env {
        // DB_CONN = "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=vehicle_master_bd sslmode=disable"
        // DB_CONN = "host=${NOMAD_IP_postgres} port=${NOMAD_PORT_postgres} user=${var.postgres_user} password=${var.postgres_password} dbname=${var.postgres_db} sslmode=disable"
        PORT    = "50080"
      }
      config {
        image = "jpalaparthi/vehiclemaster:v0.0.3"
        ports = ["api"]
      }
      resources {
        cpu    = 500 # 500 MHz
        memory = 512 # 256MB
      }
    }
  }
}


问:
CSS class not being applied even when exported react-toolbox
I am using react-toolbox and react-css-themr to supply theme. I create my contextTheme and supply it through ThemeProvider. Everything's seems fine. I am using webpack, the styles are exported and loaded in the  attribute of my page, so there is no problem with the importing the css.

EDIT: I can clearly see the context theme is loaded to the website, as I can observe RT objects

my contextTheme file looks like this and is named contextTheme.js

```<code>export default {
  RTAutocomplete: require('./assets/style/themes/autocomplete.module.css'),
  RTButton: require('./assets/style/themes/button.module.css')
};
</code>```

I can see custom theme in  tag like this

```<code>.autocomplete-module--autocomplete--tESXbPMw {
  padding: 0
}

.autocomplete-module--autocomplete--tESXbPMw .autocomplete-module--suggestions--t6ziL7OQ {
    background-color: red;
    border-color: blue;
    border-radius: 0
}
</code>```

theme provider looks like this

```<code>      <ThemeProvider theme={contextTheme}>
        <Router store={s} history={h}>
          { routes }
        </Router>
      </ThemeProvider>
</code>```

resulting html element still has only default style applied, because no style is attached to it.

In case my webpack css config looks like this. I am not sure if that is relevant, but just in case.

```<code>            {
              test: /\.scss|\.css$/i,
              use: [
                "style-loader",
                {
                  loader: "css-loader",
                  options: {
                    importLoaders: 1,
          modules: {
            exportGlobals: true,
            mode: "local",
            auto: undefined,
            localIdentName: "[name]--[local]--[hash:base64:8]",
          },
          sourceMap: shouldUseSourceMap,
                  }
                },
                {
                  loader: "postcss-loader",
                  options: {
                    postcssOptions: {
                      plugins: [
                        [
                          "postcss-preset-env",
                          {
                            // Options
                          },
                        ],
                      ],
                    },
                  },
                },
              ],
              sideEffects: true,
            },
</code>```

Body:
I am using react-toolbox and react-css-themr to supply theme. I create my contextTheme and supply it through ThemeProvider. Everything's seems fine. I am using webpack, the styles are exported and loaded in the  attribute of my page, so there is no problem with the importing the css.

EDIT: I can clearly see the context theme is loaded to the website, as I can observe RT objects

my contextTheme file looks like this and is named contextTheme.js

export default {
  RTAutocomplete: require('./assets/style/themes/autocomplete.module.css'),
  RTButton: require('./assets/style/themes/button.module.css')
};

I can see custom theme in  tag like this

.autocomplete-module--autocomplete--tESXbPMw {
  padding: 0
}

.autocomplete-module--autocomplete--tESXbPMw .autocomplete-module--suggestions--t6ziL7OQ {
    background-color: red;
    border-color: blue;
    border-radius: 0
}

theme provider looks like this

      <ThemeProvider theme={contextTheme}>
        <Router store={s} history={h}>
          { routes }
        </Router>
      </ThemeProvider>

resulting html element still has only default style applied, because no style is attached to it.

In case my webpack css config looks like this. I am not sure if that is relevant, but just in case.

            {
              test: /\.scss|\.css$/i,
              use: [
                "style-loader",
                {
                  loader: "css-loader",
                  options: {
                    importLoaders: 1,
          modules: {
            exportGlobals: true,
            mode: "local",
            auto: undefined,
            localIdentName: "[name]--[local]--[hash:base64:8]",
          },
          sourceMap: shouldUseSourceMap,
                  }
                },
                {
                  loader: "postcss-loader",
                  options: {
                    postcssOptions: {
                      plugins: [
                        [
                          "postcss-preset-env",
                          {
                            // Options
                          },
                        ],
                      ],
                    },
                  },
                },
              ],
              sideEffects: true,
            },


问:
Autodesk Forge - out of memory with getBulkProperties
i made an forge viewer dashboard that shows different data from the viewer ( most of it is being analized in the client side)

when i open a large model, the viewer loads the model, but the graphs charts and buttons won't apear, and i get this error message:

Uncaught DOMException: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': Data cannot be cloned, out of memory.

what can i do to overcome this bug?

i am running the app on localhost3000. would deployment by microsoft azure help ?

is there a way to decrease the memory usage when the data calculation is being made?

this is where i call the proccessing functions after the model is being loaded:

```<code>function onGeometryLoaded() {
console.log("Geometry Loaded");

viewer.search(
  "",

  function (dbIds,propertyNames) {
    viewer.model.getBulkProperties(
      dbIds,
      {propFilter:["Category","System Classification","Area","Reference Level",'System Type','Level','Type Name','Size','Length','Revit Walls','Base Constraint','Comments']},
      // {propFilter:["Category","System Classification","Area","Reference Level",'System Type','Level','Type Name','Size','Revit Walls','Base Constraint','Comments']},
      function (elements) {
        // elements=elements.splice(1,elements.length/2);
        // var levelName = setLevelDropDown(elements);//-->the  first time- get the first level name
        var levelNames = FindLevelNames(elements);//-->the  first time- get the first level name
        var property = "AF_Flow";
        var flowCoefficient=1;
        getListCategories(elements, function (cateElem) {
          arraySimplify(elements,levelNames[0],property,flowCoefficient,cateElem, function (object) {
            modData.quantities = object.quantities;
            modData.Elements = object.Elements;
            modData.elem = object.Elements.ele;
            modData["Load"] = "Done";
            // console.log(propNames);
            // showPowerBIReport(levelNames,propNames);
            console.log("Big calculation done");
            showPowerBIReport(levelNames);
          });
        });
      }
    );
  },
  null,
  ["Comments"]
);

DashBoardColors = generateColorsRandom();
</code>```

}

function onDocumentLoadFailure(viewerErrorCode, viewerErrorMsg) {
console.error('onDocumentLoadFailure() - errorCode:' + viewerErrorCode + '\n- errorMessage:' + viewerErrorMsg);
}
}

thanks!

Body:
i made an forge viewer dashboard that shows different data from the viewer ( most of it is being analized in the client side)

when i open a large model, the viewer loads the model, but the graphs charts and buttons won't apear, and i get this error message:

Uncaught DOMException: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': Data cannot be cloned, out of memory.

what can i do to overcome this bug?

i am running the app on localhost3000. would deployment by microsoft azure help ?

is there a way to decrease the memory usage when the data calculation is being made?

this is where i call the proccessing functions after the model is being loaded:

function onGeometryLoaded() {
console.log("Geometry Loaded");

viewer.search(
  "",

  function (dbIds,propertyNames) {
    viewer.model.getBulkProperties(
      dbIds,
      {propFilter:["Category","System Classification","Area","Reference Level",'System Type','Level','Type Name','Size','Length','Revit Walls','Base Constraint','Comments']},
      // {propFilter:["Category","System Classification","Area","Reference Level",'System Type','Level','Type Name','Size','Revit Walls','Base Constraint','Comments']},
      function (elements) {
        // elements=elements.splice(1,elements.length/2);
        // var levelName = setLevelDropDown(elements);//-->the  first time- get the first level name
        var levelNames = FindLevelNames(elements);//-->the  first time- get the first level name
        var property = "AF_Flow";
        var flowCoefficient=1;
        getListCategories(elements, function (cateElem) {
          arraySimplify(elements,levelNames[0],property,flowCoefficient,cateElem, function (object) {
            modData.quantities = object.quantities;
            modData.Elements = object.Elements;
            modData.elem = object.Elements.ele;
            modData["Load"] = "Done";
            // console.log(propNames);
            // showPowerBIReport(levelNames,propNames);
            console.log("Big calculation done");
            showPowerBIReport(levelNames);
          });
        });
      }
    );
  },
  null,
  ["Comments"]
);

DashBoardColors = generateColorsRandom();

}

function onDocumentLoadFailure(viewerErrorCode, viewerErrorMsg) {
console.error('onDocumentLoadFailure() - errorCode:' + viewerErrorCode + '\n- errorMessage:' + viewerErrorMsg);
}
}

thanks!


问:
Android WebRtc remote black screen
I use the following two items

https://github.com/pchab/AndroidRTC

https://github.com/pchab/ProjectRTC

I installed the coin on the server，Video is available on the browser，But the remote screen is black on Android

I modified the IP and ice service addresses，What the hell happened

Title: Android WebRtc remote black screen