Daily Archives

Articles indexed Saturday June 29 2013

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

  • How do I blend 2 lightmaps for day/night cycle in Unity?

    - by Timothy Williams
    Before I say anything else: I'm using dual lightmaps, meaning I need to blend both a near and a far. So I've been working on this for a while now, I have a whole day/night cycle set up for renderers and lighting, and everything is working fine and not process intensive. The only problem I'm having is figuring out how I could blend two lightmaps together, I've figured out how to switch lightmaps, but the problem is that looks kind of abrupt and interrupts the experience. I've done hours of research on this, tried all kinds of shaders, pixel by pixel blending, and everything else to no real avail. Pixel by pixel blending in C# turned out to be a bit process intensive for my liking, though I'm still working on cleaning it up and making it run more smoothly. Shaders looked promising, but I couldn't find a shader that could properly blend two lightmaps. Does anyone have any leads on how I could accomplish this? I just need some sort of smooth transition between my daytime and nighttime lightmap. Perhaps I could overlay the two textures and use an alpha channel? Or something like that?

    Read the article

  • jQuery Validation Engine with Mime

    - by Diego Pucci
    I have this custom rule with tje jQuery validation Engine: "validateMIME": { "func": function(field, rules, i, options){ var fileInput = field[0].files[0]; var MimeFilter = new RegExp(rules[3],'i'); if (fileInput) { return MimeFilter.test(fileInput.type); } else { return true;} }, "alertText": "* Estensione non supportata" }, The problem is that this is working ONLY if the field is required. But in my case the field is not required, but if filled then the Mime type needs to be checked. How do I edit this function to work with non required fields? what's wrong with it? Thanks

    Read the article

  • Excel Worksheet Index

    - by Ben
    I have the following code that works great but I am trying to modify it so that instead of replacing column 1 of the Index page with a new index I would rather start the range in Cell C11. Right now, the new Index starts in Cell A1 of the Index sheet. Here is the code: Private Sub Worksheet_Activate() Dim wSheet As Worksheet Dim l As Long l = 1 With Me .Columns(1).ClearContents .Cells(1, 1) = "INDEX" .Cells(1, 1).Name = "Index" End With For Each wSheet In Worksheets If wSheet.Name <> Me.Name Then l = l + 1 With wSheet .Range("A1").Name = "Start_" & wSheet.Index .Hyperlinks.Add Anchor:=.Range("A1"), Address:="", _ SubAddress:="Index", TextToDisplay:="Back to Index" End With Me.Hyperlinks.Add Anchor:=Me.Cells(l, 1), Address:="", _ SubAddress:="Start_" & wSheet.Index, TextToDisplay:=wSheet.Name End If Next wSheet End Sub I have successfully modified the code so that the link back to the index on each sheet is in cell A4 without trouble, but I can't figure out how to have the index be replaced starting at Cell C11

    Read the article

  • MicroChip Sample Code setting Current to a CMPDAC, DAC threshold which expect an voltage

    - by jason hong
    Sorry, the MicroChip Forum is very slow,I prefer to use overflow site to ask questions. dsPIC33FJ06GS101/X02 and dsPIC33FJ16GSX02/X04 device Sample Code // configure comparator2 CMPCON2bits.CMPON = 1; // enable comparator CMPCON2bits.INSEL = 1; // select CMP2B input pin (RB0) CMPCON2bits.RANGE = 1; // select high range, max DAC value = Avdd/2 //CMPDACx: COMPARATOR DAC CONTROL REGISTER //CMREF<9:0>: Comparator Reference Voltage Select bits CMPDAC2 = CURR_HWLIM; // DAC threshold #define CURR_HWLIM 1023 // 1023 // 10.15 * 101A MicroChip Sample code setting CURR_HWLIM which 1023A to COMPDAC2 which expects voltage I think that's mistake.

    Read the article

  • Removing entry from table

    - by Bnhjhvbq7
    Can't remove an entry from table. here's my code dropItem = dropList[ math.random( #dropList ) ] dropSomething[brick.index] = crackSheet:grabSprite(dropItem, true) dropSomething[brick.index].x = brick.x dropSomething[brick.index].y = brick.y dropSomething[brick.index].name = dropItem dropSomething[brick.index].type = "dropppedItems" collision function bounce(event) local item = event.other if item.type == "dropppedItems" then if item.name == "bomb" then Lives = Lives - 1 LivesNum.text = tostring(Lives) end item:removeSelf(); end end What I've tried: item:removeSelf(); - removes the whole table item = nil - seams to do nothing, the object continue to move and i still see the image

    Read the article

  • How to use VBA to colour pie chart

    - by Timon Heinomann
    I have the following code in which the code tries to create a bubble chart with pie charts as the bubbles. As in this version colour themes are used to create a different colour in each pie chart (bulbble) in the function part I have the problem that it works depending on the paths to the colour paletts. Is there an easy way to make the function in a way that it works independently of those paths either by coding a colour for each pie chart segment or by using standardize paths (probably not possible, not preferable). Sub PieMarkers() Dim chtMarker As Chart Dim chtMain As Chart Dim intPoint As Integer Dim rngRow As Range Dim lngPointIndex As Long Dim thmColor As Long Dim myTheme As String Application.ScreenUpdating = False Set chtMarker = ActiveSheet.ChartObjects("chtMarker").Chart Set chtMain = ActiveSheet.ChartObjects("chtMain").Chart Set chtMain = ActiveSheet.ChartObjects("chtMain").Chart Set rngRow = Range(ThisWorkbook.Names("PieChartValues").RefersTo) For Each rngRow In Range("PieChartValues").Rows chtMarker.SeriesCollection(1).Values = rngRow ThisWorkbook.Theme.ThemeColorScheme.Load GetColorScheme(thmColor) chtMarker.Parent.CopyPicture xlScreen, xlPicture lngPointIndex = lngPointIndex + 1 chtMain.SeriesCollection(1).Points(lngPointIndex).Paste thmColor = thmColor + 1 Next lngPointIndex = 0 Application.ScreenUpdating = True End Sub Function GetColorScheme(i As Long) As String Const thmColor1 As String = "C:\Program Files\Microsoft Office\Document Themes 15\Theme Colors\Blue Green.xml" Const thmColor2 As String = "C:\Program Files\Microsoft Office\Document Themes 15\Theme Colors\Orange Red.xml" Select Case i Mod 2 Case 0 GetColorScheme = thmColor1 Case 1 GetColorScheme = thmColor2 End Select End Function The code copies a single chart again and again on the bubbles. So I woudl like to alter the Function (now called Get colourscheme) into a fucntion that assigns a a unqiue rgb colour to each segment of each pie chart

    Read the article

  • How does LocationManager work

    - by user2511882
    I have been going through the google docs for the locationManager API and specifically over the method locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 60000, 10, this); In the above line, the manager will check for location updates after each minute and distance of 10 meters. My question is does it actually take both the parameters into consideration? For example if you are driving along how will the method work? Will it start looking for updated locations since you are over the minimum distance between the two updates or will it wait for a minute irrespective? If someone can tell me its behavior, it would be great. Thanks.!!

    Read the article

  • java threads don't see shared boolean changes

    - by andymur
    Here the code class Aux implements Runnable { private Boolean isOn = false; private String statusMessage; private final Object lock; public Aux(String message, Object lock) { this.lock = lock; this.statusMessage = message; } @Override public void run() { for (;;) { synchronized (lock) { if (isOn && "left".equals(this.statusMessage)) { isOn = false; System.out.println(statusMessage); } else if (!isOn && "right".equals(this.statusMessage)) { isOn = true; System.out.println(statusMessage); } if ("left".equals(this.statusMessage)) { System.out.println("left " + isOn); } } } } } public class Question { public static void main(String [] args) { Object lock = new Object(); new Thread(new Aux("left", lock)).start(); new Thread(new Aux("right", lock)).start(); } } In this code I expect to see: left, right, left right and so on, but when Thread with "left" message changes isOn to false, Thread with "right" message don't see it and I get ("right true" and "left false" console messages), left thread don't get isOn in true, but right Thread can't change it cause it always see old isOn value (true). When i add volatile modifier to isOn nothing changes, but if I change isOn to some class with boolean field and change this field then threads are see changes and it works fine Thanks in advance.

    Read the article

  • Use where clause with Like in codeigniter

    - by user2524013
    I am working on a project. I am implementing the Search functionality in my System. I will have to show the search record from two tables base on the current use login. I have tried the following code: function searchActivity($limit,$offset,$keyword1,$keyword2,$recruiter_id) { $q=$this->db->select('*')->from('tbl_activity')->limit($limit,$offset); $this->db->join('tbl_job', 'tbl_job.job_id = tbl_activity.job_id_fk', 'left outer'); $this->db->order_by("activity_id", "ASC"); $this->db->like('job_title',$keyword1,'both'); $this->db->or_like('job_title',$keyword2,'both'); $this->db->or_like('activity_subject',$keyword1,'both'); $this->db->or_like('activity_subject',$keyword2,'both'); $this->db->or_like('activity_details',$keyword1,'both'); $this->db->or_like('activity_details',$keyword2,'both'); $this->db->where('tbl_activity.recruiter_id_fk',$recruiter_id); $ret['rows']=$q->get()->result(); return $ret; } I want to show search results based on the current user id, which is currently store in $recruiter. Thanks in advance.

    Read the article

  • JQM dialog is opening in new page instead of dialog

    - by K D
    Thank you for taking the time to read my question. I'm trying to get a dialog box to open using Jquery mobile. I followed the documentation and used the data-rel="dialog" notation along with the data-transition="pop". Instead of a dialog appearing on the same page, I get a brand new page with the dialog appearing. Can someone kindly assist me on how to fix this functionality. Here is my code for the initial main page: <article> <ul data-role="listview" data-split-icon="star" data-split-theme="d" data-inset="true"> <li><a href="#black_seed_desc" data-rel="dialog" ><img src="black_seed.jpg"/> <h3>Black Seed Oil</h3> </a> <a href="#black_seed_purchase" data-rel="dialog" data-transition="pop">Purchase Black Seed Oil</a> </li> </ul> </article> Here is my code for the dialog page: <div data-role="dialog" id="black_seed_purchase" data-theme="c"> <section data-role="content"> <h1>Purchase Black Seed Oil?</h1> <p>By purchasing Black Seed Oil you will receive an email receipt copy sent to you for your reference.</p> <a href="#purchase_blackseed" data-inline="true" data-corners="true" data-rel="back" data-role="button" data-shadow="true" data-iconshadow="true" data-wrapperrels="span"> <span> <span>Buy: $49.99</span> <span>&nbsp;</span> </span> </a> <a href="#" data-role="button" data-rel="back" data-inline="true" data-corners="true" data-wrapperrels="span" data-shadow="true" data-iconshawdow="true"> <span> Cancel </span> </a> </section> </div> Here is a working example. http://jsfiddle.net/Gajotres/w3ptm/?

    Read the article

  • Twitter Bootstrap: how to put unknown number of span* within a row-fluid?

    - by StackOverflowNewbie
    Assume I have the following nesting: <div class="cointainer-fluid"> <div class="row-fluid"> <div class="span3"> <!-- left sidebar here --> </div> <div class="span9"> <!-- main content here --> </div> </div> </div> I'd like to put an unknown number of <div class="span3"></div> in the main content area. (Each of the span3 is suppose to contain a product photo, name, price, etc.) Of course, my aim is that be responsive. So, I might display 20 products, which I'd like to possibly display 5 products per "row" on a wide screen, then 4 products per "row" on a slightly less wide screen, then 3, then 2, then 1. For example (each X represents a product): Wide Screen row 1: X X X X X row 2: X X X X X row 3: X X X X X row 4: X X X X X Less Wide Screen row 1: X X X X row 2: X X X X row 3: X X X X row 4: X X X X row 5: X X X X Even Less Wide Screen row 1: X X X row 2: X X X row 3: X X X row 4: X X X row 5: X X X row 6: X X X row 7: X X It seems like I need to do nested rows. However, if I do that, then I'll only be able to fit a certain amount of products in each nested row. That'll cause problems as the screen width decreases, for example (each X represents a product): Wide Screen row 1: X X X X X row 2: X X X X X row 3: X X X X X Less Wide Screen row 1: X X X X X row 2: X X X X X row 3: X X X X X How do I do what I want to do in Twitter Bootstrap?

    Read the article

  • Is C# WebAPI worth it? Can I use standart MVC4 to create my API?

    - by Steve
    I need to build a massive API and I'm trying out WebAPI instead of default MVC4 projects and it seems that it just makes things more difficult. Can have only 4 methods in controller Get, Post, Put, Delete, if I want more I need to modify route for that particular method FluentValidation won't work with WebAPI so I need to use DataAnnotations which I really don't want to. Can't use dynamic return data-types My question is: Would it really be that bad if I would use MVC4 project and use default ActionResults that return Json? What are real advantages of using WebAPI, why did they even made them in the first place if you can easily convert your project to API?

    Read the article

  • Why won't the following PDO transaction won't work in PHP?

    - by jfizz
    I am using PHP version 5.4.4, and a MySQL database using InnoDB. I had been using PDO for awhile without utilizing transactions, and everything was working flawlessly. Then, I decided to try to implement transactions, and I keep getting Internal Server Error 500. The following code worked for me (doesn't contain transactions). try { $DB = new PDO('mysql:host=localhost;dbname=database', 'root', 'root'); $DB->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh = $DB->prepare("SELECT * FROM user WHERE username = :test"); $dbh->bindValue(':test', $test, PDO::PARAM_STR); $dbh->execute(); } catch(Exception $e){ $dbh->rollback(); echo "an error has occured"; } Then I attempted to utilize transactions with the following code (which doesn't work). try { $DB = new PDO('mysql:host=localhost;dbname=database', 'root', 'root'); $DB->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbh = $DB->beginTransaction(); $dbh->prepare("SELECT * FROM user WHERE username = :test"); $dbh->bindValue(':test', $test, PDO::PARAM_STR); $dbh->execute(); $dbh->commit(); } catch(Exception $e){ $dbh->rollback(); echo "an error has occured"; } When I run the previous code, I get an Internal Server Error 500. Any help would be greatly appreciated! Thanks!

    Read the article

  • Java Null Pointer Exception :-(

    - by John-Michael Reed
    I've got a Null Pointer Exception in my main that just won't go away and I'm totally out of ideas. The error is on the line "Board[x][y].color = 2;" in which Board is a public, static array of piece objects that contain instance variables like the one "color" that is being set to 2 in the above statement. Pieces is not static - that is there are many different copies of pieces, each with its own data, but only one board. The array has been initialized and defined as both public Piece[][] Board = new Piece[8][8] and public static Piece[][] Board = new Piece[8][8], but no matter how I mess around with it (getting rid of static, putting the variable in another object, etc.), I can't seem to get the error to go away. Help?

    Read the article

  • MS Access PIVOT with User Defined Field

    - by user2535359
    Any of you good souls please help!! I need to query the source table shown in the below. (NULL are blank fields) UNUM, Ticket, Overflow 1 , 135 , NULL 1 , 136 ,NULL 1, 137, NULL 1, 138, NULL 1, NULL, 2b 2, 135, NULL 2, 136, NULL 2, 137, NULL 3, 135, NULL 3, 136, NULL 3, 137,NULL 3, 138, NULL 3, 139, NULL 3, 140, NULL 3, NULL, 66a 4, NULL, 12a 5, NULL, 14a I need to generate the output as shown below. UserNum, Ticket1, Ticket2, Ticket3, Ticket4, Ticket5, Ticket6, Ticket7, Ticket8, Ticket9, Overflow 1, 135, 136, 137, 138, Null, Null, Null, Null, Null, 2b 2, 135, 136, 137, Null, Null, Null, Null, Null, Null, Null 3, 135, 136, 137, 138, 139, 140, Null, Null, Null, 66a 4, Null, Null, Null, Null, Null, Null, Null, Null, Null, 12a 5, Null, Null, Null, Null, Null, Null, Null, Null, Null, 14a The source table has multiple tickets assigned to user. There are always maximum of 9 tickets. The user either has a ticket or an overflow but here can be only overflow per user. I am having issue pivoting the data in Ticket column to pre-defined field names like Ticket1, Ticket2...

    Read the article

  • Python Etiquette: Importing Modules

    - by F3AR3DLEGEND
    Say I have two Python modules: module1.py: import module2 def myFunct(): print "called from module1" module2.py: def myFunct(): print "called from module2" def someFunct(): print "also called from module2" If I import module1, is it better etiquette to re-import module2, or just refer to it as module1.module2? For example (someotherfile.py): import module1 module1.myFunct() # prints "called from module1" module1.module2.myFunct() # prints "called from module2" I can also do this: module2 = module1.module2. Now, I can directly call module2.myFunct(). However, I can change module1.py to: from module2 import * def myFunct(): print "called from module1" Now, in someotherfile.py, I can do this: import module1 module1.myFunct() # prints "called from module1"; overrides module2 module1.someFunct() # prints "also called from module2" Also, by importing *, help('module1') shows all of the functions from module2. On the other hand, (assuming module1.py uses import module2), I can do: someotherfile.py: import module1, module2 module1.myFunct() # prints "called from module1" module2.myFunct() # prints "called from module2" Again, which is better etiquette and practice? To import module2 again, or to just refer to module1's importation?

    Read the article

  • Connecting form to database errors

    - by Russell Ehrnsberger
    Hello I am trying to connect a page to a MySQL database for newsletter signup. I have the database with 3 fields, id, name, email. The database is named newsletter and the table is named newsletter. Everything seems to be fine but I am getting this error Notice: Undefined index: Name in C:\wamp\www\insert.php on line 12 Notice: Undefined index: Name in C:\wamp\www\insert.php on line 13 Here is my form code. <form action="insert.php" method="post"> <input type="text" value="Name" name="Name" id="Name" class="txtfield" onblur="javascript:if(this.value==''){this.value=this.defaultValue;}" onfocus="javascript:if(this.value==this.defaultValue){this.value='';}" /> <input type="text" value="Enter Email Address" name="Email" id="Email" class="txtfield" onblur="javascript:if(this.value==''){this.value=this.defaultValue;}" onfocus="javascript:if(this.value==this.defaultValue){this.value='';}" /> <input type="submit" value="" class="button" /> </form> Here is my insert.php file. <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="newsletter"; // Database name $tbl_name="newsletter"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Get values from form $name=$_POST['Name']; $email=$_POST['Email']; // Insert data into mysql $sql="INSERT INTO $tbl_name(name, email)VALUES('$name', '$email')"; $result=mysql_query($sql); // if successfully insert data into database, displays message "Successful". if($result){ echo "Successful"; echo "<BR>"; echo "<a href='index.html'>Back to main page</a>"; } else { echo "ERROR"; } ?> <?php // close connection mysql_close(); ?>

    Read the article

  • Codeigniter view file looping query

    - by user2505513
    Right, I'm unsure about how to code my view file to generate following query results WITHOUT compromising the principles of mvc. Query in model: SELECT * FROM events GROUP BY country, area ORDER BY country, area View: <?php if (isset($query)):?> <?php foreach ($query as $row):?> <h2><?=$row->country?></h2> <h3><?=$row->area?></h3> <?php endforeach;?> <?php endif;?> I want the results to display: England North South West - utilising the GROUP BY parameter As opposed to: England North England South England West Has anybody any advice as to how to achieve this?

    Read the article

  • Error: "Suite Integration Toolkit Executable has stopped working" during VS2010 installation

    - by Daniel
    After uinstalling VS2012 and installing back Visual Studio 2010 C# Express I was getting strane warning: 2008 is not a valid number so I decided to reinstall VS2010, but I couldn't uinstall it. I was getting error: Suite Integration Toolkit Executable has stopped working. I managed to uinstall VS2010 with VS2010 Uinstall Tool, but now I want to install Visual Studio 2010 C# Express back. I'm getting Suite Integration Toolkit[...] error again when I try to install it using web installer. Could you help me resolve my problem? And I've got Tablet PC Components function disabled in Control Panel / Programs and Utilites.

    Read the article

  • How to hide/show div using jQuery without altering dimensions?

    - by Byron S
    I have a div that is holding a google chart: <div id="chart_div" style="width: 600px; height: 300px;"></div> It has one CSS property: display: none. On the click of a button, I would like to have the chart be displayed using jQuery hide() and show(). It's working, however, the chart's dimensions are set to something different than I have specified and refuse to change to what I have specified. Here is my jquery code: $(document).ready(function(){ var chart = $('#chart_div'); $('#submit').click(function(){ chart.show('slow'); }); }); Let me know if theres any more code you would like to see. By the way, the chart div is not being contained in anything else so that isn't the problem.

    Read the article

  • Jquery Ajax Call In For Loop Only Runs Once - Possible Issue with Timing & Exit Condition?

    - by Grumps
    Background I'm building a form that uses autocomplete against the EchoNest API. First the users picks an artist, using the Artist Suggest call. Next they select a song but the Song and/Or Artist song search doesn't provide a "wild card" search. It only returns exact matches. So based on the forums they suggest building an array of the songs and using auto complete on the array. I can only get a maximum of 100 responses at a time. I do know based on the initial response the number of songs. My Plan: Wrap the ajax call in a for loop ('runonceloop'). Amend the loop exit condition after the first response with the total number of songs. Challenge I'm having: The 'runonceloop' only completes a singe loop because or at least that's what I believe: The exit condition is satisfied before the first response [1] is received. I've tried to adjust the 'exit condition' and 'counter' such that they are set and and increased at the end of the success block. This seems to lock up my browser. Can someone provide some guidance on this situation?[2] I'd really appreciate it. I also don't think turning async off is a good idea because it locks the browser. Response[1]: { "response": { "status": { "code": "0", "message": "Success", "version": "4.2" }, "start": 0, "total": 121, //Used for "songs": [ { "id": "SOXZYYG127F3E1B7A2", "title": "Karma police" }, { "id": "SOXZABD127F3E1B7A2", "title" : "Creep" } ] } } } Code[2] var songsList = []; function getSongs() { var numsongs = 2; //at least 2 runs. var startindex = 0; runonceloop: //<~~~~Referenced in question for (var j = 0;j >= numsongs;) { console.log('numsongs' + numsongs); $.ajax({ url: "http://developer.echonest.com/api/v4/artist/songs", dataType: "jsonp", data: { results: 100, api_key: "XXXXXXXXXXX", format: "jsonp", name: $("#artist").val(), start: startindex }, success: function (data) { var songs = data.response.songs; numsongs = data.response.total; //modify exit condition for (var i = 0; i < songs.length; i++) { songsList.push(songs[i].title); } j +=100;// increase by 100 to match number of responses. } }); }};

    Read the article

  • Get content of a div

    - by Sergiu
    <select> <div class="options"> <option value="nothing">Nothing</option> <option value="snothing">Second Nothing</option> </div> </select> I want to get the content of the DIV and print it inside javascript in a selector. $(document).ready(function () { var options = $('.options').html(); . . . var content = '<select>' + options + '</select>'; . . . }); I need to take options from the HTML. I've created a div indise <select></select> tags, because I had no other idea. But it's not working! I tried to put the options var inside <p></p> tags so i can print it, it sais 'undefined'.

    Read the article

  • CSS3 animations - how to make different animations to different elements on scroll

    - by DeanDeey
    I have a question about the doing CSS3 animations on scroll.. I found a code, that shows the DIV element after the user scrolls down: <script type="text/javascript"> $(document).ready(function() { /* Every time the window is scrolled ... */ $(window).scroll( function(){ /* Check the location of each desired element */ $('.hideme').each( function(i){ var bottom_of_object = $(this).position().top + $(this).outerHeight(); var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).animate({'opacity':'1'},500); } }); }); }); </script> I'm building a site, which one will have about 5 different boxes, which one will be shown when the user scrolls down to each box. But my question is, how i make the animation inside those boxes. Foe example: in each box there is title, content and images. How do i make all the elements appear after each other, because with this code all the class elements are shown at once. But i would like that if user scrolls down, first the tittle appears, then the content and at the end the images. And then when user scrolls to the next box, the same process repeat's itself. I use some CSS3 delays, but in this case i don't know how long will user take to scroll down. thanks!

    Read the article

  • Java Hibernate session delete of object

    - by user2535201
    I'm really struggling with hibernate sessions, I never have the result I expect when making a query on a modified session object. I think all my problems are related. The last one is the following : final Session iSession = AbstractDAO.getSessionFactory().openSession(); try { iSession.beginTransaction(); MyObject iObject = DAOMyObject.getInstance().get(iSession,ObjectId); iObject.setQuantity(0); //previously the quantity was different from zero DAOMyObject.getInstance().update(iSession,iObject); DAOMyObject.getInstance().deleteObjectWithZeroQuantities(iSession); iSession.getTransaction().commit(); } catch (final Exception aException) { iSession.getTransaction().rollback(); logger.error(aException.getMessage(), aException); throw aException; } finally { iSession.close(); } What I'm not getting is why the object is not deleted, since I'm modified it in the session, the query making the delete should find it. I had the same problem with creating an object with an incremental id in a session, then creating another one in the same session before the commit, with a select max(id)+1. But the session gets me the same number of id every time.

    Read the article

  • Github file size limit changed 6/18/13. Can't push now

    - by slindsey3000
    How does this change as of June 18, 2013 affect my existing repository with a file that exceeds that limit? I last pushed 2 months ago with a large file. I have a large file that I have removed locally but I can not push anything now. I get a "remote error" ... remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB I added the file to .gitignore after original push... But it still exists on remote (origin) Removing it locally should get rid of it at origin(Github) right? ... but ... it is not letting me push because there is a file on Github that exceeds the limit... https://github.com/blog/1533-new-file-size-limits These are the commands I issued plus error messages.. git add . git commit -m "delete cron_log.log" git push origin master remote: Error code: 40bef1f6653fd2410fb2ab40242bc879 remote: warning: Error GH413: Large files detected. remote: warning: See http://git.io/iEPt8g for more information. remote: error: File cron_log.log is 141.41 MB; this exceeds GitHub's file size limit of 100 MB remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB To https://github.com/slinds(omited_here)/linexxxx(omited_here).git ! [remote rejected] master - master (pre-receive hook declined) error: failed to push some refs to 'https://github.com/slinds(omited_here) I then tried things like git rm cron_log.log git rm --cached cron_log.log Same error.

    Read the article

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