Daily Archives

Articles indexed Monday November 12 2012

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

  • How do I render an entire frame to a Texture2D?

    - by redcodefinal
    I asked a question here: C# XNA Make rendered screen a texture2d But, I ended up not getting the exact result I was looking for since I didn't ask the question right. In a game I am writing, I render an extremely large city out of objects, this can cause lag when moving the camera to view things that are off screen. I need a way to render then ENTIRE city, even the stuff that is off screen, and make it into a Texture2D. The answer I chose for the last one didn't work entirely right because it only gets what is on screen, not what is off.

    Read the article

  • Child transforms problem when loading 3DS models using assimp

    - by MhdSyrwan
    I'm trying to load a textured 3d model into my scene using assimp model loader. The problem is that child meshes are not situated correctly (they don't have the correct transformations). In brief: all the mTansform matrices are identity matrices, why would that be? I'm using this code to render the model: void recursive_render (const struct aiScene *sc, const struct aiNode* nd, float scale) { unsigned int i; unsigned int n=0, t; aiMatrix4x4 m = nd->mTransformation; m.Scaling(aiVector3D(scale, scale, scale), m); // update transform m.Transpose(); glPushMatrix(); glMultMatrixf((float*)&m); // draw all meshes assigned to this node for (; n < nd->mNumMeshes; ++n) { const struct aiMesh* mesh = scene->mMeshes[nd->mMeshes[n]]; apply_material(sc->mMaterials[mesh->mMaterialIndex]); if (mesh->HasBones()){ printf("model has bones"); abort(); } if(mesh->mNormals == NULL) { glDisable(GL_LIGHTING); } else { glEnable(GL_LIGHTING); } if(mesh->mColors[0] != NULL) { glEnable(GL_COLOR_MATERIAL); } else { glDisable(GL_COLOR_MATERIAL); } for (t = 0; t < mesh->mNumFaces; ++t) { const struct aiFace* face = &mesh->mFaces[t]; GLenum face_mode; switch(face->mNumIndices) { case 1: face_mode = GL_POINTS; break; case 2: face_mode = GL_LINES; break; case 3: face_mode = GL_TRIANGLES; break; default: face_mode = GL_POLYGON; break; } glBegin(face_mode); for(i = 0; i < face->mNumIndices; i++)// go through all vertices in face { int vertexIndex = face->mIndices[i];// get group index for current index if(mesh->mColors[0] != NULL) Color4f(&mesh->mColors[0][vertexIndex]); if(mesh->mNormals != NULL) if(mesh->HasTextureCoords(0))//HasTextureCoords(texture_coordinates_set) { glTexCoord2f(mesh->mTextureCoords[0][vertexIndex].x, 1 - mesh->mTextureCoords[0][vertexIndex].y); //mTextureCoords[channel][vertex] } glNormal3fv(&mesh->mNormals[vertexIndex].x); glVertex3fv(&mesh->mVertices[vertexIndex].x); } glEnd(); } } // draw all children for (n = 0; n < nd->mNumChildren; ++n) { recursive_render(sc, nd->mChildren[n], scale); } glPopMatrix(); } What's the problem in my code ? I've added some code to abort the program if there's any bone in the meshes, but the program doesn't abort, this means : no bones, is that normal? if (mesh->HasBones()){ printf("model has bones"); abort(); } Note: I am using openGL & SFML & assimp

    Read the article

  • 2D game collision response: SAT & minimum displacement along a given axis?

    - by Archagon
    I'm trying to implement a collision system in a 2D game I'm making. The separating axis theorem (as described by metanet's collision tutorial) seems like an efficient and robust way of handling collision detection, but I don't quite like the collision response method they use. By blindly displacing along the axis of least overlap, the algorithm simply ignores the previous position of the moving object, which means that it doesn't collide with the stationary object so much as it enters it and then bounces out. Here's an example of a situation where this would matter: According to the SAT method described above, the rectangle would simply pop out of the triangle perpendicular to its hypotenuse: However, realistically, the rectangle should stop at the lower right corner of the triangle, as that would be the point of first collision if it were moving continuously along its displacement vector: Now, this might not actually matter during gameplay, but I'd love to know if there's a way of efficiently and generally attaining accurate displacements in this manner. I've been racking my brains over it for the past few days, and I don't want to give up yet! (Cross-posted from StackOverflow, hope that's not against the rules!)

    Read the article

  • Will I have an easier time learning OpenGL in Pygame or Pyglet? (NeHe tutorials downloaded)

    - by shadowprotocol
    I'm looking between PyGame and Pyglet, Pyglet seems to be somewhat newer and more Pythony, but it's last release according to Wikipedia is January '10. PyGame seems to have more documentation, more recent updates, and more published books/tutorials on the web for learning. I downloaded both the Pyglet and PyGame versions of the NeHe OpenGL tutorials (Lessons 1-10) which cover this material: lesson01 - Setting up the window lesson02 - Polygons lesson03 - Adding color lesson04 - Rotation lesson05 - 3D lesson06 - Textures lesson07 - Filters, Lighting, input lesson08 - Blending (transparency) lesson09 - 2D Sprites in 3D lesson10 - Moving in a 3D world What do you guys think? Is my hunch that I'll be better off working with PyGame somewhat warranted?

    Read the article

  • Is the TCP protocol good enough for real-time multiplayer games?

    - by kevin42
    Back in the day, TCP connections over dialup/ISDN/slow broadband resulted in choppy, laggy games because a single dropped packet resulted in a resync. That meant a lot of game developers had to implement their own reliability layer on top of UDP, or they used UDP for messages that could be dropped or received out of order, and used a parallel TCP connection for information that must be reliable. Given the average user has faster network connections now, can a real time game such as an FPS give good performance over a TCP connection?

    Read the article

  • CodeIgniter site in subdirectory, htaccess file maybe interfering with htaccess file in main directory?

    - by patricksayshi
    In my CodeIgniter site, navigating to any page but the index gives me this error: No input file specified. Googling around, it seems like the cause must have something to do with my .htaccess situation. The way this is set up, and maybe this can eventually change, is that my CI site is in a subdirectory of the main domain. The CI site and main domain each have their own .htaccess files. The CI htacess file is located in the applications folder: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /SubDomain/index.php?$1 [L] </IfModule> And here's the main htaccess file is two levels up from the CI one, reading thusly: RewriteEngine on RewriteCond %{SERVER_PORT} 80 rewriterule ^(.*)$ https://www.MainDomain.org/$1 [r=301,nc] I am afraid these two sets of re-write rules are conflicting with each other and I really have no idea what to do about it. I can alter either htaccess file and would really like to get them working together in peace and harmony. It's also possible, however, that this has nothing whatsoever to do with htaccess. Also, it's hosted on GoDaddy.

    Read the article

  • Converting image to byte/encoding it? - RichTextBox

    - by user1667191
    I have strings that are "Images", although they are in "String" format. Here's how one of the strings look like: {\pict\wmetafile8\picw820\pich900\picwgoal465\pichgoal510 010009000003ac1000000000f60900000000f6090000..etc.. It goes on like this for a few more lines. The guy that got this said he converted the image by pasting it in a richtextbox and getting that string. How can I go about getting the same result? Sorry for the lack of info. Just not sure how this is called.

    Read the article

  • Session hijacking prevention...how far will my script get me? additional prevention procedures?

    - by Yusaf Khaliq
    When the user logs in the current session vairables are set $_SESSION['user']['timeout'] = time(); $_SESSION['user']['ip'] = $_SERVER['REMOTE_ADDR']; $_SESSION['user']['agent'] = $_SERVER['HTTP_USER_AGENT']; In my common.php page (required on ALL php pages) i have used the below script, which resets a 15 minute timer each time the user is active furhtermore checks the IP address and checks the user_agent, if they do not match that as of when they first logged in/when the session was first set, the session is unset furthermore with inactivity of up to 15 minutes the session is also unset. ... is what i have done a good method for preventing session hijacking furthermore is it secure and or is it enough? If not what more can be done? if(!empty($_SESSION['user'])){ if ($_SESSION['user']['timeout'] + 15 * 60 < time()) { unset($_SESSION['user']); } else { $_SESSION['user']['timeout'] = time(); if($_SESSION['user']['ip'] != $_SERVER['REMOTE_ADDR']){ unset($_SESSION['user']); } if($_SESSION['user']['agent'] != $_SERVER['HTTP_USER_AGENT']){ unset($_SESSION['user']); } } }

    Read the article

  • Which language to learn C# or Salesforce.com/apex for C++ programmer

    - by polapts
    Being a C++ programmer with 7-8 years of experience, I wanted to know the market trends. When I searched a little bit I found more jobs with keyword C# than C++ or Java. I am just wondering if it is a good idea to learn C# or Java from a career perspective. Also, I read somewhere about Salesforce/apex. It was mentioned that this is something in vogue. So my question is which technology I should go for C#/Java/Salesforce(Apex) from career perspective? Thanks

    Read the article

  • replace a random word of a string with a random replacement

    - by tpickett
    I am developing a script that takes an article, searches the article for a "keyword" and then randomly replaces that keyword with an anchor link. I have the script working as it should, however I need to be able to have an array of "replacements" for the function to loop through and insert at the random location. So the first random position would get anchor link #1. The second random position would get anchor link #2. The third random position would get anchor link #3. etc... I found half of the answer to my question here: PHP replace a random word of a string public function replace_random ($str, $search, $replace, $n) { // Get all occurences of $search and their offsets within the string $count = preg_match_all('/\b'.preg_quote($search, '/').'\b/', $str, $matches, PREG_OFFSET_CAPTURE); // Get string length information so we can account for replacement strings that are of a different length to the search string $searchLen = strlen($search); $diff = strlen($replace) - $searchLen; $offset = 0; // Loop $n random matches and replace them, if $n < 1 || $n > $count, replace all matches $toReplace = ($n < 1 || $n > $count) ? array_keys($matches[0]) : (array) array_rand($matches[0], $n); foreach ($toReplace as $match) { $str = substr($str, 0, $matches[0][$match][1] + $offset).$replace.substr($str, $matches[0][$match][1] + $searchLen + $offset); $offset += $diff; } return $str; } So my question is, How can i alter this function to accept an array for the $replace variable?

    Read the article

  • creating new instance fails PHP

    - by as3isolib
    I am relatively new to PHP and having some decent success however I am running into this issue: If I try to create a new instance of the class GenericEntryVO, I get a 500 error with little to no helpful error information. However, if I use a generic object as the result, I get no errors. I'd like to be able to cast this object as a GenericEntryVO as I am using AMFPHP to communicate serialize data with a Flex client. I've read a few different ways to create constructors in PHP but the typical 'public function Foo()' for a class Foo was recommended for PHP 5.4.4 //in my EntryService.php class public function getEntryByID($id) { $link = mysqli_connect("localhost", "root", "root", "BabyTrackingAppDB"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $query = "SELECT * FROM Entries WHERE id = '$id' LIMIT 1"; if ($result = mysqli_query($link, $query)) { // $entry = new GenericEntryVO(); this is where the problem lies! while ($row = mysqli_fetch_row($result)) { $entry->id = $row[0]; $entry->entryType = $row[1]; $entry->title = $row[2]; $entry->description = $row[3]; $entry->value = $row[4]; $entry->created = $row[5]; $entry->updated = $row[6]; } } mysqli_free_result($result); mysqli_close($link); return $entry; } //my GenericEntryVO.php class <?php class GenericEntryVO { public function __construct() { } public $id; public $title; public $entryType; public $description; public $value; public $created; public $updated; // public $properties; } ?>

    Read the article

  • Issue with parsed text with HTMLCleaner - spaces at the begining of text

    - by ansol90
    Im able to get text using HTMLCleaner from website. The problem is that when I set the text to a TextView it shows the beginning of the text with a big space on it. Here is the screenshot of what im talking about. I have tried android:gravity but nothing happened. Please help. Here is my Code: private class SiteParser extends AsyncTask<String, Void, String> { protected String doInBackground(String... arg) { String output = null; try { HtmlHelper hh = new HtmlHelper(new URL(arg[0])); List<TagNode> news = hh.getnewsByClass("TextoPrint"); for (Iterator<TagNode> iterator = newss.iterator(); iterator .hasNext();) { TagNode divElement = (TagNode) iterator.next(); output = divElement.getText().toString(); } } catch (Exception e) { e.printStackTrace(); } return output; } protected void onPostExecute(String output) { Bundle bundle=new Bundle(); bundle.putString("body",output); Intent mainIntent = new Intent(act, MyView.class); mainIntent.putExtras(bundle); startActivity(mainIntent); act.finish(); } } public class HtmlHelper { TagNode rootNode; public HtmlHelper(URL htmlPage) throws IOException, XPatherException { HtmlCleaner cleaner = new HtmlCleaner(); rootNode = cleaner.clean(htmlPage); } List<TagNode> getnewsByClass(String Classname){ List<TagNode> newsList = new ArrayList<TagNode>(); TagNode divElements[] = rootNode.getElementsByName("div", true); for (int i = 0; divElements != null && i < divElements.length; i++) { String classType = divElements[i].getAttributeByName("id"); if (classType != null && classType.equals(Classname)) { newsList.add(divElements[i]); } } return newsList; } }

    Read the article

  • Force Python to be 32 bit on OS X Lion

    - by sciencectn
    I'm trying to use CPLEX within Python on Mac OS 10.7.5. CPLEX appears to only support a 32 bit python. I'm using this in a python shell to check if it's 32 bit: import sys,platform; print platform.architecture()[0], sys.maxsize > 2**32 I've tried these 2 commands as suggested in man 1 python, but neither seem to force 32 bit: export VERSIONER_PYTHON_PREFER_32_BIT=yes defaults write com.apple.versioner.python Prefer-32-Bit -bool yes The only thing that seems to work is this: arch -i386 python However, if I run a script using arch which calls other scripts, they all seem to start up in 64 bit mode. Is there another system wide variable to force it into 32 bit mode?

    Read the article

  • func_get_args detect context

    - by Steve
    I have a script where it accepts a varying number of arguments. I want to use func_get_args to perform operations on said arguments. If I have one function like this: function Something() { foreach(func_get_args($this) as $functions) { // Do something } // Return.. } I want to be able to call this function in, for example, another function to add/save entries. The add/save function would have arguments 'title', 'description' etc.. I basically want to know if there is a way to detect the context of a function call. Can I pass something to func_get_args that will let it know that its called in a certain function? So if I do: function Save($title, $desc) { $vars = $this->Something(); } I want $vars to contain $title and $desc after modifying them.

    Read the article

  • VB looping complication

    - by user1819469
    I have to come up with a program that shifts names in a text box a random amount of times. I have gotten everything up to the point where the names shifts a random amount of times. It only shifts its once, but my messagebox appears through the code as many times as the names should be shifting once i click ok. Does anyone know why the loop is not working for the name shifts. I was thinking maybe the messagebox needs to control the loop, but I have searched endlessly and cannot find how that would be done. Any suggestions or referrals to other sites would be nice thanks. My code is below. Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim RandomNumber As Integer Dim min, max As Integer Dim temp, temp2, temp3, temp4, temp5, temp6 As String Dim i As Integer min = 3 max = 11 Randomize() RandomNumber = Int((max - min + 1) * Rnd() + min) temp = n1.Text temp2 = n2.Text temp3 = n3.Text temp4 = n4.Text temp5 = n5.Text temp6 = n6.Text For i = 0 To RandomNumber - 1 n1.Text = temp6 n2.Text = temp n3.Text = temp2 n4.Text = temp3 n5.Text = temp4 n6.Text = temp5 MessageBox.Show("Shift " & i & " of " & RandomNumber & " complete") Next End Sub End Class

    Read the article

  • PHP preg_replace function returns different values with the same data set

    - by patryk
    I need to use preg_match PHP function. I have a simple pattern to check the string and the thing is as follows: when I run the script at first, it gives me no match (it is supposed to match though) but when I hold F5 in my browser for a while, out of a sudden it says there's a match within the string. As I keep pushing F5, it gives either true or false. Say the pattern is /^(.*)\/[A-Za-z0-9]*$/ (I guess it's not the best way but still) and the subject is galeria/zdjecia/. I believe preg_match should return true with this set of data. Note that the data does not change when pressing F5. Why is that?

    Read the article

  • scanf a byte then print it out?

    - by Sarah
    I've searched around to see if I can find this answer but I can't seem to (please let me know if I'm wrong). I am trying to use scanf to read in a byte, an unsigned int and a char in one .c file and I am trying to access this byte in a different .c file and print it out. (I have already checked to make sure I have included all the appropriate parameters everywhere) But I keep getting errors. The warnings are: database.c: In function ‘addCitizen’: database.c:23:2: warning: format ‘%hhu’ expects argument of type ‘int’, but argument 2 has type ‘byte *’ [-Wformat] database.c:24:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘int *’ [-Wformat] database.c:25:2: warning: format ‘%c’ expects argument of type ‘int’, but argument 2 has type ‘char *’ [-Wformat] where I'm scanf'ing: // Request loop while (count-- != 0) { while (1){ // Get values from the user int error = scanf ("%79s %hhu %u %c", tname, &tdist, &tyear, &tgender); addCitizen(db, tname, &tdist, &tyear, &tgender); where I'm printing: void addCitizen(Database *db, char *tname, byte *tdist, int *tyear, char *tgender){ //needs to find the right place in memory to put this stuff and then put it there printf("\nName is: %79s\n", tname); printf("District is: %hhu\n", tdist); printf("Year of birth is: %u\n", tyear); printf("Gender is:%c\n", tgender); I'm not sure where I'm going wrong?

    Read the article

  • HTML CheckBox labels within a container are not displayed as expected

    - by Tiny
    The following HTML code attempts to display checkboxes inside a <div></div> container. <div style="overflow: auto; width: auto; display:block; max-height:130px; max-width:200px; background-color: #FFF; height: auto; border: 1px double #336699; padding-left: 2px;"> <label for="chk12" style='white-space: nowrap;'> <input type='checkbox' id="chk12" name='chk_colours' value="12" class='validate[required] text-input text'> <div style='background-color:#FF8C00; width: 180px;' title="darkorange">&nbsp;&nbsp;</div> </label> <label for="chk11" style='white-space: nowrap;'> <input type='checkbox' id="chk11" name='chk_colours' value="11" class='validate[required] text-input text'> <div style='background-color:#D9D919; width: 180px;' title="brightgold">&nbsp;&nbsp;</div> </label> <label for="chk10" style='white-space: nowrap;'> <input type='checkbox' id="chk10" name='chk_colours' value="10" class='validate[required] text-input text'> <div style='background-color:#76EE00; width: 180px;' title="chartreuse2">&nbsp;&nbsp;</div> </label> <label for="chk9" style='white-space: nowrap;'> <input type='checkbox' id="chk9" name='chk_colours' value="9" class='validate[required] text-input text'> <div style='background-color:#2E0854; width: 180px;' title="indigo">&nbsp;&nbsp;</div> </label> <label for="chk8" style='white-space: nowrap;'> <input type='checkbox' id="chk8" name='chk_colours' value="8" class='validate[required] text-input text'> <div style='background-color:#292929; width: 180px;' title="gray16">&nbsp;&nbsp;</div> </label> </div> What it displays can be visible in the following snap shot. It is seen that various colour stripes which are displayed using the following <div> tag <div style='background-color:#FF8C00; width: 180px;' title="darkorange">&nbsp;&nbsp</div> are displayed below their respective checkboxes which are expected to be displayed in a straight line even though I'm using the white-space: nowrap; style attribute. How to display each stripe along with its respective checkbox in a straight line? It was explained in one of my questions itself but in that question each checkbox had a text label in place of such colour stripes. Here it is. I tried to do as mentioned in the accepted answer of that question but to no avail in this case.

    Read the article

  • How to get Media Picker Field via proxy record of many-to-many in orchard

    - by Sergey Schipanov
    I need to access mediapickerfield in Widget view. This field is relative to 'ActionPart'. I have a problem, when I create many-to-many relationships to display my 'ActionPart' in the widget. When I mapped many-to-many I take an 'ActionPart' and but cannot access the mediapickerfield. Records classes public class ActionPartRecord : ContentPartRecord { public virtual string Text { get; set; } public virtual double Price { get; set; } public virtual int TextPosX { get; set; } public virtual int TextPosY { get; set; } public virtual String TextSale { get; set; } public virtual int Color { get; set; } } public class ActionListRecord { public virtual int Id { get; set; } public virtual ActionPartRecord ActionPartRecord { get; set; } public virtual ActionWidgetPartRecord ActionWidgetPartRecord { get; set; } } public class ActionWidgetPartRecord : ContentPartRecord { public ActionWidgetPartRecord() { ActionList = new List<ActionListRecord>(); } public virtual IList<ActionListRecord> ActionList { get; set; } } public class ActionWidgetPart : ContentPart<ActionWidgetPartRecord> { public IEnumerable<ActionPartRecord> ActionList { get { return Record.ActionList.Select(x => x.ActionPartRecord); } } } ActionPart class public class ActionPart : ContentPart<ActionPartRecord> { public String Text { get { return Record.Text; } set { Record.Text = value; } } /*other field*/ } Migrations public int Create() { SchemaBuilder.CreateTable("ActionPartRecord", table => table .ContentPartRecord() .Column<string>("Text") .Column<double>("Price") .Column<int>("TextPosX") .Column<int>("TextPosY") .Column<string>("TextSale") .Column<int>("Color") ); ContentDefinitionManager.AlterPartDefinition("ActionPart", builder => builder .WithField("BaseImage", fieldBuilder => fieldBuilder.OfType("MediaPickerField").WithDisplayName("Action Image")) .WithField("PatternImage", fieldBuilder => fieldBuilder.OfType("MediaPickerField").WithDisplayName("Pattern Image")) .WithField("TimeExp", fieldBuilder => fieldBuilder.OfType("DateTimeField").WithDisplayName("Expecting date")) .Attachable()); ContentDefinitionManager.AlterTypeDefinition("Action", cfg => cfg .WithPart("CommonPart") .WithPart("TitlePart") .WithPart("RoutePart") .WithPart("BodyPart") .WithPart("ActionPart") .Creatable() .Indexed()); SchemaBuilder.CreateTable("ActionListRecord", table => table .Column<int>("Id", column => column.PrimaryKey().Identity()) .Column<int>("ActionPartRecord_Id") .Column<int>("ActionWidgetPartRecord_Id") ); SchemaBuilder.CreateTable("ActionWidgetPartRecord", table => table .ContentPartRecord() ); ContentDefinitionManager.AlterPartDefinition( "ActionWidgetPart", builder => builder.Attachable()); ContentDefinitionManager.AlterTypeDefinition("ActionWidget", cfg => cfg .WithPart("ActionWidgetPart") .WithPart("WidgetPart") .WithPart("CommonPart") .WithSetting("Stereotype", "Widget")); return 1; } Driver Display method protected override DriverResult Display( ActionWidgetPart part, string displayType, dynamic shapeHelper) { return ContentShape("Parts_ActionWidget", () => shapeHelper.Parts_ActionWidget( ContentPart: part, ActionList: part.ActionList)); } Widget View @foreach (var action in Model.ActionList) { <div class="item"> *How to access BaseImage Field in this row* <div class="sale-pattern"></div> <div class="container"> <div class="carousel-caption"> <h1>@action.Text</h1> <h1 class="price">@action.Price</h1> </div> </div> </div> }

    Read the article

  • Dynamic jQuery Validate error messages with AddMethod based on the element

    - by mcpDESIGNS
    Let's say I have a custom AddMethod to jQuery Validate like: $.validator.addMethod('min-length', function (val, element) { // do stuff // the error message here needs to be dynamic }, 'The field cannot be less than than ' + element.attr('data-min') + // it is within the closure, but it can't grab it ' length.'); I can't figure out a way to get the element variable in question, and get any values from it. What am I missing here?

    Read the article

  • build error, warning MSB3258

    - by Steed
    I have recently moved my solution from my main dev machine using vs2010 pro sp1 to a new machine. The setup is supposed to be the same except its failing to build. Its giving errors like c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3258: The primary reference "C:\rep\hms\trunk\ikassystemv3\ikasDAL\bin\Debug\ikasDAL.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. However all all the libraries in question are set to use the .net 2 framework and I need it this way or else it will break stuff that uses them. However for some reason it seems to think that somehow my .net 2 system libs are somehow referencing .net 4 stuff. All the referenced libs are .net 2 You can see my build output here http://tinyurl.com/bnugru4

    Read the article

  • MySQL : Calculate business day difference between two dates column

    - by yokoyoko
    My sql query returns back two columns, first column is "date created" and second column is "date updated", first column has a prior timestamp with respect to second column. I need to add a third column which can display business day hrs (9:00am to 5:00pm) response i.e. if date created is 2012-01-01 09:00:20 and "dated updated" is 4:00pm same day then third column should display 7 hrs If date created is 2012-01-01 16:00:20 (4:00pm) and "date updated" is 10:00m on 2012:01:02 (2nd Jan) then third column should display 2 hrs. It should exclude Saturday and Sunday. Can you please suggest appropriate SQL query for this.

    Read the article

  • Function template accepting nothing less than a bidirectional iterator or a pointer

    - by san
    I need a function template that accepts two iterators that could be pointers. If the two arguments are random_access iterators I want the return type to be an object of std::iterator<random_access_iterator_tag, ...> type else a std::iterator<bidirectional_iterator_tag, ...> type. I also want the code to refuse compilation if the arguments are neither a bidirectional iterator, nor a pointer. I cannot have dependency on third party libraries e.g. Boost Could you help me with the signature of this function so that it accepts bidirectional iterators as well as pointers, but not say input_iterator, output_iterator, forward_iterators. One partial solution I can think of is the following template<class T> T foo( T iter1, T iter2) { const T tmp1 = reverse_iterator<T>(iter1); const T tmp2 = reverse_iterator<T>(iter2); // do something } The idea is that if it is not bidirectional the compiler will not let me construct a reverse_iterator from it.

    Read the article

  • Does anyone know how to layout a JToolBar that does't move or re-size any components placed in it?

    - by S1.Mac
    Can anyone help with this problem i'm trying to create a JToolBar and I want all its components to be fixed in size and position. I'v tried a few different layout managers but they all center and/or re-size the components when the frame its in is re-sized. here is an example using GridbagLayout, I have also used the default layout manager using the toolbar.add( component ) method but the result is the same : ' import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.*; public class ToolBarTest extends JFrame { private JToolBar toolbar; private JPanel mainPanel; private JPanel toolBarPanel; private JButton aButton; private JCheckBox aCheckBox; private JList aList; private Box toolbarBox; private GridBagConstraints toolbarConstraints; private GridBagLayout toolbarLayout; private JLabel shapeLabel; private JComboBox<ImageIcon> shapeChooser; private JLabel colorLabel; private JComboBox colorChooser; private String colorNames[] = { "Black" , "Blue", "Cyan", "Dark Gray", "Gray", "Green", "Light Gray", "Magenta", "Orange", "Pink", "Red", "White", "Yellow", "Custom" }; private String shapeNames[] = { "Line", "Oval", "Rectangle", "3D Rectangle","Paint Brush", "Rounded Rectangle" }; public ToolBarTest() { setLayout( new BorderLayout() ); setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); setSize( 500, 500 ); add( createToolBar(), BorderLayout.PAGE_START ); setVisible( true ); } public void addToToolbar( Component component, int row, int column ) { toolbarConstraints.gridx = column; toolbarConstraints.gridy = row; toolbarConstraints.anchor = GridBagConstraints.WEST; toolbarConstraints.fill = GridBagConstraints.NONE; toolbarConstraints.weightx = 0; toolbarConstraints.weighty = 0; toolbarConstraints.gridwidth = 1; toolbarConstraints.gridheight = 1; toolbarLayout.setConstraints( component, toolbarConstraints ); toolbar.add( component ); }// end addToToolbar public final JToolBar createToolBar() { toolbarLayout = new GridBagLayout(); toolbarConstraints = new GridBagConstraints(); // create the tool bar which holds the items to draw toolbar = new JToolBar(); toolbar.setBorderPainted(true); toolbar.setLayout( toolbarLayout ); toolbar.setFloatable( true ); shapeLabel = new JLabel( "Shapes: " ); addToToolbar( shapeLabel, 0, 1 ); String iconNames[] = { "PaintImages/Line.jpg", "PaintImages/Oval.jpg", "PaintImages/Rect.jpg", "PaintImages/3DRect.jpg","PaintImages/PaintBrush.jpg", "PaintImages/RoundRect.jpg"}; ImageIcon shapeIcons[] = new ImageIcon[ shapeNames.length ]; // create image icons for( int shapeButton = 0; shapeButton < shapeNames.length; shapeButton++ ) { shapeIcons[ shapeButton ] = new ImageIcon( iconNames[ shapeButton ] ); }// end for shapeChooser = new JComboBox< ImageIcon >( shapeIcons ); shapeChooser.setSize( new Dimension( 50, 20 )); shapeChooser.setPrototypeDisplayValue( shapeIcons[ 0 ] ); shapeChooser.setSelectedIndex( 0 ); addToToolbar( shapeChooser, 0, 2 ); colorLabel = new JLabel( "Colors: " ); addToToolbar( colorLabel, 0, 3 ); colorChooser = new JComboBox( colorNames ); addToToolbar( colorChooser, 0, 4 ); return toolbar; }// end createToolBar public static void main( String args[] ) { new ToolBarTest(); }// end main }// end class ToolBarTest'

    Read the article

  • Will using https prevent client from accessing any confidential data inside JavaScript

    - by saveing saving
    I am working on an asp.net mvc web application, on the view i wrote the following JavaScript which calls an external web service :- <script type="text/javascript"> $(function() { $.getJSON("https://MyERPsystem.com/jw/web/json/hr/getsalary/byid?master_username=superadmin&password_hash=9449B5ABCFA9AFDA36B801351ED3DF66&employeeid=A200121", { //code goes here }, function(data) { $.each(data.items, function(i,item){ //code goes here }); }); }) </script> So if the external web service implements https, then does this means that the master_username and password_hash inside the javaScript cannot be seen by external users? Best Regards

    Read the article

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