Is Objective C (really) affected by buffer overflows?

I’m trying to find a buffer overflow sample code in Objective-C but the only samples I found are written in C (without “bracket style”).

I understand that Objective-C is based on C, but are there any chance of getting buffer overflows (or any kind of overflow) using only Objective-C ?

Would you have a sample code to demonstrate it ?

Thanks in advance.

How well do multi objective optimization algorithms such NSGAii scale when there are many objectives (for example 10 or more)?

What I’m trying to figure out is what happens when using a multi objective optimization algorithm such as NSGA-ii and instead of trying to find the usual 2/3 objectives, I use 10 or many more objectives?

My main objective is: Distribute the highest level of customer satisfaction. for $5

I assure you of 100% quality work. I can deliver high-accuracy and timely deliveries along with any kind of typing related work and copy paste data, PDF conversions I want to build those customers who can trust me on a regular basis, who need expertise in my time management. To acquire and learn new skills that will be beneficial for my client projects.

by: Manoj82
Created: —
Category: Data Entry
Viewed: 91


How to pass address of Objective C function to a C function?

I am working with PJSIP for SIP calling ios application. As the library is written in C some callback C methods expecting address of a Objective C function. I have tried to do

ua_cfg.cb.on_incoming_call = &[self on_incoming_call:<#(pjsua_acc_id)#> _:<#(pjsua_call_id)#> _:<#(pjsip_rx_data *)#>] 

but of course it does not work as I dont know what to pass as parameters to the function, neither it’s giving me the address of the function.

How can I make it work? The C function which is expecting this looks like below

void (*on_incoming_call)(pjsua_acc_id acc_id, pjsua_call_id call_id,                  pjsip_rx_data *rdata); 

How to decide an Objective Function?


Blockquote

In the Njaba river basin, the available water was allocated for the purposes of consumption, irrigation, and electric power supply among three communities. The water allocated per annum per capita for all use in these communities are 10m3 , 10m3 and 30m3 . The allocations were made based on the critical factors of population, land area and the industrialization. The populations of the communities are 300, 200, and 100, power supply capacities are 20W, 10W and 20W while the land areas for irrigation are 50 hectares, 40 hectares, and 30 hectares respectively. Allowable allocations limits of more than 300, 100 and 80 were stipulated for the purposes. Using the above information, formulate, (a) Linear Programming Model for the basin. (b) Maximization the allocations made Assume non-negativity condition?

Blockquote

I’m learning this course for the very first time so for understanding this subject and it’s problems, I’m trying to solve different problems. I’m recently solving this problem showing above. As it is a solved example I found on the internet, here’s the objective function and constraints.

Blockquote

Let the three communities be denoted by the variables x, y, and z. The objective function should be based on the allocation per annum, per capita for the basin as stated;

Z = 10x + 10y + 30z

The constraints can be formulated thus;

300x + 200y + 100z > 300 20x + 10y + 20z > 100 50x + 40y + 30z > 80

Under the negativity conditions of

X, Y, Z > 0

Blockquote

My confusion is writing an objecting function in this question. When different communities are supplied water for different use then it’s obvious that usage of water in every community for different use is different. Like annually, per person usage of water would be different. If a person is using water only for domestic need the whole year, they are nothing to do with the irrigation and electric power supply so how could this line be justifiable that

*The water allocated per annum per capita

Blockquote

for all use

Blockquote

in these communities are 10m3 , 10m3 and 30m3 *?

like every single person is allocated water for all uses like for basic consumption, irrigation, electric power supply means they’re providing extra water?

Hope so everyone is getting my question and will sort out my query so I better solve questions on my own.

The objective of this assignment is to make a c function that takes a string, truncate it into words and writes them in a mirror: [on hold]

Eg. a call in the main to

mirror(“Hello my name is me”); // will print in the terminal:


olleH * ym* * eman* * si* * em*


To solve the exercise you will have to:

  1. truncate words in the sentence based on ‘ ‘ (space). What can you use to save multiple strings? (hint we saw it in last class )
  2. You will need a multidimensional array to store the mirror: count the biggest word +2 to get the number of column for the array to store the result. (That is also the number of stars(*) to save as first and last row of the array) number of rows will be number of words +2 to count the rows of *
  3. reverse each word (remember to put a * before and after it when you save it in the corresponding rows of the array)
  4. print the array

Does anyone can help me ?

Can the partial concavity of the following decomposable objective function be used for optimization?

The problem I am trying to solve is the following:

$ $ \begin{array}{ll} \min & f(x)+g(y) \ \mathrm{s.t.} & y\ge x\ge 0,\ \ & p\le ax+by\le q, \end{array}$ $ where $ a,b,p,q$ are positive real numbers. Call this problem $ (P_1). $ Here $ f,g$ are smooth functions such that $ f$ is a non-negative, concave, increasing function, while $ g$ is an increasing, possibly non-convex/non-concave function.

Consider another optimization problem, $ $ \begin{array}{ll} \min_y & \min_i\{f(v_i)\}+g(y) \ \mathrm{s.t.} & q/b\ge y\ge 0, \end{array}$ $ where $ v_i$ are the vertices obtained as intersections of the constraints $ y\ge x\ge 0$ , and $ p-by\le ax\le q-by$ , i.e., $ v_1=\max\{0,(p-by)/a\},\ v_2=\min\{y,(q-by)/a\}$ . Call this problem $ (P_2)$ .

My question is,

Are $ (P_1)$ and $ (P_2)$ equivalent?

I think the answer is yes. My rationale is that because of the concavity of the function $ f$ , when $ y$ is treated as a fixed variable, the function is minimized at one of the above mentioned vertices. Then using that value of $ f$ we find the final minimum value by optimizing with respect to $ y$ . However, I have two concerns:

1) Are my constraints for $ y$ (in $ (P_2)$ ) correct?

