Daily Archives

Articles indexed Friday June 29 2012

Page 9/19 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Printing a list using reflection

    - by TFool
    public class Service{ String serviceName; //setter and getter } public class Version{ String VersionID; //setter and getter } public void test(Object list){ //it shd print the obtained list } List< Service list1; //Service is a Bean List< Version list2; //Version is a Bean test(list1); test(list2); Now the test method shd print the obtained list - (i.e) If the list is of type Service ,then serviceName should be printed using its getter. If the list type is Version versionID should be printed. Is it possible to achieve this without using Interface or abstract class?

    Read the article

  • Showing ImageView next to TextView in a ListView

    - by KDEx
    So I have a listview that is displaying correctly. When the item is "turned on" the text is white and when it's turned off it's grey. That part all functions great. However when I add the ImageView into the mix I get a null pointer exception. I don't understand why. I've tried using bitmaps as well and get the same problem. Here is some code: @Override public void bindView(View view, Context context, Cursor cursor) { TextView rRule = (TextView) view.findViewById(R.id.rule_text); TextView rType = (TextView) view.findViewById(R.id.rule_type); ImageView iChecked = (ImageView) view.findViewById(R.id.checkBox); String ruleName = cursor.getString(1); int ruleType = cursor.getInt(2); String ruleEnabled = cursor.getString(3); switch (ruleType) { /*...some irrelevant code */ } if (ruleEnabled.equals("true")) { rRule.setTypeface(null, Typeface.BOLD); rRule.setTextColor(Color.WHITE); iChecked.setVisibility(View.VISIBLE); //line 271 } else if (ruleEnabled.equals("false")) { rRule.setTypeface(null, Typeface.NORMAL); rRule.setTextColor(Color.GRAY); iChecked.setVisibility(View.GONE); } rRule.setText(ruleName); } Per request the error log: (Sorry was under the impression null pointers dont say anything helpful..I know the error is the imageview) 06-29 10:29:02.777: E/AndroidRuntime(29516): FATAL EXCEPTION: main 06-29 10:29:02.777: E/AndroidRuntime(29516): java.lang.NullPointerException 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.company.app.DefaultRulesList$RulesAdapter.bindView(DefaultRulesList.java:271) 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.company.app.DefaultRulesList$RulesAdapter.newView(DefaultRulesList.java:284) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.CursorAdapter.getView(CursorAdapter.java:246) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.AbsListView.obtainView(AbsListView.java:2033) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.makeAndAddView(ListView.java:1772) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.fillDown(ListView.java:672) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.fillFromTop(ListView.java:732) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.ListView.layoutChildren(ListView.java:1625) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.AbsListView.onLayout(AbsListView.java:1863) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.FrameLayout.onLayout(FrameLayout.java:431) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.widget.FrameLayout.onLayout(FrameLayout.java:431) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.View.layout(View.java:11278) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewGroup.layout(ViewGroup.java:4224) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.os.Handler.dispatchMessage(Handler.java:99) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.os.Looper.loop(Looper.java:137) 06-29 10:29:02.777: E/AndroidRuntime(29516): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-29 10:29:02.777: E/AndroidRuntime(29516): at java.lang.reflect.Method.invokeNative(Native Method) 06-29 10:29:02.777: E/AndroidRuntime(29516): at java.lang.reflect.Method.invoke(Method.java:511) 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-29 10:29:02.777: E/AndroidRuntime(29516): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-29 10:29:02.777: E/AndroidRuntime(29516): at dalvik.system.NativeStart.main(Native Method) Code for iChecked (where the id is called) <ImageView android:id="@+id/checkBox" android:padding="2dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:drawable/checkbox_on_background"/>

    Read the article

  • Only show link if conditional equals true

    - by Dave Morin
    I want the link to appear only when $data['block'] equals to 1, 3 or 4. Not if it equals to 2 or 5. <td style="font-size:18px;color:#f0cb01;"> <a href="kickcodes.php?id='.$data["block"].'">Reason Codes</a> </td> EDIT while ($data = mysql_fetch_array($query)) { echo ' <tr style="background-color:#576c11;"> <td style="font-size:18px; color:#f0cb01;">'.$data["keyword"].'</td> <td style="font-size:18px;color:#f0cb01;">'.$data["block"].'</td> <td style="font-size:18px;color:#f0cb01;">'.$data["phone"].'</td> <td style="font-size:18px;color:#f0cb01;">'.$data["Reason"].'</td> <td style="font-size:18px;color:#f0cb01;"><a href="kickcodes.php?id='.$data ["block"].'">Kickcodes</a></td>' echo '<td style="font-size:18px;color:#f0cb01;">'; if( $data['block'] == 1 || $data['block'] == 3 || $data['block'] == 4) { echo '<a href="kickcodes.php?id='.$data["block"].'">Reason Codes</a>'; } else { echo '<span>Reason Codes</span>'; // Or echo nothing } echo '</td>';

    Read the article

  • Integrate Cppcheck with Emacs

    - by N.N.
    Is it possible to integrate Cppcheck with Emacs in a more sophisticated way than simply calling the shell command on the current buffer? I would like Emacs to be able to parse Cppcheck's messages and treat them as messages from a compiler (similar to how compile works), such as using C-x ` to visit the targets of Cppcheck's messages. Here is some example output Cppcheck: $ cppcheck --enable=all test.cpp Checking test.cpp... [test.cpp:4]: (error) Possible null pointer dereference: p - otherwise it is redundant to check if p is null at line 5 [test.cpp:38]: (style) The scope of the variable 'i' can be reduced [test.cpp:38]: (style) Variable 'i' is assigned a value that is never used [test.cpp:23]: (error) Possible null pointer dereference: p [test.cpp:33]: (error) Possible null pointer dereference: p Checking usage of global functions.. [test.cpp:36]: (style) The function 'f' is never used [test.cpp:1]: (style) The function 'f1' is never used [test.cpp:9]: (style) The function 'f2' is never used [test.cpp:26]: (style) The function 'f3' is never used

    Read the article

  • modx revo snippet variable in query

    - by Meddie
    I noticed something weird when using a query in a snippet. When I have a query like this: $sql = 'SELECT * FROM table WHERE colomn = ' . $variable; And I echo $sql, the query reads: SELECT * FROM table WHERE colomn = <code class="php plain">2</code> .. wich will result in an error because the sql is no longer valid. So for now I use strip_tags to remove the code tag, but I find it not a very clean method. I couldnt find anything about this, so maybe someone can shed some light on this for me?

    Read the article

  • contentscript, dynamic created iframe, postmessage

    - by thefoyer
    I'm attempting to inject an iframe from a content script. From the content script, post a message to the iframe, without much success. This is the closest I have got. No errors/warnings in the console but it doesn't work (alert test). contentscript: var iframe = document.createElement("iframe"); iframe.setAttribute("src", "https://www.com/iframe.php"); iframe.id = "iframe01"; document.getElementsByTagName("body")[0].appendChild(iframe); //then I inject this "web_accessible_resources" script var script = document.createElement("script"); script.type = "text/javascript"; script.src = chrome.extension.getURL("postMessage.js"); document.getElementsByTagName("head")[0].appendChild(script); postMessage.js window.postMessage({msg: "test"}, "*"); I've also tried top.postMessage({msg: "test"}, "*"); And var iframe = document.getElementById('iframe01'); iframe.contentWindow.postMessage({msg: "test"}, "*"); EDIT: I tried to make sure the iframe was loaded before postMessage, even if I put an alert there, it would alert telling me the iframe was loaded. var iframe = document.getElementById('iframe01'); if (ifrm_prsto.contentWindow.document) //do postMessage EDIT2: I did get it to work by moving the iframe from the contentscript to the inject.js script. Wasn't totally ideal but I do have it working now, I guess. iframe.php window.addEventListener("message", function(e) {alert("test");}); I am however able to do the reverse, talk to the parent script from the iframe.

    Read the article

  • php soapclient returns null but getPreviousResults has proper results

    - by Joseph.Chambers
    I've ran into trouble with SOAP, I've never had this issue before and can't find any information on line that helps me solve it. The following code $wsdl = "path/to/my/wsdl"; $client = new SoapClient($wsdl, array('trace' => true)); //$$textinput is passed in and is a very large string with rows in <item></item> tags $soapInput = new SoapVar($textinput, XSD_ANYXML); $res = $client->dataprofilingservice(array("contents" => $soapInput)); $response = $client->__getLastResponse(); var_dump($res);//outputs null var_dump($response);//provides the proper response as I would expect. I've tried passing params into the SoapClient constructor to define soap version but that didnt' help. I've also tried it with the trace param set to false and not present which as expected made $response null but $res was still null. I've tried the code on both a linux and windows install running Apache. The function definition in the WSDL is (xxxx is for security reasons) <portType name="xxxxServiceSoap"> <operation name="dataprofilingservice"> <input message="tns:dataprofilingserviceSoapIn"/> <output message="tns:dataprofilingserviceSoapOut"/> </operation> </portType> I have it working using the __getLastResponse() but its annoying me it will not work properly. I've put together a small testing script, does anyone see any issues here. //very simplifed dataset that would normally be //read in from a CSV file of about 1mb $soapInput = getSoapInput("asdf,qwer\r\nzzxvc,ewrwe\r\n23424,2113"); $wsdl = "path to wsdl"; try { $client = new SoapClient($wsdl,array('trace' => true,'exceptions' => true)); } catch (SoapFault $fault) { $error = 1; var_dump($fault); } try { $res = $client->dataprofilingservice(array("contents" => $soapInput)); $response = $client->__getLastResponse(); echo htmlentities($client->__getLastRequest()); echo '<hr>'; var_dump($res); echo "<hr>"; echo(htmlentities($response)); } catch (SoapFault $fault) { $error = 1; var_dump($fault); } function getSoapInput($input){ $rows = array(); $userInputs = explode("\r\n", $input); $userInputs = array_filter($userInputs); // $inputTemplate = " <contents>%s</contents>"; $rowTemplate = "<Item>%s</Item>"; // $soapString = ""; foreach ($userInputs as $row) { // sanitize $row = htmlspecialchars(addslashes($row)); $xmlStr = sprintf($rowTemplate, $row); $rows[] = $xmlStr; } $textinput = sprintf($inputTemplate, implode(PHP_EOL, $rows)); $soapInput = new SoapVar($textinput, XSD_ANYXML); return $soapInput; }

    Read the article

  • python can't start a new thread

    - by Giorgos Komnino
    I am building a multi threading application. I have setup a threadPool. [ A Queue of size N and N Workers that get data from the queue] When all tasks are done I use tasks.join() where tasks is the queue . The application seems to run smoothly until suddently at some point (after 20 minutes in example) it terminates with the error thread.error: can't start new thread Any ideas? Edit: The threads are daemon Threads and the code is like: while True: t0 = time.time() keyword_statuses = DBSession.query(KeywordStatus).filter(KeywordStatus.status==0).options(joinedload(KeywordStatus.keyword)).with_lockmode("update").limit(100) if keyword_statuses.count() == 0: DBSession.commit() break for kw_status in keyword_statuses: kw_status.status = 1 DBSession.commit() t0 = time.time() w = SWorker(threads_no=32, network_server='http://192.168.1.242:8180/', keywords=keyword_statuses, cities=cities, saver=MySqlRawSave(DBSession), loglevel='debug') w.work() print 'finished' When the daemon threads are killed? When the application finishes or when the work() finishes? Look at the thread pool and the worker (it's from a recipe ) from Queue import Queue from threading import Thread, Event, current_thread import time event = Event() class Worker(Thread): """Thread executing tasks from a given tasks queue""" def __init__(self, tasks): Thread.__init__(self) self.tasks = tasks self.daemon = True self.start() def run(self): '''Start processing tasks from the queue''' while True: event.wait() #time.sleep(0.1) try: func, args, callback = self.tasks.get() except Exception, e: print str(e) return else: if callback is None: func(args) else: callback(func(args)) self.tasks.task_done() class ThreadPool: """Pool of threads consuming tasks from a queue""" def __init__(self, num_threads): self.tasks = Queue(num_threads) for _ in range(num_threads): Worker(self.tasks) def add_task(self, func, args=None, callback=None): ''''Add a task to the queue''' self.tasks.put((func, args, callback)) def wait_completion(self): '''Wait for completion of all the tasks in the queue''' self.tasks.join() def broadcast_block_event(self): '''blocks running threads''' event.clear() def broadcast_unblock_event(self): '''unblocks running threads''' event.set() def get_event(self): '''returns the event object''' return event

    Read the article

  • Calling managed code from unmanaged win32 assembly dll - crash

    - by JustGreg
    I'm developing a serial port dll in win32 assembly (MASM32). It has its own thread checking multiple events and at a specified buffer treshold it'd notify the managed main application by calling a callback function. It just a call with no arguments/return value. At startup the main application stores the callback function's address by calling a function in the dll: pCallBackFunction dd 0 SetCallBackPointer proc pcb:DWORD mov eax, pcb mov pCallBackFunction, eax call DWORD ptr pCallBackFunction ; verify it immediately ret SetCallBackPointer endp The upper function immediately calls back the managed application callback routine for verification purposes. It is working fine. However, when I place the call instruction to other functions in the dll it crashes the application. It doesn't matter if the call is in a simple function or in the threadproc of the dll. For example: OpenPort proc pn:byte,br:dword, inputbuffersize: dword, outputbuffersize:dword, tresholdsize: dword LOCAL dcb: DCB LOCAL SerialTimeOuts: COMMTIMEOUTS call DWORD ptr pCallBackFunction xor eax, eax mov al, pn mov [com_port+3],al etc. etc. will crash at call DWORD ptr pCallBackFunction always. Since I call SetCallBackPointer first to store a valid address in pCallBackFunction, it should have a valid address. My managed app is written in C# and the relevant part is: public partial class Form1 : Form { public delegate void CallBackDelegate(); public static CallBackDelegate mydelegate; [DllImport("serialport.dll")] private static extern void SetCallBackPointer(CallBackDelegate Delegate); [DllImport("serialport.dll")] public static extern int OpenPort(byte com, uint br, uint inbufsize, uint outbufsize, uint treshsize); public Form1() { InitializeComponent(); mydelegate =new CallBackDelegate(CallbackFunction); SetCallBackPointer(mydelegate); unsafe { int sysstat; int hResult; hResult = OpenPort(Convert.ToByte('5'), 9600, 306, 4, 4); } } public static void CallbackFunction() { MessageBox.Show( "CallBack Function Called by Windows DLL"); } The VS debugger reported that the dll had tried to read/write from/to a protected memory address. But when calling SetCallBackPointer there is no such problem. What am I doing wrong here? Any tips would be great!

    Read the article

  • Is there a substitute for blockproc in Matlab?

    - by SetchSen
    I've been using blockproc for processing images blockwise. Unfortunately, blockproc is part of the Image Processing Toolbox, which I don't have on my personal computer. Is there a combination of functions in base Matlab that can substitute for blockproc? My initial guess was to use im2col to transform each block into columns, and then arrayfun to process each column. Then I realized that im2col is also a part of the Image Processing Toolbox, so that doesn't solve my problem.

    Read the article

  • Duplicate C# web service proxy classes generated for Java types

    - by Sergey
    My question is about integration between a Java web service and a C# .NET client. Service: CXF 2.2.3 with Aegis databinding Client: C#, .NET 3.5 SP1 For some reason Visual Studio generates two C# proxy enums for each Java enum. The generated C# classes do not compile. For example, this Java enum: public enum SqlDialect { GENERIC, SYBASE, SQL_SERVER, ORACLE; } Produces this WSDL: <xsd:simpleType name="SqlDialect"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="GENERIC" /> <xsd:enumeration value="SYBASE" /> <xsd:enumeration value="SQL_SERVER" /> <xsd:enumeration value="ORACLE" /> </xsd:restriction> </xsd:simpleType> For this WSDL Visual Studio generates two partial C# classes (generated comments removed): [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Name="SqlDialect", Namespace="http://somenamespace")] public enum SqlDialect : int { [System.Runtime.Serialization.EnumMemberAttribute()] GENERIC = 0, [System.Runtime.Serialization.EnumMemberAttribute()] SYBASE = 1, [System.Runtime.Serialization.EnumMemberAttribute()] SQL_SERVER = 2, [System.Runtime.Serialization.EnumMemberAttribute()] ORACLE = 3, } [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3082")] [System.SerializableAttribute()] [System.Xml.Serialization.XmlTypeAttribute(Namespace="http://somenamespace")] public enum SqlDialect { GENERIC, SYBASE, SQL_SERVER, ORACLE, } The resulting C# code does not compile: The namespace 'somenamespace' already contains a definition for 'SqlDialect' I will appreciate any ideas...

    Read the article

  • Google I/O 2012 - Integrating Google+ Into Mobile Apps

    Google I/O 2012 - Integrating Google+ Into Mobile Apps Julia Ferraioli Create a more engaging and personalized experience for your users by incorporating aspects of Google+ into your mobile app. Learn how your users can share pictures, links, and more into Google+ from your app, and how doing so can raise visibility and discoverability of your application. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 1224 23 ratings Time: 50:10 More in Science & Technology

    Read the article

  • Google I/O 2012 - Spatial Data Visualization

    Google I/O 2012 - Spatial Data Visualization Brendan Kenny, Enoch Lau Maps were among the first data visualizations, but they can also provide the backdrop for visualizing your own spatial data. In this session, we'll take a voyage through the world of map based data visualization, arming you with the tools you need to most effectively bring your data to life on a map using the Maps API v3. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 1053 26 ratings Time: 01:00:17 More in Science & Technology

    Read the article

  • StyleCop 4.7.33.0 has been released

    - by TATWORTH
    StyleCop 4.7.33.0 was released, today, 29/June at http://stylecop.codeplex.com/releases/view/79972This version is compatible with the Visual Studio 2012 RC (11.0.50522).Install order should be : VS2008VS2010VS2012 RCR#6.1.1 msi (for VS2010)R#7.0 (tested with daily build 7.0.70.189)StyleCop  This version is now compatible with R# 5.1 (5.1.3000.12), R# 6.0 (6.0.2202.688), R# 6.1 (6.1.37.86), R# 6.1.1 (6.1.1000.82) and R# 7.0 (7.0.70.189).Fixes for this release are:Updated docs for SA1103.Fix to not throw 1101 when is a nested interface. Added new tests.Fixes to install the ReSharper plugins back in the main directories for all users.Styling fixes.7291. Create indexer documentation better. Port fixes for 7289 and 7223 to 7.0.0 plugin.Fix for 7289. Create interface documentation better.Fix for 7223. Better text for inserted property text.Ensure WebSites and other folders containing aspx.cs files get analysed.Add re-analyse Project option to context menus (I asked for this one!)

    Read the article

  • IIS7 bulk bindings in vbscript , how to remove a binding

    - by minus4
    I have a script to manage adding over a thousand domains to a single site bindings, this has gone fine, but now client wants about 20 of them removed, Microsoft programmers don't think it would be nice to sort the bindings alphabetically, so does anyone know the code to remove the domains ( array list ) in bulk please. this is what i am using: Set adminManager = createObject("Microsoft.ApplicationHost.WritableAdminManager") adminManager.CommitPath = "MACHINE/WEBROOT/APPHOST" Set sitesSection = adminManager.GetAdminSection("system.applicationHost/sites", "MACHINE/WEBROOT/APPHOST") Set sitesCollection = sitesSection.Collection siteElementPos = FindElement(sitesCollection, "site", Array("name", "microsites")) If siteElementPos = -1 Then WScript.Echo "Element not found!" WScript.Quit End If on error resume next Set siteElement = sitesCollection.Item(siteElementPos) Set bindingsCollection = siteElement.ChildElements.Item("bindings").Collection Dim arrFileNames : arrFileNames = Array("list of domains") Dim objDict : Set objDict = CreateObject("Scripting.Dictionary") Dim strFileName, strTemp For Each strFileName In arrFileNames Set bindingElement = bindingsCollection.CreateNewElement("binding") bindingElement.Properties.Item("protocol").Value = "http" bindingElement.Properties.Item("bindingInformation").Value = "192.168.100.19:80:" & strFileName bindingsCollection.AddElement(bindingElement) Next adminManager.CommitChanges() WScript.Echo "Job Completed" WScript.Quit Function FindElement(collection, elementTagName, valuesToMatch) For i = 0 To CInt(collection.Count) - 1 Set element = collection.Item(i) If element.Name = elementTagName Then matches = True For iVal = 0 To UBound(valuesToMatch) Step 2 Set property = element.GetPropertyByName(valuesToMatch(iVal)) value = property.Value If Not IsNull(value) Then value = CStr(value) End If If Not value = CStr(valuesToMatch(iVal + 1)) Then matches = False Exit For End If Next If matches Then Exit For End If End If Next If matches Then FindElement = i Else FindElement = -1 End If End Function so as you can see it is easy to add, but i can find no code or manual or instructions for the removal. i cant seem to run appcmd either. at first i tried creating a batch file using the appcmd but this never worked, saying appcmd can not be found. thanks

    Read the article

  • why need select privileges on *.* to use view?

    - by profy
    I have a problem using view with MySQL server 5.0 (5.0.92) I cannot use view with a user granted like that : GRANT USAGE ON *.* TO 'testuser'@'' IDENTIFIED BY PASSWORD '**********'; GRANT ALL PRIVILEGES ON `testuser`.* TO 'testuser'@''; I can create view, but when I try to select in, I have this messages : ERROR 1356 (HY000): View 'testuser.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them I need to "GRANT SELECT ON . TO 'testuser'@''" to make select working on the view. Why ? Do you know a solution to use VIEW's without the select privileges on . ? Thanks a lots for your answers.

    Read the article

  • LVM incorrectly reported missing after power failure

    - by mensi
    We have had a major power failure in the data-center. We are using a set of servers for our storage needs. The main server has several pairs of disks mirrored with mdadm. The resulting /dev/mdX are LVM physical volumes and belong to a big volume-group with all our data. After the powerloss, we had the problem that one of the mdadm devices was not auto-detected due to a missing entry in mdadm.conf. As a consequence, the volumegroup had inactive logical volumes due to the missing PV. We were able to fix the mdadm config and reboot. pvscan shows all expected PVs but one LV still does not come up. vgdisplay shows: [...] Cur PV: 3 Act PV: 2 [...] Neither vgscan nor pvscan show any missing devices. What went wrong? How can we force LVM to activate all PVs?

    Read the article

  • Ethernet 802.1x client -> WiFi AP on a Raspberry Pi?

    - by Martin Janiczek
    I have an Ethernet connection that requires 802.1x authentication (TTLS, MSCHAPv2, name+password). My goal is to connect that to something that would then act as an WiFi AP, so I can use the connection on more devices (iPhone, notebook, etc.) Would it be possible/good idea to use Raspberry Pi for this purpose? Or are there better-suited devices to do this? EDIT: found some alternatives but because of low rep can't post more than two links... OpenWRT + wpa_supplicant guide Carambola - works with OpenWRT (but probably not standalone?) Hornet-UB - works with OpenWRT Asus RT-N10+ + OpenWRT how-to

    Read the article

  • nconf deployment.ini configuration for a basic Nagios server on CentOS 6.2

    - by jshin47
    I have set up nconf and Nagios but I cannot figure out how to configure deployment.ini to properly deploy the generated configuration to /usr/local/nagios/etc. Here are the directory listings of interest: [jshin@nag0 tmp]$ ls Default_collector global [jshin@nag0 tmp]$ cd Default_collector/ [jshin@nag0 Default_collector]$ ls advanced_services.cfg hostgroups.cfg service_dependencies.cfg services.cfg host_dependencies.cfg hosts.cfg servicegroups.cfg [jshin@nag0 Default_collector]$ cd .. [jshin@nag0 tmp]$ cd global/ [jshin@nag0 global]$ ls checkcommands.cfg contacts.cfg misccommands.cfg timeperiods.cfg contactgroups.cfg host_templates.cfg service_templates.cfg [jshin@nag0 global]$ cd .. [jshin@nag0 tmp]$ cd /usr/local/nagios/etc/ [jshin@nag0 etc]$ ls cgi.cfg htpasswd.users nagios.cfg objects resource.cfg [jshin@nag0 etc]$ cd objects/ [jshin@nag0 objects]$ ls commands.cfg localhost.cfg switch.cfg timeperiods.cfg contacts.cfg printer.cfg templates.cfg windows.cfg Here is my deployment.ini (pretty much the default setting) ;; LOCAL deployment ;; [extract config] type = local source_file = "/var/www/html/nconf/output/NagiosConfig.tgz" target_file = "/tmp/" action = extract [copy collector config] type = local source_file = "/tmp/Default_collector/" target_file = "/usr/local/nagios/etc/Default_collector/" action = copy [copy global config] type = local source_file = "/tmp/global/" target_file = "/usr/local/nagios/etc/global" action = copy reload_command = "service nagios restart" What I am wondering is why the directory structure that the default deployment.ini seems to suggest, with Default_collector and global, is different from the one that Nagios has by default, with only a folder called objects. What am I missing? Or more importantly, how does your deployment.ini look?

    Read the article

  • Nginx return 444 depending on upstream response code

    - by Mark
    I have nginx setup to pass to an upstream using proxy pass. The upstream is written to return a 502 http response on certain requests, rather then returning the 502 with all the header I would like nginx to recoginse this and return 444 so nothing is returned. Is this possible? I also tried to return 444 on any 50x error but it doesn't work either. location / { return 444; } location ^~ /service/v1/ { proxy_pass http://127.0.0.1:3333; proxy_next_upstream error timeout http_502; error_page 500 502 503 504 /50x.html; } location = /50x.html { return 444; } error_page 404 /404.html; location = /404.html { return 444; }

    Read the article

  • tomcat dns forwarding to multiple applications

    - by basis vasis
    I recently installed business objects software on tomcat 6. I have 2 domains - domain1 and domain2. This software allows access to two of its applications via these URLS: ADDRESS:http://myservername.domain1:8080/BO/APP1 and ADDRESS:http://myservername.domain1:8080/BO/APP2. Instead of these urls, I would like the end users to access these apps via something like http://bobj.domain2.com:8080/BO/APP1 and http://bobj.domain2.com:8080/BO/APP2. I cannot figure out how to accomplish that. I have looked into the option of http redirect (not good because the destination address shows up in the address bar), domain forwarding (not sure if it would work with multiple applications and forwarding from one domain to another) and also using apache tomcat with mod_jk by using virtual hosts (not sure if it is possible when forwarding from one domain to a sub domain in another domain) ?? please advise as to what would be my best option and how to accomplish. thanks a bunch

    Read the article

  • How to "open" existing VMs in Hyper-V without importing them?

    - by Borek
    I had a PC with two physical disks: C: containing the host operating system D: containing a folder D:\VMs where all my virtual machines were stored Now, the C: disk died. I bought a new one, reinstalled Windows on it, enabled Hyper-V feature and now I just need to open the VMs from the D:\VMs folder. However, I don't seem to be able to find a menu item or anything that would allow me to do that - the only thing I see is the "import" command which unfortunately requires the VMs to be explicitly exported (my machines weren't). I firmly believe that when I have all the files constituting a VM (the VHD file, some XML files describing the settings etc.) it must be somehow possible to just "open" these existing VMs in Hyper-V, right? What command am I missing? Edit: I know I can create a blank virtual machines and then just point them to use existing VHDs. However, I am not sure about all the different settings I've made to those VMs so I hope there's a way to simply open those existing VMs instead of recreating them.

    Read the article

  • Packets being dropped by iptables

    - by Shadyabhi
    I am trying to create a Software Access Point in linux. I followed the blog here. Steps I performed: Started dhcp server on wlan0. Properly configured hostapd.conf Enabled packet forwarding & masquerading. Two commands executed regarding iptables: iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE iptables --append FORWARD --in-interface wlan0 -j ACCEPT I enabled logging on iptables & I get this in everything.log Jun 29 19:42:03 MBP-archlinux kernel: [10480.180356] IN=eth0 OUT=wlan0 MAC=c8:bc:c8:9b:c4:3c:00:13:80:40:cd:80:08:00 SRC=195.143.92.150 DST=10.0.0.3 LEN=44 TOS=0x00 PREC=0x00 TTL=52 ID=38025 PROTO=TCP SPT=80 DPT=53570 WINDOW=46185 RES=0x00 ACK URGP=0 Jun 29 19:42:03 MBP-archlinux kernel: [10480.389102] IN=eth0 OUT=wlan0 MAC=c8:bc:c8:9b:c4:3c:00:13:80:40:cd:80:08:00 SRC=195.143.92.150 DST=10.0.0.3 LEN=308 TOS=0x00 PREC=0x00 TTL=52 ID=14732 PROTO=TCP SPT=80 DPT=53570 WINDOW=46185 RES=0x00 ACK PSH URGP=0 Jun 29 19:42:03 MBP-archlinux kernel: [10480.389710] IN=eth0 OUT=wlan0 MAC=c8:bc:c8:9b:c4:3c:00:13:80:40:cd:80:08:00 SRC=195.143.92.150 DST=10.0.0.3 LEN=44 TOS=0x00 PREC=0x00 TTL=52 ID=14988 PROTO=TCP SPT=80 DPT=53570 WINDOW=46185 RES=0x00 ACK FIN URGP=0 Jun 29 19:42:03 MBP-archlinux kernel: [10480.621118] IN=eth0 OUT=wlan0 MAC=c8:bc:c8:9b:c4:3c:00:13:80:40:cd:80:08:00 SRC=195.143.92.150 DST=10.0.0.3 LEN=44 TOS=0x00 PREC=0x00 TTL=52 ID=63378 PROTO=TCP SPT=80 DPT=53570 WINDOW=46185 RES=0x00 ACK FIN URGP=0 I have almost no knowledge of iptables, all I did was through googling. So, can anyone help me in making me understand what wrong is happening here? I have tried running tcpdump on wlan0 & http packets are being sent from wlan0.

    Read the article

  • How to detach a sql server 2008 database that is not in database list?

    - by Amir
    I installed SQL Server 2008 on Windows 7. Then I created a database. After 2 days I reinstalled Windows and SQL Server. Now I am trying to attach my database file, but I have encountered the error below. I think that the files are like an attached file and I can't attach them. What is difference between an attached file and a non-attached file? How can I attach this file? Please Help Me. Error Text: TITLE: Microsoft SQL Server Management Studio Attach database failed for Server 'AMIR-PC'. (Microsoft.SqlServer.Smo) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1540+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476 ------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) Unable to open the physical file "F:\Company.mdf". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476

    Read the article

  • How do I schedule a task to run every hour indefinitely on Server 2003

    - by JMK
    I am moving a scheduled task from a Windows 7 machine to a Windows Server 2003 machine. On Windows 7 I can configure my task to run every hour indefinitely by setting up a custom trigger like so: On Windows Server 2003, I assume I need to use the advanced schedule options, and I have got this far: Whether I choose duration or time, my task seems to have an expiry date, how do I get this to run indefinitely? The only thing I can think of at the minute is to setup 24 schedules for my task, one for each hour but there has to be a more elegant way. Thanks

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >