Search Results

Search found 8737 results on 350 pages for 'clear'.

Page 12/350 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Hibernate and Child Objects (add versus clear)

    - by tyndall
    Lets say I have domain model with Automobile and Wheels. Wheels is a List of Wheels Wheels has a many-to-one relationship to Automobile. If I get an object back from Hibernate and it has 4 wheels. I take that object remove the 4 wheels and add 4. And then Save. If I ask Hibernate for the object again and it returns an auto with 8 wheels... what are we doing wrong? I don't have access to the source for a few days but want to give our Java devs a push in the right direction. Thanks.

    Read the article

  • Clear sqlalchemy reflection cache

    - by OrganicPanda
    Hi all, I'm using sqlalchemy's reflection tools to get a Table object. I do this because these tables are dynamic and tables/columns can change. Here's the code I'm using: def getTableByReflection(self, tableName, metadata, engine): return Table(tableName, metadata, autoload = True, autoload_with = engine) The problem is that when the above code is run twice it seems to return the same results regardless of whether or not the columns have changed. I have tried refreshing using the mysession.refresh(mytable) but that fails because the table is not attached to any metadata - which makes sense but then why am I seeing cached results? Is there any way to tell the metadata/engine/session to forget about this table and let me load it cleanly?

    Read the article

  • How to clear all activity in android?

    - by Sushant
    I have one main activity "Dashboard" with a action bar containing home screen icon and exit button , i go to activity A -activity B -activity C from dashboard screen . Now on C, i click on action bar dashboard icon which bring to me on Dashboard screen . Now i go to activity E -activity G-activity H from dashboard screen . From H i press exit button , it come to C screen . When again click on exit i go through me out of application. Why there is need to press 2 times exit button for exit application . On Home Screen Icon :- public void onClickHome(View view){ final Intent intent = new Intent(getBaseContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); getBaseContext().startActivity(intent); //goDashboard(); } ON exit button :- AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.setTitle(getString(R.string.logoutDialogTitle)); alert.setMessage(getString(R.string.logoutDialogMessage)); final OnlineBookApp app = (OnlineBookApp) getApplicationContext(); alert.setPositiveButton(getString(R.string.logoutDialogCancel), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { } }); alert.setNegativeButton(getString(R.string.logoutDialogOk), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { //finish(); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); // // moveTaskToBack(true); //// stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); // System.runFinalizersOnExit(true); // android.os.Process.killProcess(android.os.Process.myPid()); //moveTaskToBack(true); // finish(); // app.SetIsExit(true); Intent intent = new Intent(getApplicationContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra("EXIT", true); startActivity(intent); } }); alert.setNeutralButton(getString(R.string.logoutDialogLogout), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { //finish(); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); //finish(); //app.SetIsExit(true); //stopService(new Intent(getBaseContext(), DatabaseSyncService.class)); app.logout(); Intent intent = new Intent(getApplicationContext(), Dashboard.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.putExtra("EXIT", true); startActivity(intent); } }); alert.show();

    Read the article

  • Forcibly clear memory in java

    - by MBennett
    I am writing an application in java that I care about being secure. After encrypting a byte array, I want to forcibly remove from memory anything potentially dangerous such as the key used. In the following snippet key is a byte[], as is data. SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec); byte[] encData = cipher.doFinal(data, 0, data.length); Arrays.fill(key, (byte)0); As far as I understand, the last line above overwrites the key with 0s so that it no longer contains any dangerous data, but I can't find a way to overwrite or evict secretKeySpec or cipher similarly. Is there any way to forcibly overwrite the memory held by secretKeySpec and cipher, so that if someone were to be able to view the current memory state (say, via a cold boot attack), they would not get access to this information?

    Read the article

  • How can i clear a SQLite database each time i start my app

    - by AndroidUser99
    Hi, i want that each time i start my app my SQLite database get's cleaned for this, i need to make a method on my class MyDBAdapter.java code examples are welcome, i have no idea how to do it this is the dbadapter/helper i'm using: public class MyDbAdapter { private static final String TAG = "NotesDbAdapter"; private DatabaseHelper mDbHelper; private SQLiteDatabase mDb; private static final String DATABASE_NAME = "gpslocdb"; private static final String PERMISSION_TABLE_CREATE = "CREATE TABLE permission ( fk_email1 varchar, fk_email2 varchar, validated tinyint, hour1 time default '08:00:00', hour2 time default '20:00:00', date1 date, date2 date, weekend tinyint default '0', fk_type varchar, PRIMARY KEY (fk_email1,fk_email2))"; private static final String USER_TABLE_CREATE = "CREATE TABLE user ( email varchar, password varchar, fullName varchar, mobilePhone varchar, mobileOperatingSystem varchar, PRIMARY KEY (email))"; private static final int DATABASE_VERSION = 2; private final Context mCtx; private static class DatabaseHelper extends SQLiteOpenHelper { DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL(PERMISSION_TABLE_CREATE); db.execSQL(USER_TABLE_CREATE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS user"); db.execSQL("DROP TABLE IF EXISTS permission"); onCreate(db); } } /** * Constructor - takes the context to allow the database to be * opened/created * * @param ctx the Context within which to work */ public MyDbAdapter(Context ctx) { this.mCtx = ctx; } /** * Open the database. If it cannot be opened, try to create a new * instance of the database. If it cannot be created, throw an exception to * signal the failure * * @return this (self reference, allowing this to be chained in an * initialization call) * @throws SQLException if the database could be neither opened or created */ public MyDbAdapter open() throws SQLException { mDbHelper = new DatabaseHelper(mCtx); mDb = mDbHelper.getWritableDatabase(); return this; } public void close() { mDbHelper.close(); } public long createUser(String email, String password, String fullName, String mobilePhone, String mobileOperatingSystem) { ContentValues initialValues = new ContentValues(); initialValues.put("email",email); initialValues.put("password",password); initialValues.put("fullName",fullName); initialValues.put("mobilePhone",mobilePhone); initialValues.put("mobileOperatingSystem",mobileOperatingSystem); return mDb.insert("user", null, initialValues); } public Cursor fetchAllUsers() { return mDb.query("user", new String[] {"email", "password", "fullName", "mobilePhone", "mobileOperatingSystem"}, null, null, null, null, null); } public Cursor fetchUser(String email) throws SQLException { Cursor mCursor = mDb.query(true, "user", new String[] {"email", "password", "fullName", "mobilePhone", "mobileOperatingSystem"} , "email" + "=" + email, null, null, null, null, null); if (mCursor != null) { mCursor.moveToFirst(); } return mCursor; } public List<Friend> retrieveAllUsers() { List <Friend> friends=new ArrayList<Friend>(); Cursor result=fetchAllUsers(); if( result.moveToFirst() ){ do{ //note.getString(note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE))); friends.add(new Friend(result.getString(result.getColumnIndexOrThrow("email")), "","","","")); }while( result.moveToNext() ); } return friends; } }

    Read the article

  • Session in php are not enough clear to me

    - by Lulzim
    I find sessions in php kind of confusing, can anybody of you explain those to me. I have an example which is not working in my case: I register sessions this way, would you please tell me is this the right way of registering sessions //this is the page from where i register myusername in sessions if($count==1){ session_start(); $_SESSION['myusername'] = $_POST['myusername']; include("enterpincover.php"); } else { echo "Wrong Pin"; } here i check first whether the username is registered in sessions in oder to open his account , otherwise open again login. It works, if user is not loged in, it will show login page which is right, if user is loged it shows welcome message but not the Welcome the name of the user as I want. for ex: Welcome David <?php session_start(); if(isset($_SESSION['myusername'])) { echo 'Welcome '.$_SESSION['myusername']; } else { include("leftmodules.php"); include("rightmodules.php"); include("login.php"); } ?>

    Read the article

  • clear php empty array

    - by redcoder
    i have the following array and want to get rid/remove the empty array and rearrange it in an order.can anyone help me please. Array ( [ufile] => Array ( [name] => Array ( [0] => chicken soup.jpg [1] => [2] => hot n sour sup.jpg [3] => [4] => [5] => [6] => [7] => [8] => ) [type] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => ) [tmp_name] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => [7] => [8] => ) [error] => Array ( [0] => 1 [1] => 4 [2] => 1 [3] => 4 [4] => 4 [5] => 4 [6] => 4 [7] => 4 [8] => 4 ) [size] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 ) ) )

    Read the article

  • Clear the form once form submitted

    - by zurna
    Once the form submitted, response from another page is printed to #GameStorySys. But values entered to the form still stays there. Is it possible for the form values to disappear (but the form should still stay) once the form submitted? $("[name='GameStoryForm']").click(function() { $.ajax({ type: "POST", data: $("#GameStoryForm").serialize(), url: "content/commentary/index.cs.asp?Process=EditLiveCommentaryStory&CommentaryID=<%=Request.QueryString("CommentaryID")%>", success: function(output) { $('#GameStorySys').html(output); }, error: function(output) { $('#GameStorySys').html(output); } }); });

    Read the article

  • Java: How to clear socket bindings

    - by Matt1776
    I am having a few issues with sockets within my Java SIP client. When I bind to an address and port, if something goes wrong I have to attempt to reconnect, usually after I've stopped and restarted the process. Problem with that is then the port is bound and I am forced to increment the local port. How can I remove the binding to the port I am targeting before binding to it? If that isnt possible, then how can I trap the process just before it ends so that I can locate the socket binding and close it manually?

    Read the article

  • Clearing input text feilds when clicked on in Flash (AS 2.0)

    - by rickstyphilis
    I have a problem where I want a text field that by default has the word NAME in it, to become empty when a user clicks on it. The text field has the instance name 'nam' and is inside a movie with the instance name 'input_text'. I've searched around and found samples of code where everyone keeps suggesting this: textboxinstancename.onSetFocus = function() { textboxinstancename.text = ""; }; should work. It seems to work for everyone else but me. I've tried using the following on the first frame of the 'input_text' movie with no luck: this.input_text.nam.onSetFocus = function() { this.input_text.nam.text = "" } I've tried putting this on the first frame of the scene, again with no result: _root.input_text.nam.onSetFocus = function() { _root.input_text.nam.text = "" } I've tried this in the same manner as the last respectively with both 'this' on the instance and '_root' on the scene (denoted by x): x.input_text.nam.onSetFocus = function() { if (x.input_text.nam.text == "NAME") { x.input_text.nam.text = ""; } }; Still no luck. Can anyone tell me what I might be doing wrong?

    Read the article

  • Umbraco Permissions Script - Secure Version

    - by Vizioz Limited
    Back in May I blogged about how to set Permissions for Umbraco using SetACL to set the appropriate directory permissions based on the installation recommendations.Recently I have been working on a site for a client who wanted every security item to be locked down as tightly as possible. And so I modified the script based on the Umbraco security best practices, I thought I'd share it with everyone, if I have missed anything, or if anyone has any suggestions on how to improve this, please let me know :)Please refer to my previous post regarding the SetAcl command line application that you will need.I suggest you save the following into a batch file called: umbPermSecure.batecho offREM Script to setup the Security Permissions for an Umbraco siteREM This script will give your machine Network Service the minimum rights requiredREM for Umbraco to workREM I suggest you update this script to also remove any users who do not need REM access to the web foldersREM **** Pre-requisites ****REM You will need to download - http://setacl.sourceforge.net/REM It is assumed that you have stored SetACL in a directory called, C:\SetACL ifREM not, you will need to modify the script.REM **** Usage ****REM You need to pass in the path for the root of your Umbraco directoryREM E.g. umbPermSecure.bat C:\inetpub\umbracoroot@echo umbPermSecure.bat - Script to set Umbraco File and Directory Permissions@echo based on the Umbraco Security Best Practices Document (13th March 2009)@echo Published by Chris Houston - 19th October 2009@echo http://blog.vizioz.com@echo Adding READ only access SetACL.exe -on "%1" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\web.config" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\bin" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\umbraco" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"@echo Adding READ and EXECUTE access SetACL.exe -on "%1\app_code" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read_ex" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\usercontrols" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read_ex" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"@echo Adding READ, WRITE and MODIFY access SetACL.exe -on "%1\config" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\css" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\data" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\masterpages" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\media" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\python" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\scripts" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"SetACL.exe -on "%1\xslt" -ot file -actn ace -ace "n:%computername%\NETWORK SERVICE;p:read" -ace "n:%computername%\NETWORK SERVICE;p:change" -actn clear -clr "dacl,sacl" -log "c:\setacl\log.txt"

    Read the article

  • How to clear a Firefox address bar without selecting its content?

    - by zuba
    Sometimes I need to move an url from an app to a browser. I select the url, say in gvim, and make Firefox window active. Then I see that I should clear address bar before pasting the new url, which requires selecting existing url, which wipes the new url from PRIMARY clipboard out. What is the best way to put the new url from PRIMARY clipboard to address bar? Is there a shortcut to clear address bar and then to move focus there? ps I know I can use Ctrl-C to put the new url to CLIPBOARD clipboard, but I prefer to use PRIMARY clipboard.

    Read the article

  • How can I clear history and settings for the Remote Desktop Viewer (Vinagre)?

    - by user68370
    How do I clear all the settings for Vinagre to take it back to a brand-new, virgin state? I accidentally typed a connection in wrong and I cannot figure out how to delete it. Also some of my connections are not working correctly and I think that if I could flush the whole thing clean it might fix those issues. I have tried uninstalling and reinstalling, but it remembers the previous settings/connections.

    Read the article

  • How do I fully clear Firefox's cache of CSS and JS files?

    - by Mike Webb
    I work on a website at my work. The issue is that if I visit the site, which uses the cached versions of the CSS and JS files, and then upload an updated copy of a CSS/JS file, Firefox will still use the cached version. I can go to 'Tools-Clear Recent History' and clear the Cache of "Everything" and it still uses the cached version of the files. It will eventually updated and use the new files, but it can takes hours for this change to occur. So, how do I completely clear Firefox's cache of these files?

    Read the article

  • How can I clear the notification center from Terminal?

    - by cwd
    I really like terminal-notifier and how it allows you to send things to the notification center. It even has a handy feature to remove the notifications that it sent, for example if I spoofed a notification from another app like CodeKit, syntax being: terminal-notifier -sender com.incident57.CodeKit -remove ALL But I guess this application is not able to clear the notifications that it did not send, as the other messages are still hanging around: It's a great tool but it still leaves me wondering: How can I clear the notification center from Terminal?

    Read the article

  • How can I clear *old* browsing data from Google Chrome Linux, while keeping more recent data?

    - by Norman Ramsey
    I can find plenty of information on how to clear Google Chrome's recent browsing data, in various periods, as well as clearing all browsing data. But I want to clear old browsing data—say for a start, anything over two months old. (I'm trying to save space on a crowded laptop.) Does anyone know any principled way to do this, or shall I just dive into ~/.config/google, start removing likely-looking files, and hope for the best. I run Google Chrome on Debian Linux.

    Read the article

  • How do you clear a CustomValidator Error on a Button click event?

    - by George
    I have a composite User control for entering dates: The CustomValidator will include server sided validation code. I would like the error message to be cleared via client sided script if the user alters teh date value in any way. To do this, I included the following code to hook up the two drop downs and the year text box to the validation control: <script type="text/javascript"> ValidatorHookupControlID("<%= ddlMonth.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>")); ValidatorHookupControlID("<%= ddlDate.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>")); ValidatorHookupControlID("<%= txtYear.ClientID%>", document.getElementById("<%= CustomValidator1.ClientID%>")); </script> However, I would also like the Validation error to be cleared when the user clicks the clear button. When the user clicks the Clear button, the other 3 controls are reset. To avoid a Post back, the Clear button is a regular HTML button with an OnClick event that resets the 3 controls. Unfortunately, the ValidatorHookupControlID method does not seem to work on HTML controls, so I thought to change the HTML Button to an ASP button and to Hookup to that control instead. However, I cannot seem to eliminate the Postback functionality associated by default with the ASP button control. I tried to set the UseSubmitBehavior to False, but it still submits. I tried to return false in my btnClear_OnClick client code, but the code sent to the browser included a DoPostback call after my call. btnClear.Attributes.Add("onClick", "btnClear_OnClick();") Instead of adding OnClick code, I tried overwriting it, but the DoPostBack code was still included in the final code that was sent to the browser. What do I have to do to get the Clear button to clear the CustomValidator error when clicked and avoid a postback? btnClear.Attributes.Item("onClick") = "btnClear_OnClick();"

    Read the article

  • how to copy files from TFS to clear case??

    - by barry
    Can i use powershell script to copy a set of files from a folder to Clear Case..?? i have the task of synchronising files from TFS to Clear Case.. like i need to take a set of files aftr a certain date from tfs server and synchronise these files to Clear case..

    Read the article

  • when to clear or make null asp .net mvc models?

    - by SARAVAN
    HI, I am working in an asp .net mvc application. I am using the model and storing some of the values which i need to preserve between the page posts, in the form of datacontexts. Say my model looks something like this: public SelectedUser SelectedUserDetails { //get and set has //this.datacontext.data.SelectedUser = ..... //return this.datacontext.data..... } Now when this model needs to be cleared? I have many such models with many properties and datacontext. But I don't have an idea on when to clear it. Is there a way or an event that can be triggered automatically when the model is not used for a long time? Oneway I thought is when i navigate away from a page which uses my underlying model, I can clear that model if its no longer used anywhere and initialise it back as needed. But I need to clear almost many models at many points. Is there an automatic way that can clear models when it is no longer used beacuse care can be taken by my code to initialise them when I need them, but I don't know when to clear them when I no longer need them. I need this to get rid of any memory related issues. Any thoughts or comments?

    Read the article

  • How to clear the list of "Notification Area Icons" in Windows 7?

    - by cliff.meyers
    I can't seem to find a way to clear the list of "Notification Area Icons" in Windows 7. Unfortunately I had installed a download manager (GetRight) which by default creates a tray icon for each download. I quickly disabled this but still have a ton of entries in that menu and it's annoying. I found an article that had me navigate to this key in the registry... HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify delete IconStreams and PastIconStreams, then restart, but it did not clear the list. Any ideas on this one?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >