w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Exception stating " Resetting to invalid mark " comes while marking an inputStream and resetting it, for Large files.?
I'm going to assume you are using a BufferedInputStream because its source code for reset() method is public synchronized void reset() throws IOException { getBufIfOpen(); // Cause exception if closed if (markpos < 0) throw new IOException("Resetting to invalid mark"); // exception you are getting pos = markpos; } The following call MD5CheckSumCalculator.calculateMD5CheckSum(inStreamLatestFile); must be doing something to the markPos. If you have no control over it, just reopen the stream. If you can't reopen the stream, ie. you're retrieving the same instance every time, consider using a ByteArrayOutputStream You can read the original InputStream into a ByteArrayOutputStream. Copy the bytes in that stream into a new ByteArrayInputStream. Pass that to the MD

Categories : Java

Trying to chage UL LI backgroud color jquery
$(function() { //run when the DOM is ready $(".clickable").click(function() { //use a class, since your ID gets mangled $(this).addClass("active"); //add the class to the clicked element }); }); Using this method you can simply replace the class with a new set of attributes on click.

Categories : Jquery

Excel VBA don't chage cell color
I'm going to assume RightValue is just one value, not a whole range of them. In that case, this might do what you want: Sub myCheck(ToVerify As Range, RightValue As Variant) Dim cell As Range For Each cell In ToVerify.Cells If cell.Value <> RightValue Then cell.Interior.Color = RGB(255, 0, 0) 'else make it white Else cell.Interior.Color = RGB(255, 255, 255) End If Next cell End Sub Note that I've changed it from a Function to a Sub. As you don't seem to need a returned value. I also got rid of the SignIfError = True at the end, as that's only needed for a Function. You could call it like this: myCheck ActiveSheet.Range("A1:A5"), 3 If you want to call using a value in a cell for RightValue, you'd call it like this: myCheck ActiveSheet.Range("A1

Categories : Excel

url rewriting or chage urls for wordpress website links
Settings > Permalinks Change it to the format you want there, using the Custom Structure option. Copy and paste the below code into there and it will change across your website: %category%/%postname%/

Categories : PHP

How to call a bash script automatically when directory contents chage
Linux provides a nice mechanism for that purpose which is called inotify. inotify is mostly available as a C API. But there have been developed shell utilities as well. You should use inotifywait from inotifytools (pkg name in debian) for this. Here comes a basic example: #!/bin/bash directory="/tmp" # or whatever you are interested in inotifywait -m -e create "$directory" | while read folder eventlist eventfile do echo "the following events happened in folder $folder:" echo "$eventlist $eventfile" done Update: If the problem goes complicated, for example you'll have to monitor recursive, dynamic directory structures, you should have a look at incron It's a cron like daemon which executes scripts on certain events. But the events are file system events rather than timer eve

Categories : Linux

how to chage the height of sprite without changing the value of original of sprite in iphone?
You can change the scale properties. scaleX will change the width, scaleY will change the height, and scale will change both: sprite.scaleX = 1.1f; sprite.scaleY = 0.5f;

Categories : Iphone

Loop is not resetting?
Well it depends on what your testString is. I tested it with value foo() and loop did go inside if(characterList.get(i + 1) == closeParenthesis[j]) condition. However there is a problem in your code where you have: characterList.remove(i); characterList.remove(i + 1); Which will result in java.lang.IndexOutOfBoundsException since i+1 location has become invalid (out of range) after deleting ith element. It should be other way round: characterList.remove(i + 1); characterList.remove(i); Also instead of i=0; you need to set it to: i = -1; And more importantly break out of inner for loop by calling break. So your code in the end should look like this: i = -1; break; See working demo: http://ideone.com/DfGJ2m

Categories : Java

NSMutableArray Resetting Itself?
There are good clues in your log output. There are multiple instances of the view controller (see the different values for 'self'?). They each have their own array. See this code... -(IBAction)newFileMenubar:(id)sender{ [newFileWindowControllerArray addObject:[[NewFileWindowController alloc]initWithWindowNibName:@"NewFileWindowController"]]; When you press the button associated with that action, your app builds another view controller and places it in the array. That view controller gets the awake from nib message and allocates another array, and so on. To confirm this, change the code as follows: -(IBAction)newFileMenubar:(id)sender{ [newFileWindowControllerArray addObject:@"Hello world"]; // and comment this out, for now: // [[newFileWindowControllerArra

Categories : Objective C

Facebook 'Like' keeps resetting to 0
Problem solved. (I think). The link within the code was leading to mysite.com, but the .htaccess redirect leads to mysite.com/forum. By changing the link in the facebook button code to mysite.com/forum, the counter now stays.

Categories : Facebook

C++ weird value resetting
You are not using arrays right: i,j will always return j, as that is the result of comma operator. Tile** tiles = new Tile*[4096]; for(int i = 0; i < 4096; i++) tiles[i] = new Tile[4096]; for(int i = 0; i< 4096;i++) { for(int j = 0;j< 4096;j++) { tiles[i][j].x = i; tiles[i][j].y = j; } } for(int i = 0; i< 4096;i++) { for(int j = 0;j< 4096;j++) { cout << "X (Should be " <<i<<"): "<< tiles[i][j].x << " " << "Y (Should be " <<j<<"): "<< tiles[i][j].y << " "; } } // Destruction! DON'T FORGET! for(int i = 0; i < 4096; i++) delete[] tiles[i]; delete[] tiles; If you calculate value

Categories : C++

asp.net dropdownlist resetting
you just need to check the postback at pageload event of yours. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Me.IsPostBack Then Return End Sub

Categories : HTML

SVN User Password Keeps Resetting
What are you using for your SVN server? svnserve or Apache httpd? Where are your repositories located? Is your user file under that same directory structure? That could be a problem. For example, you have: /svn/repos/project1 /svn/repos/project2 /svn/repos/users And, you're running: $ svn -r /svn/repos -d You could be corrupting your users list because Subversion thinks it's another repository. Move it to another location. $ mv /svn/repos/users /svn/repos/project1/conf Yes, you can safely store your users list under the conf directory of any of your repositories. Just make sure that your svnserve.conf file for each repository is pointing to the new location.

Categories : Svn

Java - Resetting InputStream
You can't do this reliably; some InputStreams (such as ones connected to terminals or sockets) don't support mark and reset (see markSupported). If you really have to traverse the data twice, you need to read it into your own buffer.

Categories : Java

Global variable resetting
you are accessing Global.variables.get(i) in many places, which is returning an array, your are accessing it's element with out checking even if it exsist Global.variables.get(i)[4] Global.variables.get(i)[2] you need to check the size and confirm if it is present, before trying to retrieve it.If the index is greater than or equal to the size() then you will get the exception

Categories : Java

Resetting array using indices
Instead of exposing the underlying array, you could have a length method that returns EndIndex-StartIndex, and an array operator that returns an item from the array offset by the value of the StartIndex. The you would access the items in the array like this: for (int i = 0; i < obj.length(); i++) { BusinessClass &item = obj[i]; } The MyClass class would look something like this: class MyClass { public: size_t length() const { return EndIndex - StartIndex; }; BusinessClass &operator[](size_t off) { return myArray[StartIndex+off]; }; private: BusinessClass myArray[MAX_COUNT]; int StartIndex; //start index int EndIndex; //End index };

Categories : C++

Resetting Email/Password
You can set the validation unique rule to ignore the current id $rules = array( 'email' => 'required|email|unique:users,email,'.Auth::user()->id, 'password' => 'required|min:5', 'confirm_password' => 'required|same:password', 'user_zip_code' => 'required' ); See here for more info from the docs

Categories : PHP

Vim - Shortcut To Go To NERDTree Without Resetting?
The nerdtree window has the filetype of nerdtree Below is a function that will focus the first window that has filetype nerd tree or leave the cursor in the window it was originally in. function! FocusNERDtree() let initial_win_num = winnr() for i in range(1, winnr('$')) exec i.'wincmd w' if &filetype == 'nerdtree' return 1 endif endfor exec initial_win_num.'wincmd w' return 0 endfunction So you can just create a map for this. nnoremap <leader>nf :call FocusNERDtree()<cr> Or you could just move the window manually using <c-w> and a direction (h,j,k or l)

Categories : Vim

Resetting the next id in an identity column
When you delete records identity seed doesn't get reset. Check this tutorial: http://www.howtogeek.com/howto/database/reset-identity-column-value-in-sql-server/ DBCC CHECKIDENT (your_table_name, RESEED, 0) Also please note this rather strange behavior DBCC CHECKIDENT Sets Identity to 0

Categories : C#

Resetting all CSS styles for a widget
To piggy back off my comment above, you could do something like below. (completely untested and quickly thrown together) This uses Jquery, but I'm sure you can figure out how to modify it if you use another library or pure JS. var allStyles = ["azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop","borderTopColor","borderTopStyle","borderTopWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement

Categories : Javascript

C# : Resetting DataGridView for new DataTable
Write this line after you have done populating the DataSource with the new data dataGridView1.Refresh(); You don't need to clear the DataGridView directly. Its always handled by modifying the DataSource of the DataGridView.

Categories : C#

Resetting a JDialog after closing
When you close a dialog it is not destroyed. It will just become invisible, but it still contains everything as it was when it was closed. You may override the function setVisible() and reinitialize it if the dialog should be shown again. @Override public void setVisible(boolean bVisible) { if(bVisible == false) { super.setVisible(bVisible); return; } initMyValues(); super.setVisible(bVisible); return; } Alternatively you could create a WindowListener and then you get notified about various state changes of the window. Depends on what suits your needs better. The WindowListener doesn't require you to create a separate class, jsut to override the setVisible(), but you have to add some extra function required by the interface.

Categories : Java

How to stop a loop from resetting?
So without seeing your code, could I float the idea of using a database ID as your last four digits? What I am advocating is an initial save of a record in the database that has the sole purpose of getting the ID of the soon to be new record and then using the date prepended to the ID value. This will allow for your IDs to be unique and not "reset" to zero when the "loop" is restarted. This of course has the downside of creating a partial record in the database if and when the user does not submit the form. Just a thought.

Categories : Javascript

Resetting zooming properties d3
The key is to tell the zoom behaviour that you're resetting scale and translation. To achieve this, simply save it in a variable and set the values appropriately as you're setting the transform attribute of the SVG. var zoom = d3.behavior.zoom(); svg.call(zoom.on("zoom", redraw)); // ... .on("click", function () { counter++; canvas .transition() .duration(1000) .attr('transform', "translate(" + (offset * counter) + ",0)"); zoom.scale(1); zoom.translate([offset * counter, 0]); drawBox(x, y); }); Updated jsfiddle here.

Categories : D3 Js

Resetting time.clock()
Save the time into say start_time when you set self.state = 2. Change self.time_passed > 10: to if self.time_passed > (start_time + 10): The game will end 10 after starting. IOW, don't reset the clock.

Categories : Python

Resetting a program in delphi
Off the top of my head....This should run. procedure ResetControls(aPage:TTabSheet); var loop : integer; begin if assigned(aPage) then begin for loop := 0 to aPage.controlcount-1 do begin if aPage.Controls[loop].ClassType = TCheckBox then TCheckBox(aPage.Controls[loop]).Checked := false else if aPage.Controls[loop].ClassType = TComboBox then TComboBox(aPage.Controlss[loop]).itemindex := -1; end; end; end; edit: Corrected as pointed out by Remy

Categories : Delphi

android chronometer intervals and resetting
Your while loop is blocking the UI. You better use AsyncTask and put your loop in its doInBackground() method in order to properly update the UI. More info here: http://developer.android.com/reference/android/os/AsyncTask.html

Categories : Android

Resetting other select boxes when any one is selected
jQuery uses [ and ] for attribute selectors, your selector selects an element with ID of jj_register_options that has categories attribute. Escape them or use different identifiers. the .prop() method will work as it is if you are using jQuery 1.6+. (function($) { $(function() { $('#jj_register_options\[categories\]').on('change', function() { // ... }); }); })(jQuery);

Categories : Jquery

Jquery datatables - resetting isssue
I think you need to re-initialize DataTables on each ajax call: success : function(data){ oTable(); var newarray=[]; while(data.length > 0) { newarray.push(data.splice(0,2)); }

Categories : Jquery

Resetting the appearance of UIBarButtonItems and UINavigationBar
A couple of options I can think of. Save the initial state in variables (background, font etc) to use later during the reset. Destroy and recreate the view. If this is done during a transition (page switch etc) it may not be noticeable to the user. Keep the original view hidden behind the new view and destroy the new view when you want to reset it. (This may be memory expensive.) I think your best bet may be to create a custom object (extend the original NavBar etc), save its original appearance variables (color, font etc) and add a reset option to be called by the controller.

Categories : IOS

Staytime resetting in foreach loop?
I think you need to change the variable playe to play in your foreach and then the staytime value assignment before the if condition. How could you make it 0 when you just assigned a value for staytime? foreach (var play in w_server.OnlineConnections) { staytime = Server.tickcount.ElapsedMilliseconds; if (staytime > 1 * 20000 && play.Value.Map == "Rest") { w_server.Disconnect(play.Value.client.connection); play.Value.Map = "Village1"; staytime = 0; } }

Categories : C#

Auto-increment is not resetting in MySQL
From what I can see about the alter table statement. You can reset auto increment value by using the ALTER TABLE statement. The syntax of the ALTER TABLE statement to reset auto increment value is as follows: ALTER TABLE table_name AUTO_INCREMENT = value; You specify the table name after the ALTER TABLE clause and the value which we want to reset to in the expression AUTO_INCREMENT = value. Notice that the value must be greater than or equal to the current maximum value of the auto-increment column. Which is where your problem lies I suspect. So basically you are left with a couple of options as follows: TRUNCATE TABLE: which according to our discussion is not a option DROP and RECREATE the table: A long and painful experience ALTER auto number column: I have not tried this but yo

Categories : Mysql

Resetting a select box in Angular JS with a only one option
So if there is only one option, why use a select box? Or should the second option be "none". In anycase, if you could put together a simple jsfiddle, that would help folks better see the problem and be able to play with it and hopefully find you an answer.

Categories : Javascript

resetting AUTO_INCREMENT doesn't work
Use TRUNCATE TABLE as this will reset the autoincrement From the documentation... From MySQL 5.0.13 on, the AUTO_INCREMENT counter is reset to zero by TRUNCATE TABLE, regardless of whether there is a foreign key constraint.)

Categories : Mysql

Django Session Variable resetting
request.session['foo'].append('bar') does not affect session. Only request.session['...'] = .../del request.session['...'] affect the session. Try following code. request.session['foo'] = ['bar'] https://docs.djangoproject.com/en/dev/topics/http/sessions/#when-sessions-are-saved By default, Django only saves to the session database when the session has been modified – that is if any of its dictionary values have been assigned or deleted: # Session is modified. request.session['foo'] = 'bar' # Session is modified. del request.session['foo'] # Session is modified. request.session['foo'] = {} # Gotcha: Session is NOT modified, because this alters # request.session['foo'] instead of request.session. request.session['foo']['bar'] = 'baz' In the last case of the above exa

Categories : Python

Resetting textArea length JavaFX
It is an exact dublicate of your previous question but with more info, so not going to vote for closing. I asked you to post exception stacktrace in that previous question, but you mentioned there is no your code related lines in stacktrace, hence I also presume like you that it is a bug of textArea. So I suggest to try to use another component, for example a big Label with white background :), if it is solely for displaying purposes.

Categories : Java

RowIDs resetting in jqGrid,How to prevent it?
Row Id will work this way because it generates dynamic Ids for your rows when your data is populated in the grid. This is the default behavior. You can get a unique row Id if you set a Primary key. this way, you'll get the value of Primary key as row Id. Simply set key: true property of the column you want to set as primary key, in the colModel collection.

Categories : Javascript

DataGridView in a Panel Scroll Resetting
I found a workaround that works here: http://nickstips.wordpress.com/2010/03/03/c-panel-resets-scroll-position-after-focus-is-lost-and-regained/ By overriding ScrollToControl and returning this.DisplayRectangle.Location it fixed the scroll issue I was having. protected override Point ScrollToControl(Control activeControl) { return this.DisplayRectangle.Location; }

Categories : C#

Resetting dropdown menus using jQuery in IE
If you simply want to select the first item, regardless of its value, simply use a baked in JavaScript property selectedIndex http://www.w3schools.com/jsref/prop_select_selectedindex.asp , something like this: $('form#requestForm select').each(function(i, e){ e.selectedIndex = 0; });

Categories : Jquery

Rails Resetting Thumbs_up votes
Wow... Guess I'll be answering this one myself. To reset the votes (in mysql at least), you just have to go into mysql's client and type in: truncate table [whateverthenameis]; As for how to automate this... I haven't the slightest idea.

Categories : Ruby On Rails

Android resetting MediaPlayer onBackPressed
You could either try to check for OnCancelListenerin your dialog to the detect if your dialog has been canceled. Or you can try something like this public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { //Do your code here for canceling your service return true; } return super.onKeyDown(keyCode, event); } When you create your dialog, you can add a cancel listener: pd.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { // TODO cancel your music service } })

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.