Search Results

Search found 63 results on 3 pages for 'mh'.

Page 1/3 | 1 2 3  | Next Page >

  • CURL - Problem with Authentication

    - by danit
    I need to add authentication to this function: function multiRequest($data, $options = array()) { // array of curl handles $curly = array(); // data to be returned $result = array(); // multi handle $mh = curl_multi_init(); // loop through $data and create curl handles // then add them to the multi-handle foreach ($data as $id => $d) { $curly[$id] = curl_init(); $url = (is_array($d) && !empty($d['url'])) ? $d['url'] : $d; curl_setopt($curly[$id], CURLOPT_URL, $url); curl_setopt($curly[$id], CURLOPT_HEADER, 0); curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, 1); // post? if (is_array($d)) { if (!empty($d['post'])) { curl_setopt($curly[$id], CURLOPT_POST, 1); curl_setopt($curly[$id], CURLOPT_POSTFIELDS, $d['post']); } } // extra options? if (!empty($options)) { curl_setopt_array($curly[$id], $options); } curl_multi_add_handle($mh, $curly[$id]); } // execute the handles $running = null; do { curl_multi_exec($mh, $running); } while($running > 0); // get content and remove handles foreach($curly as $id => $c) { $result[$id] = curl_multi_getcontent($c); curl_multi_remove_handle($mh, $c); } // all done curl_multi_close($mh); return $result; } I'm looking to add authentication to this function, something along these lines? curl_setopt($curly[$id], CURLOPT_USERPWD, "$username:$password"); Anyone help?

    Read the article

  • curl_multi_exec stops if one url is 404, how can I change that?

    - by Rob
    Currently, my cURL multi exec stops if one url it connects to doesn't work, so a few questions: 1: Why does it stop? That doesn't make sense to me. 2: How can I make it continue? EDIT: Here is my code: $SQL = mysql_query("SELECT url FROM shells") ; $mh = curl_multi_init(); $handles = array(); while($resultSet = mysql_fetch_array($SQL)){ //load the urls and send GET data $ch = curl_init($resultSet['url'] . $fullcurl); //Only load it for two seconds (Long enough to send the data) curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_multi_add_handle($mh, $ch); $handles[] = $ch; } // Create a status variable so we know when exec is done. $running = null; //execute the handles do { // Call exec. This call is non-blocking, meaning it works in the background. curl_multi_exec($mh,$running); // Sleep while it's executing. You could do other work here, if you have any. sleep(2); // Keep going until it's done. } while ($running > 0); // For loop to remove (close) the regular handles. foreach($handles as $ch) { // Remove the current array handle. curl_multi_remove_handle($mh, $ch); } // Close the multi handle curl_multi_close($mh);

    Read the article

  • Module not found

    - by TMP
    Hi There! I've been working on this one quite a bit and haven't gotten any closer to a solution. I juut dug up my old copy of the WindowsHookLib again - It's available with source at http://www.codeproject.com/KB/DLL/WindowsHookLib.aspx. This library allows Global Windows Mouse/Keyboard/Clipboard Hooks, which is very useful. I'm trying to use the Mouse Hook in here to Capture Mouse-Motion (I could use a Timer that always polls Cursor.Position, but I plan on using more features of WindowsHookLib later). Code as follows: MouseHook mh = new MouseHook(); mh.InstallHook(); mh.MouseMove += new EventHandler<WindowsHookLib.MouseEventArgs>(mh_MouseMove); But on the call to InstallHook(), I get an Exception: "The specified Module could not be found". Strange. Searching, I found that someone thought this occurs because a DLL is not in a place included in the Windows PATH variable, and because placing it in system32 didn't help I went the whole hog and translated the thing to C# for inclusion directly in my project (I was curious how it works). However the error was obstinately persistent, so I dug a bit on this, and found the Code in the Library that is responsible: In InstallHook(), we have IntPtr hinstDLL = Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]); this._hMouseHook = UnsafeNativeMethods.SetWindowsHookEx(14, this._mouseProc, hinstDLL, 0); if (this._hMouseHook == IntPtr.Zero) { throw new MouseHookException(new Win32Exception(Marshal.GetLastWin32Error()).Message); } And this (after modification and recompile) tells me that what I'm really getting is a Windows error "ERROR_MOD_NOT_FOUND"! Now, Here I'm stumped. Didn't I just compile the Hook Library directly into my project? (UnsafeMethods.SetWindowsHookEx is just a DllImported Method from user32) Any Answers, or Prods in the right direction, or any hints, pointers or similar are very much appreciated!

    Read the article

  • Personal Software Process (PSP1)

    - by gentoo_drummer
    I'm trying to figure out an exercise but it doesn't really makes to much sense.. I'm not asking someone to provide the solution. just to try and analyse what needs to be done in order to solve this. I'm trying to understand which PSP 1.0 1.1 process I should use. PROBE? Or something else? I would greatly appreciate some help on this one from someone that has experience with the Personal Software Process Methodology.. Here is the question. For the reference case (“code1.c”), the following s/w metrics are provided: man-hours spent in implementation phase (per-module): 2,7 mh/file man-hours spent in testing phase (per-module): 4,3 mh/file estimated number of bugs remaining (per-module): 0,3 errors/function, 4 errors/module (remaining) Based on the corresponding values provided for the reference case, each of the following tasks focus on some s/w metrics to be estimated for the test case (“code2.c”): [25 marks] (estimated) man-hours required in implementation phase (per-module) [8 marks] (estimated) man-hours required in testing phase (per-module) [8 marks] (estimated) number of bugs remaining at the end of testing phase (per-module) [9 marks] Tasks 4 through 6 should use the data provided for the reference case within the context of Personal Software Process level-1 (PSP-1), using them as a single-point historic data log. Specifically, the same s/w metrics are to be estimated for the test case (“code2.c”), using PSP as the basic estimation model. In order to perform the above listed tasks, students are advised to consider all phases of the PSP software development process, especially at levels PSP0 and PSP1. Both cases are to be treated as separate case-studies in the context of classic s/w development.

    Read the article

  • How to Create tree type CVL in Content server(UCM)

    - by rajeev.y.ranjan-oracle
    Steps to create tree choice list:1)Create a table "tblStates" with column "stateID" and "stateName". Click on "ADD Recommended".2) Create another table "tblCities with columns "cityID", "stateID" and "cityName".3)Then create two views on these tables namely "tblstateview" and "tblcityview".3)In "StateView" added two rows with values as JH and MH in stateID column.Jharkhand and Maharastra in stateName.4)Similarly in tblcityview added two rows with values as:BO and RA in cityID column.JH and MH in stateID columnBokaro and Mumbai in cityname column.5)Created relationship with Parentinfo "tblStates" and stateID and  childinfo with tblCities and stateID.6)Created metadata by name "Newtest"Enable option list,go to the configure ,Select use tree,Click on go edit definition 7)Tree Definition at level 1: a)Choose" tblstateView"b)Choose relation "newstatecity"At Level2:a)Choose cityView.Log out of the NativeUI and ContentUI and test the tree created by name "Newtest".

    Read the article

  • Making a DataSet from another DataSet

    - by M.H
    Hi folks I have a client-server project (small project for companies in C#) and the server has a DataSet with some tables (there is no Database for some reasons so we save the DataSet as an XML file). when the clients connect to the server, the server should send some informations to the client depends on his privileges and some clients must add to or Delete from the DataSet in the server. I am thinking in Making a new small DataSet and sending it to the client (as xml) but I don't know how to generate a new DataSet with specific tables and rows (I tried to use Linq to DataSet but nothing worked). My Questions is how can I do that and is this a good solution to send informations to clients ? can you suggest a better scenario to send data to clients(I mean instead of making a new DataSet).

    Read the article

  • Unable to copy a file from obj\Debug to bin\Debug

    - by M.H
    I have a project in C# and I get this error every time I try to compile the project : (Unable to copy file "obj\Debug\Project1.exe" to "bin\Debug\Project1.exe". The process cannot access the file 'bin\Debug\Project1.exe' because it is being used by another process.), so I have to close the process from the task manager. my project is only one form and there is no multithreading. what is the solution (without restarting VS or Killing the process)?

    Read the article

  • Gradle: Make a 3rd party jar available to local gradle repository

    - by MH
    Hi, currently, I'm testing Gradle as an alternative to Maven. In my projects, there are some 3rd party jars, which aren't available in any (Maven) repositories. My problem is now, how could I manage it to install these jars into my local .gradle repository. (If it's possible, I don't want to use the local Maven repository, because Gradle should run independently.) At the moment, I get a lot of exceptions because of missing jars. In Maven, it's quite simple by running the install command. However, my Google search for something similar to the Maven install command wasn't successful. Has anybody an idea? Thanks a million in advance.

    Read the article

  • What should every programmer know about security ?

    - by M.H
    I am an IT student and I am now in the 3rd year in university,until now we are studing a lot of subjects related to computer in general (Programming,Algorithms,Computer architecture,maths....etc). But there is a whole world called security we are very far from it ,I mean here security in general(Computers Security,Interner Security,Networks Security,hacking,cracking...etc). I am very sure that nobody can learn every thing about security but sure there is a "minimum" knowledge every programmer or IT student should know about it and my question is what is this minimum knowledge ? can you suggest some E-books or courses or any thing can help to start with this road ?

    Read the article

  • Ant: project dependencies in a flat project layout with ivy

    - by MH
    Hello, I have two (Eclipse-) projects. Project A depends on project B, but the projects aren't nested i.e. project A is not a subproject of project B. Apache Ivy is responsible for the dependency management. When I run the compile task in Project A, is there any way to trigger the compile task (in project B) automatically (for example if the jar file of project B doesn't exist)? Thanks a million in advance.

    Read the article

  • Why we use "this" in Extension Methods ?

    - by M.H
    Hi, I want to ask why we use "this" keyword before the parameter in an extension method (C# Language)........... like this function : public static int ToInt(this string number) { return Int32.Parse(number); } I know that we have to use it but I don't know why.

    Read the article

  • Hudson can't find local maven repository (including 3rd party jars)

    - by MH
    Hi all, I have created a Maven2 project. Everything works fine. Now, I have set up a Hudson project in order to make nightly builds possible. Hudson should check out the current project state from a Subversion repository, run the tests, build the project and deploy everyting to a repository. My Subversion repositroy contains my Maven2 project but no jars located in my local Maven repository (.m2). That's probably why hudson finishes with a failure, saying that some 3rd party jars are't available. Here, I have to say that there are some jars in my local Maven repository (.m2), which aren't available in any Maven repositories. Hence, there is no possibility to download these jars. Has Hudson the ability to connect to the local .m2 repository? Or is there another way to make these jar files available to Hudson? Thanks a million in advance for your help.

    Read the article

  • Recursion inside while loop, How does it work ?

    - by M.H
    Can you please tell me how does this java code work? : public class Main { public static void main (String[] args) { Strangemethod(5); } public static void Strangemethod(int len) { while(len > 1){ System.out.println(len-1); Strangemethod(len - 1); } } } I tried to debug it and follow the code step by step but I didn't understand it.

    Read the article

  • Working with Database using LINQ to XML

    - by M.H
    Hi,I am Working on a project (C#) in the university and they said that we can't use a DBMS like SQL Server so we decide to use Linq and XML...we learned some basics in Linq to Xml But really we don't know how we can create tables and fields and work with them in Xml.any suggestions ?

    Read the article

  • order of initialization in Java

    - by M.H
    Hi, I want to ask why java initializes the static objects before the non-static objects ? in this example b3 will be initialized after b4 and b5 : class Cupboard { Bowl b3 = new Bowl(3); static Bowl b4 = new Bowl(4); Cupboard() {} static Bowl b5 = new Bowl(5); }

    Read the article

  • Problem with dependencies in m2eclipse

    - by MH
    Hi, I have a problem with m2eclipse and Nexus. Normally, when you create a new Maven Project in Eclipse, you can select an Archetype like maven-archetype-quickstart from the Nexus Indexer. Unfortunately, the Nexus Indexer doesn't show anything at all. But the worst part about all this is, that the "Add Dependency" menue doesn't work. (For a better understanding: By clicking on the "Dependencies" tab, you can usually click on a button in order to enter a groupId or artifactId. That's the menue what I am talking about. If I enter for example "junit", it shows no search results.) Does anybody know this issue? How could I fix it? Thanks a million in advance for any help.

    Read the article

  • Why the compiler doesn't complain about this error ?

    - by M.H
    Hi I am writing some java questions to help my friends in the java exam. I wrote a question and I supposed that three errors will occurred in the code but the compiler complained only about two. the code is : class MyClass { static MyClass() { System.out.println("I am The First Statement here!"); this(); } } I expected the following errors : the constructor can't be static this can't be in a static function (since the constructor isn't valid) this here should be the first statement. NetBeans isn't complaining about the second error here. why ?

    Read the article

  • is it better to use a "natural" language to write code?

    - by M.H
    I recently saw a programming language called supernova and they said in the web page : The Supernova Programming language is a modern scripting language and the First one presents the concept of programming with direct Fiction Description using Clear subset of pure Human Language. and you can write code like: i want window and the window title is Hello World. i want button and button caption is Close. and button name is btn1. btn1 mouse click. instructions are you close window end of instructions my question is not about the language itself but it is that are we need such languages and did they make writing code easier or not?

    Read the article

  • What is the explanation of this results in Java ?

    - by M.H
    I have the following code : public class Main { private int i = j; //1 private int j = 10; public static void main(String[] args) { System.out.println((new Main()).i); } } and there is a compiler error in line 1 because an illegal forward reference. But when I am trying the following code : public class Main { int i = getJ(); //1 int getJ(){ return j; } int j=10; public static void main(String[] args) { System.out.println(new Main().i); } } it works fine and the result is 0.Why there is no illegal forward reference in line 1 here?.The two codes look similar to me.

    Read the article

  • is it better to use a "natural" language to write codes ?

    - by M.H
    I recently saw a programming language called supernova and they said in the web page : The Supernova Programming language is a modern scripting language and the First one presents the concept of programming with direct Fiction Description using Clear subset of pure Human Language. and you can write codes like : i want window and the window title is Hello World. i want button and button caption is Close. and button name is btn1. btn1 mouse click. instructions are you close window end of instructions my question is not about the language itself but it is that are we need such languages and did they make writing codes more easier or not ?

    Read the article

  • Show a form from another form

    - by M.H
    Hi,When I want to Display a from (C#) by clicking a button in another form I usually create an object form the form that I want to show and use the show method : Form2 f2 = new Form2(); f2.Show(); or I work with the "Owner" : Form2 tempForm = new Form2(); this.AddOwnedForm(tempForm); tempForm.Show(); the tow ways generate the same results but what is the best and what are the differences between them?

    Read the article

1 2 3  | Next Page >