This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: cadvisor | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Start daemon at boot time | |
| # Description: Enable service provided by daemon. | |
| ### END INIT INFO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| typedef struct __attribute__((packed)) Tableau { | |
| int rows, columns; | |
| float matrix[MAX_ROWS * MAX_COLS]; | |
| bool dual_program; | |
| } Tableau_t; | |
| Tableau_t *tableau; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ScriptC_simplex script = new ScriptC_simplex(renderScript); | |
| ScriptField_Tableau tableau = new ScriptField_Tableau(renderScript, 1); | |
| int rowCount = data.length; | |
| int columnCount = data[0].length; | |
| tableau.set_rows(0, rowCount, false); | |
| tableau.set_columns(0, columnCount, false); | |
| tableau.set_dual_program(0, minimize, false); | |
| tableau.set_matrix(0, data, false); | |
| // Copy all values at once to the allocated memory of the struct. | |
| tableau.copyAll(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Type solutionVectorType = new Type.Builder(renderScript, Element.F32(renderScript)).setX(script.get_MAX_COLS()).create(); | |
| Type resultSizeType = new Type.Builder(renderScript, Element.I32(renderScript)).create(); | |
| script.set_solution_vector(arrayAllocation); | |
| script.set_result_size(resultSizeAllocation); | |
| script.invoke_solve(); | |
| float[] solutionVector = new float[script.get_MAX_COLS()]; | |
| arrayAllocation.copyTo(solutionVector); | |
| int[] resultSizeVector = new int[1]; | |
| resultSizeAllocation.copyTo(resultSizeVector); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma version(1) | |
| #pragma rs java_package_name(com.egeniq.lpsolver.renderscript) | |
| #pragma rs_fp_full | |
| #include "simplex.rsh" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define DEBUG true | |
| #if DEBUG | |
| #define LOG(msg, param) rsDebug(msg, param) | |
| #else | |
| #define LOG(msg, param) | |
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (int j = start_index; j < end_index; j++) { | |
| float value = get_element(tableau, tableau->rows - 1, j); | |
| rsSetElementAt_float(solution_vector, value, j - start_index); | |
| } | |
| rsSetElementAt_int(result_size, end_index - start_index, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class BaseGridFragment : Fragment() { | |
| private var lifecycleCallbacks: FragmentManager.FragmentLifecycleCallbacks? = null | |
| /** | |
| * If your fragment contains a VerticalGridSupportFragment, it automatically includes a search button you can disable. | |
| * However, the focus search listener is not disabled, and it does conflict with our implementation for showing the menu. | |
| * Don't forget to save a reference to the callbacks to unsubscribe when destroying the fragment. | |
| */ | |
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val recognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH) | |
| recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) | |
| // Prefer dutch language for recognition | |
| recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "nl-NL") | |
| // Display text for the user as hint until results are available (only in overlay mode) | |
| recognizerIntent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speak to search...") | |
| // Accept partial results if they come | |
| recognizerIntent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Dialog Fragment with hide animations | |
| */ | |
| class AnimatingDialogFragment : DialogFragment() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| setStyle(DialogFragment.STYLE_NO_FRAME, R.style.TvTheme_Dialog) | |
| } |
OlderNewer