2) Can this approach, if correct for this two variable case, tractably extended to multi-variable scenarios?

3) If the answer to the point 2) above is positive, is there any tractable way of finding the vertices from problem $ (P_1)$ , which are to be used in problem $ (P_2)$ ?

Finally, is there any relevant literature on this approach. Please help. Thanks in advance.

Probabilistic method with multiple objective functions

Let $ \mathcal X$ be a finite set and $ f$ a function from $ \mathcal X$ to $ \mathbb R$ . Basic probabilistic method says that if I can find a probability distribution on $ \mathcal X$ and show that $ E[f(X)]\leq \epsilon_1$ (where $ X$ is a random variable with that probability distribution), then there exists a $ x_0\in\mathcal X$ such that $ f(x_0)\leq \epsilon_1$ .

My question is: suppose I have an additional objective function $ g:\mathcal X\mapsto\mathbb R$ . How could I use the probabilistic method to show that there exists a $ x_0\in\mathcal X$ , such that $ f(x_0)\leq \epsilon_1$ and $ f(x_0)\leq \epsilon_2$ .

If I use the basic methods twice, meaning that if I could show $ E[f(X)]\leq \epsilon_1$ and $ E[g(X)]\leq \epsilon_2$ , it does not imply that there is one $ x_0$ that satisfies both inequalities.

One way to solve this is to show $ E[f(X)+g(X)]\leq \min\{\epsilon_1, \epsilon_2\}$ . But I suspect that there is a more general and more elegant solution to this problem.

Biconvex problem whose objective function depends on only one variable

I am solving the following biconvex problem: $ $ \min_{x,y} f(y)$ $ $ $ s.t. ~~ g(x) \leq 0$ $ $ $ ~~~~~h(x,y) = 0$ $ $ $ x \in X, y \in Y$ $ where $ X$ and $ Y$ are compact convex sets, $ g(x)$ and $ f(y)$ are convex and $ h(x,y)$ is affine for fixed $ x$ or $ y$ . I wonder if there is any efficient algorithm to solve this type of optimization problem, not restricted to algorithms for general biconvex optimization problems.