In several SO's question there is these lines to access the parent directory of the code, e.g. os.path.join(os.path.dirname(__file__)) returns nothing and os.path.join(os.path.dirname(__file__)) returns nothing import os, sys parentddir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)) sys.path.append(parentddir) I understand that os.path.abspath() returns absolute path of something and sys.path.append() adds the path for the code to access. but what is this cryptic line below, what does it really mean? os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pa
I am developing an Android application. I want to hide any application icon (whatsapp,etc ....) in my android device and I want to start my application by pressing some numbers, for instance 456#. Is there a way to do this? I know how to hide my app icon but i want to search how to hide other application icon. Plz help me, thanx in advance.
When I'm querying a table in schema C from schema A, I'm getting ORA-01031: insufficient privileges and when I'm querying the same table from schema B, I'm getting ORA-00942: table or view does not exist. On the table neither of the schemas are having any privileges. Why am I getting different error messages in this case?
I need to add some JS library to my project and I also want to have ability to update that library from it's repo (that's why I'm adding it as submodule). But I need only on 1 file from that repo to be placed withing my JS directory, whereas library repository contain tests, coffeescript sources and so on, which I do not need in my repository. So the question is - how to add not whole repo as submodule, but single file/directory from it? I suppose this is somehow possible with help of Git Sparse checkouts but not sure if I'm on the right way with this...
I need to add some JS library to my project and I also want to have ability to update that library from it's repo (that's why I'm adding it as submodule). But I need only on 1 file from that repo to be placed withing my JS directory, whereas library repository contain tests, coffeescript sources and so on, which I do not need in my repository. So the question is - how to add not whole repo as submodule, but single file/directory from it? I suppose this is somehow possible with help of Git Sparse checkouts but not sure if I'm on the right way with this...
i have posted a question on ZURB's forum, but i noticed there were no answers to any post. As i think this problem might occur to many others, i think it might be a good idea to put it on SO as well. Here it comes: i have crafted a minimal example of the problem using the following markup (Edited with CLCS advices): <body> <div class="row collapse test"> <div class="large-4 columns"> <p>Test 1</p> </div> <div class="large-4 columns"> <p>Test 2</p> </div> <div class="large-4 columns"> <p>Test 3</p> </div> </div> </body> All CSS classes are ZURB Foundation untouched classes. The only addition is
I'm trying to execute this python script in IDA PRO using IDAPython. https://github.com/EiNSTeiN-/ida-decompiler It says to run this script you simply just do the following This is an IDA plugin which can decompile one function at a time. To try it in IDA, place your cursor on a function, and execute the plugin. The decompiled function will appear in the output window. I placed my mouse cursor on the assembly code of a function. I don't know whats the hotkey to run the script. I already loaded the script by doing Alt+F9 then pressing Insert key and loading up the decompiler.py All it said in t
I'm using facebook-ios-sdk-3.10, Using this SDK I'll login and fetch user details from FB Its working fine for me. This is the code I'm uisng - (IBAction)fbLogin_click:(id)sender { if (AppDelegate.fbsession.state != FBSessionStateCreated) { // Create a new, logged out session. NSArray *permissions = [NSArray arrayWithObjects:@"offline_access", @"email", @"publish_stream", @"read_stream",@"read_friendlists",@"manage_friendlists",@"friends_about_me",@"publish_actions", nil]; // create a session object, with defaults accross the board, except that we provide a custom // instance of FBSessionToken
I try to delete rows with null values at the mail column, if and only if exists a row with a non-null value for the same person_id. DELETE FROM EMP_MAIL EM WHERE MAIL IS NULL AND EXISTS ( SELECT EMP_ID FROM EMP_MAIL EM2 WHERE MAIL IS NOT NULL AND EM.EMP_ID = EM2.EMP_ID ) ; but it takes quite a while. (i have an non-unique index on EMP_MAIL(EMP_ID)) is there a better way to preform this operation ?
I am sitting second whole day on a problem and giving up. I have written a jersey client which works on Jetty, and doesnt work on Weblogic. The reason is propably hidden in certificate: CN = "*.somecompany.com". Weblogic doesnt like wildcards in CN. Does anybody has working solution for that ? I added these to Weblogic start params, but Weblogic uses many other clients, so I dont want to add these parameter: ignoreHostnameVerification: - -Dssl.debug=true -Dweblogic.security.SSL.ignoreHostnameVerification=true -Dweblogic.security.SSL.enforceConstraints=off -Dweblogic.nodemanager.sslHostNameVeri
Edit: It turns out that this is a custom checksum algorithm, not a CRC-32. For the curious here is a snippet of C code calculating the 21 FF 1D E4 checksum in the below example. I am working with some hex files that seem to be protected by a CRC-32 of sorts, but recalculating using the standard CRC-32 and other known parameters failed to produce a match. All I know is, the data spans 116 bytes and four additional bytes for the checksum. I can produce tons of examples of message-key pairs, I just cannot find any relation between them. I don't want to fill this post with hex dumps so I pasted a
Which is the best way to export a JPA query result in a CSV format? I tried opencsv but it wants a java.sql.ResultSet object and I don't understand how to create it. I tried the following code public ResultSet getAllUsersMap() { String query = "SELECT p from Participant p ORDER BY p.lastName"; ResultSet rs = (ResultSet) em.createQuery(query).getResultList(); return rs; } but I receive the exception java.lang.ClassCastException: java.util.Vector cannot be cast to java.sql.ResultSet
I am new to wordpress and I want the following kind of dropdown menu in my contact form 7. Year <2010>,<2011>,<2012>,<2013>,<2014> Month ...,october,november,december Date ....<27>,<28>,<29>,<30>,<31> Here Year, Month and Date should be visible in dropdown menu but it should not get selected where as the options below that should be able to select Pls suggest me as to how can I achieve this.
I have issue regarding codeigniter Timeout . I know the config folder setting session timeout manually like as l $config['sess_expiration'] = 123; but i need to the website admin manage the session time out dyanamicly in to the admin page please help me how to implement this logic i tried this logic but not working $this->session->sess_expiration = "120"; Note:here i am storing database in the value. based on the database value i can set in to the session expiration time note 1: $config['sess_time_to_update'] = 30; this value less than of session expiration time Total Logic code: public functi
I still do not know how to generate delay in Verilog for synthesis and call it any line in Verilog for synthesis. For finding this, I write code, but it does not work. Please help me if you know how to generate delay and call in any line like a C function. Actually if you tell me why I use for loop here then my answer is I want to move pointer inside for loop until and unless they completes its calculation that I made for delay generation. module state_delay; reg Clk=1'b0; reg [3:0]stmp=4'b0000; integer i,a; always begin #50 Clk=~Clk; end always @(posedge Clk) begin a=1'b1; delay(); a=1'b0; de
there are android:name 3 times, What is difference between them? I started learn Android, so now I am trying to understand Manifest. <activity android:name="com.example.project.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
I want to use a MVC helper to build a grid on the server side but after I want to add and remove rows on the client side. So I use the following wrapper: @(Html.Kendo().Grid<SIGEPos.Models.MyGridViewModel>() .Name("Grid") .Columns(columns => { columns.Bound(p => p.id).Hidden(); columns.Bound(p => p.name).Title("Name").Width(130); columns.Bound(p => p.quantity).Title("Quantity").Width(130); }) .Pageable() .Scrollable(scr=>scr.Height(430)) .DataSource(dataSource => dataSource .Ajax() .PageSize(20) .ServerOperation(false) ) ) And the following markup is generated (only script part shown): <script
For a project we need to investigate an existing installation of IBM Data Stage, doing a whole lot of ETL in loads of jobs. The job flow diagrams contain lots of tables being used a source (both in MSSQL as well as Oracle), as well as a target (mostly in Oracle). My question is now How can I find all database tables used by all jobs in a certain Data Stage Project ? I looked in Tools - Advanced Find, and there I can see all "table definitions". BUT, most of the tables actually used in jobs do not show up there, as they are defined as what Data Stage calls "Parallel Jobs" which in effect are SQ
I tried to save data to json string in a txt file using Gson and then restore it using Gson either. Things go well if I do it in eclipse. But when packaged to jar, Gson throws Exceptions. Here is the code for saving the file. String gsonStr = gson.toJson(masterShips); // masterShips is ArrayList<Ship> BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter("D:\\master_ship.txt")); writer.write(gsonStr); } catch (IOException e) { System.err.println(e); } finally { if (writer != null) { try { writer.close(); } catch (IOException e) { System.err.println(e); } } } Then I rea
I am trying to add an Excel sheet named "Temp" at the end of all existing sheets, but this code is not working: Private Sub CreateSheet() Dim ws As Worksheet ws.Name = "Tempo" Set ws = Sheets.Add(After:=Sheets(Sheets.Count)) End Sub Can you please let me know why?
I am facing this problem while accessing web service from ASP.NET application. But the problem occurs when it is hosted in a windows server. When it is hosted in desktop it is working fine. I am calling web service with HttpWebRequest object. Even it is working fine in server from HTML/JavaScript application. Only problem occurs in ASP.NET application hosted in server. I get following error. IIS 8.0 is installed in server. Unable to connect to the remote server System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond afte
I have android project where I have to change layout of last exxpanded group (which will collapse) and the group which is clicked. onGroupClick method i have : int cnt=list.getChildCount(); //set layout to all groups (for closed group) for(int i = 0; i < cnt; i`enter code here`++){ View group = adapter.getGroupView(i, false, null, list); LinearLayout childLayout = (LinearLayout) group.findViewById(R.id.newsLayout); childLayout.setBackgroundResource(R.layout.group_layout_shape); } // set layout of clicked group LinearLayout groupLayout = (LinearLayout) v.findViewById(R.id.newsLayout); groupLayo
I'm running OSX Mavericks and have installed Macports. I installed gcc via Macports which is working fine. However when I type man gcc I only get: No manual entry for gcc I was told I need to add the following to my .bash_profile export MANPATH=/opt/local/share/man:$MANPATH which I have done with no effect. Does Macports actually install the corresponding man pages? The man page for the 'port' command works fine as well as other preinstalled tools like clang. Any help? Cheers.
I decided to turn over a new leaf and start learning Java, but after downloading eclipse I cannot seem to make it run. I originally got an error saying it couldn't find my VM so I changed the path in the eclipse.ini to where "Java Mission Control" is installed, and now it's giving me this error when I try to run the application. I have looked at many other posts where people get the same error message but they all have to do with wrongly unzipped files and I am quite sure I unzipped it properly. I have also tried different mirrors and redownloaded eclipse 5 or 6 times as well as reinstalled JD
According to the needs of the experiment, I set the MTU to 8000. After doing this, when I use scp to copy large files, it stalled with 0.00%. I tried scp -l or scp -C and turning tcp_sack on/off, but it still didn't work. And I can't change the MTU size for experiment result comparison. Is there any other way to help?
What are the advantages/disadvantages of using Class() or self.__class__() to create a new object within a class? Is one way generally preferred over the other? Here is a contrived example of what I am talking about. class Foo(object): def __init__(self, a): self.a = a def __add__(self, other): return Foo(self.a + other.a) def __str__(self): return str(self.a) def add1(self, b): return self + Foo(b) def add2(self, b): return self + self.__class__(b)
I have questions regarding the URL path format. A url has a authority and a path. Now the question here is what is with an empty path (no path segments). The following is considered. The leading slash is part of the path. '/' is a path in http.//domain/ A empty path is actually a segment with a empty string as name "". Those two assumption would lead to the following results: A. http.//domain?query, http.//domain#fraction, http.//domain would be legal URL strings B. The following domain path would be extracted for the given domains. http.//domain -> segments = {} http.//domain/ -> segments = {
I have written Verilog code for the square root of a number which is parametrised. If the number of bits are even, the code works. If the number of bits are odd, the code divides the number of bits into groups of two starting from the right (LSB). The first iteration will select the group which has 1 bit starting from the left most bit. I am using a counter to go through the required number of cycles. I do not understand how I should select the group of 1 bit for the first iteration, and 2 for the rest of the iterations.
I'm basically trying to implement openId in spring which will allow user to login through goggle and extract their emailId, name and save in data base After adding openid4java jar, now I'm getting the following exception: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.openid.OpenIDAuthenticationFilter#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.openid.Op
I am currently trying to convert this php function to javascript: function human_filesize($bytes, $decimals = 2) { $sz = 'BKMGTP'; $factor = floor((strlen($bytes) - 1) / 3); return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor]; } Here's what I have so Far: function human_filesiz(bytes){ var decimals = 2; var sz = 'BKMGTP'; var factor = Math.floor((bytes.length - 1) / 3); return (bytes / Math.pow(1024, factor)); //return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor]; } Im Just struggling with the last line. Any Help Greatly Appreciated.