Questions tagged [private-functions]

25 questions
37
votes
9 answers

How do I make private functions in a Perl module?

I am working on a little Perl module and for some reason I had the test driver script that was using my new module call one of the functions that I thought would be private, and it was successful. I was surprised, so I started searching google and…
BrianH
  • 7,932
  • 10
  • 50
  • 71
7
votes
1 answer

Using Private Framework: Importing RadioPreferences.h

I'm following the selected answer importing private frameworks in Xcode Basically I want to be able to control Airplane mode in my app. When I import RadioPreferences.h into my app and try to compile, I'm getting Expected Identifier for @class…
ninjaneer
  • 6,951
  • 8
  • 60
  • 104
6
votes
3 answers

EUnit fails to test private functions

I'm writing EUnit tests for Erlang code. I have a source module: -module(prob_list). -export([intersection/2,union/2]). probability([], _Item) -> false; probability([{First,Probability}|Rest], Item) -> if First == Item -> Probability; …
Uko
  • 13,134
  • 6
  • 58
  • 106
6
votes
1 answer

Define private function in a mathematica package

I'm not sure I got how to define private functions right. When I'm writing a package mathematica, I just do this: BeginPackage["myPackage`"] myPublicFunction::usage="myPublicFunction blahblahblah"; Begin["Private"] myPrivateFunction[input_]:= ...…
Ricky Robinson
  • 21,798
  • 42
  • 129
  • 185
6
votes
2 answers

Private functions in JavaScript

In a jQuery-based web application I have various script where multiple files might be included and I'm only using one of them at a time (I know not including all of them would be better, but I'm just responsible for the JS so that's not my…
ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
5
votes
3 answers

How to call private functions of a class from outside the class in Kotlin

I want to call a private functions of class SomeClass from outside of this class: class SomeClass { private fun somePrivateFunction() { //... } private fun somePrivateFunctionWithParams(text: String) { //... …
Sergio
  • 27,326
  • 8
  • 128
  • 149
3
votes
1 answer

overloaded private function which is private in clojure

Usually I have the same structure of my functions: (defn func-name ([] (some actions)) ([ar] (some actions)) ([ar aar] (some actions))) And usually only one of this variant is public. But as You can see from my entry - all my function is…
Roman Makhlin
  • 973
  • 1
  • 11
  • 27
2
votes
1 answer

Undefined function in MATLAB

I using the function dtw in the latest MATLAB release, and would like to tweak a few parts of it. To get started, I typed: edit dtw I saved the resulting code to file called dtw_Copy.m, and changed the name of the function to dtw_Copy as well.…
LAR
  • 19
  • 3
1
vote
1 answer

Problem with self-invoking functions calling other functions

In my index.html file (before closing body tag), I want a function to self-invoke itself when the page is loaded. However, I am having issues when the function (here, setUp) is defined in an external file. If I copy-paste the setUp function in…
1
vote
1 answer

Can't find private function for sklearn (LocalOutlierFactor) in reticulate

I tried to add a part of a python code to my R Script. Unfortunately it seems that I can't use a private function for the LocalOutlierFactor in R: # Sample Data n <- 5000 n_outlier <- .05 * n set.seed(11212) inlier <- mvtnorm::rmvnorm(n, mean =…
1
vote
1 answer

Run a Cron Job on a CodeIgniter controller that needs me to be logged in? Should I use a public/private function in this kind of situation?

I want to run a URL every day on 1PM which checks if some variables have been changed by running a query on an external API, and if have changed - store the new vars and notifies me via email. Workspace: I am using CodeIgniter MVC Framework.…
Imnotapotato
  • 5,308
  • 13
  • 80
  • 147
1
vote
3 answers

Passing an array of data to a private function in CodeIgniter/PHP?

So I thought this should be easy, but, I'm struggling here... Here's my code: function xy() { $array['var1'] = x; $array['var2'] = y; echo $this->_z; } function _z($array) { $xy = $x.$y; return $xy; } So, why doesn't that seemingly…
Jack
  • 9,615
  • 18
  • 72
  • 112
1
vote
2 answers

Understanding JavaScript this with private function and self executing function

I was reading Angus Croll understanding JS this blog and found this var a = { b: function() { var c = function() { return this; }; return c(); } }; a.b();//window To me it looks like, at the time of invoking c, c was inside…
Jhankar Mahbub
  • 9,746
  • 10
  • 49
  • 52
0
votes
3 answers

Can a variable call a Private function?

Say you are given the following UML class diagram: Can a variable of type Mystery invoke the function DoSomething()? I understand that an object (say Mystery X;) could call GetA() to access the private variable int a and to access the public…
0
votes
0 answers

Not updating values automatically

I am new to macros and please help me solve the below issue. I have the below macro for the macro enabled workbook, in this I am returning the sum of values being entered to the column from F15 to cell H9 but its not getting updated. the same i have…
San Jay
  • 25
  • 7
1
2