Daily Archives

Articles indexed Tuesday November 20 2012

Page 8/19 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Unable to install Skype ("Unmet dependencies" error)

    - by Alex Maslakov
    Trying to install skype on Ubuntu 12, I faced and issue. When I type: sudo apt-get update sudo apt-get install skype I get an error Reading package lists... Done Building dependency tree Reading state information... Done skype is already the newest version. You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: skype : Depends: lib32stdc++6 (>= 4.1.1-21) but it is not going to be installed Depends: lib32asound2 (> 1.0.14) but it is not going to be installed Depends: ia32-libs but it is not going to be installed Depends: libc6-i386 (>= 2.7-1) but it is not going to be installed Depends: lib32gcc1 (>= 1:4.1.1-21+ia32.libs.1.19) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). How do I solve it? Is the way I'm using the right one to install skype? UPDATE: If I try to do sudo apt-get install lib32stdc++6 lib32asound2 ia32-libs libc6-i386 lib32gcc1 skype then I get Reading package lists... Done Building dependency tree Reading state information... Done skype is already the newest version. You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: ia32-libs : Depends: ia32-libs-multiarch lib32asound2 : Depends: libasound2 (= 1.0.25-1ubuntu10) E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

    Read the article

  • Stupid simple music player?

    - by itsadok
    Here's what I want: I have a folder with MP3 files. I would like to play all the files in the folder, alphabetically. And I need a way to pause, skip to next file, and that's pretty much it. I don't want to use my music player to organize my music library, I don't need connection to network services, and I don't even need ID3 support. On Windows, WinAmp 2 did what I wanted. What's my best option on Ubuntu?

    Read the article

  • Creating country specific twitter/facebook accounts

    - by user359650
    I see many companies that have an international presence trying to localize their social media presence by creating country or language specific accounts. However some seemed to have done so without following a consistent pattern, one example being the World Wildlife Fund when you look at their Twitter accounts: World_Wildlife : verified account with 200K followers WWF : main account with 800K followers www_uk : lower case with underscore between WWF and country indicator WWFCanada : upper case with country indicator attached to WWF ... I am planning to build a website which hopefully will grow global and would like to avoid this sort of inconsistencies. Also, I was comparing what Twitter and Facebook allow in their username and found out that they don't allow the same characters to be used (e.g. for instance that the former doesn't allow . whereas the latter does) making difficult to ensure consistency across social networks. Hence my questions: Are there known naming schemes for creating localized Twitter and Facebook accounts while maintaining a certain consistency between them (best effort)? Are there any researches out there that have proven whether some schemes were better than others in terms of readability and/or SEO?

    Read the article

  • How to remove duplicate content, which is still indexed, but not linked to anymore?

    - by David
    A bug in the tool, which we use to create search-engine-friendly URLs changed our whole URL-structure overnight, and we only noticed after Google already indexed the page. Now, we have a massive duplicate content issue, causing a harsh drop in rankings. Webmaster Tools shows over 1,000 duplicate title tags, so I don't think, Google understands what is going on. Right URL: abc.com/price/sharp-ah-l13-12000-btu.html Wrong URL: abc.com/item/sharp-l-series-ahl13-12000-btu.html (created by mistake) After that, we ... Changed back all URLs to the "Right URLs" Set up a 301-redirect for all "Wrong URLs" a few days later Now, still a massive amount of pages is in the index twice. As we do not link internally to the "Wrong URLs" anymore, I am not sure, if Google will re-crawl them very soon. What can we do to solve this issue and tell Google, that all the "Wrong URLs" now redirect to the "Right URLs"? Best, David

    Read the article

  • Managing constant buffers without FX interface

    - by xcrypt
    I am aware that there is a sample on working without FX in the samplebrowser, and I already checked that one. However, some questions arise: In the sample: D3DXMATRIXA16 mWorldViewProj; D3DXMATRIXA16 mWorld; D3DXMATRIXA16 mView; D3DXMATRIXA16 mProj; mWorld = g_World; mView = g_View; mProj = g_Projection; mWorldViewProj = mWorld * mView * mProj; VS_CONSTANT_BUFFER* pConstData; g_pConstantBuffer10->Map( D3D10_MAP_WRITE_DISCARD, NULL, ( void** )&pConstData ); pConstData->mWorldViewProj = mWorldViewProj; pConstData->fTime = fBoundedTime; g_pConstantBuffer10->Unmap(); They are copying their D3DXMATRIX'es to D3DXMATRIXA16. Checked on msdn, these new matrices are 16 byte aligned and optimised for intel pentium 4. So as my first question: 1) Is it necessary to copy matrices to D3DXMATRIXA16 before sending them to the constant buffer? And if no, why don't we just use D3DXMATRIXA16 all the time? I have another question about managing multiple constant buffers within one shader. Suppose that, within your shader, you have multiple constant buffers that need to be updated at different times: cbuffer cbNeverChanges { matrix View; }; cbuffer cbChangeOnResize { matrix Projection; }; cbuffer cbChangesEveryFrame { matrix World; float4 vMeshColor; }; Then how would I set these buffers all at different times? g_pd3dDevice->VSSetConstantBuffers( 0, 1, &g_pConstantBuffer10 ); gives me the possibility to set multiple buffers, but that is within one call. 2) Is that okay even if my constant buffers are updated at different times? And do I suppose I have to make sure the constantbuffers are in the same position in the array as the order they appear in the shader?

    Read the article

  • How do 2D physics engines solve the problem of resolving collisions along tiled walls/floors in non-grid-based worlds?

    - by ssb
    I've been working on implementing my SAT algorithm which has been coming along well, but I've found that I'm at a wall when it comes to its actual use. There are plenty of questions regarding this issue on this site, but most of them either have no clear, good answer or have a solution based on checking grid positions. To restate the problem that I and many others are having, if you have a tiled surface, like a wall or a floor, consisting of several smaller component rectangles, and you traverse along them with another rectangle with force being applied into that structure, there are cases where the object gets caught on a false collision on an edge that faces the inside of the shape. I have spent a lot of time thinking about how I could possibly solve this without having to resort to a grid-based system, and I realized that physics engines do this properly. What I want to know is how they do this. What do physics engines do beyond basic SAT that allows this kind of proper collision resolution in complex environments? I've been looking through the source code to Box2D trying to find out how they do it but it's not quite as easy as looking at a Collision() method. I think I'm not good enough at physics to know what they're doing mathematically and not good enough at programming to know what they're doing programmatically. This is what I aim to fix.

    Read the article

  • exporting bind and keyframe bone poses from blender to use in OpenGL

    - by SaldaVonSchwartz
    I'm having a hard time trying to understand how exactly Blender's concept of bone transforms maps to the usual math of skinning (which I'm implementing in an OpenGL-based engine of sorts). Or I'm missing out something in the math.. It's gonna be long, but here's as much background as I can think of. First, a few notes and assumptions: I'm using column-major order and multiply from right to left. So for instance, vertex v transformed by matrix A and then further transformed by matrix B would be: v' = BAv. This also means whenever I export a matrix from blender through python, I export it (in text format) in 4 lines, each representing a column. This is so I can then I can read them back into my engine like this: if (fscanf(fileHandle, "%f %f %f %f", &skeleton.joints[currentJointIndex].inverseBindTransform.m[0], &skeleton.joints[currentJointIndex].inverseBindTransform.m[1], &skeleton.joints[currentJointIndex].inverseBindTransform.m[2], &skeleton.joints[currentJointIndex].inverseBindTransform.m[3])) { if (fscanf(fileHandle, "%f %f %f %f", &skeleton.joints[currentJointIndex].inverseBindTransform.m[4], &skeleton.joints[currentJointIndex].inverseBindTransform.m[5], &skeleton.joints[currentJointIndex].inverseBindTransform.m[6], &skeleton.joints[currentJointIndex].inverseBindTransform.m[7])) { if (fscanf(fileHandle, "%f %f %f %f", &skeleton.joints[currentJointIndex].inverseBindTransform.m[8], &skeleton.joints[currentJointIndex].inverseBindTransform.m[9], &skeleton.joints[currentJointIndex].inverseBindTransform.m[10], &skeleton.joints[currentJointIndex].inverseBindTransform.m[11])) { if (fscanf(fileHandle, "%f %f %f %f", &skeleton.joints[currentJointIndex].inverseBindTransform.m[12], &skeleton.joints[currentJointIndex].inverseBindTransform.m[13], &skeleton.joints[currentJointIndex].inverseBindTransform.m[14], &skeleton.joints[currentJointIndex].inverseBindTransform.m[15])) { I'm simplifying the code I show because otherwise it would make things unnecessarily harder (in the context of my question) to explain / follow. Please refrain from making remarks related to optimizations. This is not final code. Having said that, if I understand correctly, the basic idea of skinning/animation is: I have a a mesh made up of vertices I have the mesh model-world transform W I have my joints, which are really just transforms from each joint's space to its parent's space. I'll call these transforms Bj meaning matrix which takes from joint j's bind pose to joint j-1's bind pose. For each of these, I actually import their inverse to the engine, Bj^-1. I have keyframes each containing a set of current poses Cj for each joint J. These are initially imported to my engine in TQS format but after (S)LERPING them I compose them into Cj matrices which are equivalent to the Bjs (not the Bj^-1 ones) only that for the current spacial configurations of each joint at that frame. Given the above, the "skeletal animation algorithm is" On each frame: check how much time has elpased and compute the resulting current time in the animation, from 0 meaning frame 0 to 1, meaning the end of the animation. (Oh and I'm looping forever so the time is mod(total duration)) for each joint: 1 -calculate its world inverse bind pose, that is Bj_w^-1 = Bj^-1 Bj-1^-1 ... B0^-1 2 -use the current animation time to LERP the componets of the TQS and come up with an interpolated current pose matrix Cj which should transform from the joints current configuration space to world space. Similar to what I did to get the world version of the inverse bind poses, I come up with the joint's world current pose, Cj_w = C0 C1 ... Cj 3 -now that I have world versions of Bj and Cj, I store this joint's world- skinning matrix K_wj = Cj_w Bj_w^-1. The above is roughly implemented like so: - (void)update:(NSTimeInterval)elapsedTime { static double time = 0; time = fmod((time + elapsedTime),1.); uint16_t LERPKeyframeNumber = 60 * time; uint16_t lkeyframeNumber = 0; uint16_t lkeyframeIndex = 0; uint16_t rkeyframeNumber = 0; uint16_t rkeyframeIndex = 0; for (int i = 0; i < aClip.keyframesCount; i++) { uint16_t keyframeNumber = aClip.keyframes[i].number; if (keyframeNumber <= LERPKeyframeNumber) { lkeyframeIndex = i; lkeyframeNumber = keyframeNumber; } else { rkeyframeIndex = i; rkeyframeNumber = keyframeNumber; break; } } double lTime = lkeyframeNumber / 60.; double rTime = rkeyframeNumber / 60.; double blendFactor = (time - lTime) / (rTime - lTime); GLKMatrix4 bindPosePalette[aSkeleton.jointsCount]; GLKMatrix4 currentPosePalette[aSkeleton.jointsCount]; for (int i = 0; i < aSkeleton.jointsCount; i++) { F3DETQSType& lPose = aClip.keyframes[lkeyframeIndex].skeletonPose.jointPoses[i]; F3DETQSType& rPose = aClip.keyframes[rkeyframeIndex].skeletonPose.jointPoses[i]; GLKVector3 LERPTranslation = GLKVector3Lerp(lPose.t, rPose.t, blendFactor); GLKQuaternion SLERPRotation = GLKQuaternionSlerp(lPose.q, rPose.q, blendFactor); GLKVector3 LERPScaling = GLKVector3Lerp(lPose.s, rPose.s, blendFactor); GLKMatrix4 currentTransform = GLKMatrix4MakeWithQuaternion(SLERPRotation); currentTransform = GLKMatrix4Multiply(currentTransform, GLKMatrix4MakeTranslation(LERPTranslation.x, LERPTranslation.y, LERPTranslation.z)); currentTransform = GLKMatrix4Multiply(currentTransform, GLKMatrix4MakeScale(LERPScaling.x, LERPScaling.y, LERPScaling.z)); if (aSkeleton.joints[i].parentIndex == -1) { bindPosePalette[i] = aSkeleton.joints[i].inverseBindTransform; currentPosePalette[i] = currentTransform; } else { bindPosePalette[i] = GLKMatrix4Multiply(aSkeleton.joints[i].inverseBindTransform, bindPosePalette[aSkeleton.joints[i].parentIndex]); currentPosePalette[i] = GLKMatrix4Multiply(currentPosePalette[aSkeleton.joints[i].parentIndex], currentTransform); } aSkeleton.skinningPalette[i] = GLKMatrix4Multiply(currentPosePalette[i], bindPosePalette[i]); } } At this point, I should have my skinning palette. So on each frame in my vertex shader, I do: uniform mat4 modelMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix; uniform mat4 skinningPalette[6]; attribute vec4 position; attribute vec3 normal; attribute vec2 tCoordinates; attribute vec4 jointsWeights; attribute vec4 jointsIndices; varying highp vec2 tCoordinatesVarying; varying highp float lIntensity; void main() { vec3 eyeNormal = normalize(normalMatrix * normal); vec3 lightPosition = vec3(0., 0., 2.); lIntensity = max(0.0, dot(eyeNormal, normalize(lightPosition))); tCoordinatesVarying = tCoordinates; vec4 skinnedVertexPosition = vec4(0.); for (int i = 0; i < 4; i++) { skinnedVertexPosition += jointsWeights[i] * skinningPalette[int(jointsIndices[i])] * position; } gl_Position = projectionMatrix * modelMatrix * skinnedVertexPosition; } The result: The mesh parts that are supposed to animate do animate and follow the expected motion, however, the rotations are messed up in terms of orientations. That is, the mesh is not translated somewhere else or scaled in any way, but the orientations of rotations seem to be off. So a few observations: In the above shader notice I actually did not multiply the vertices by the mesh modelMatrix (the one which would take them to model or world or global space, whichever you prefer, since there is no parent to the mesh itself other than "the world") until after skinning. This is contrary to what I implied in the theory: if my skinning matrix takes vertices from model to joint and back to model space, I'd think the vertices should already be premultiplied by the mesh transform. But if I do so, I just get a black screen. As far as exporting the joints from Blender, my python script exports for each armature bone in bind pose, it's matrix in this way: def DFSJointTraversal(file, skeleton, jointList): for joint in jointList: poseJoint = skeleton.pose.bones[joint.name] jointTransform = poseJoint.matrix.inverted() file.write('Joint ' + joint.name + ' Transform {\n') for col in jointTransform.col: file.write('{:9f} {:9f} {:9f} {:9f}\n'.format(col[0], col[1], col[2], col[3])) DFSJointTraversal(file, skeleton, joint.children) file.write('}\n') And for current / keyframe poses (assuming I'm in the right keyframe): def exportAnimations(filepath): # Only one skeleton per scene objList = [object for object in bpy.context.scene.objects if object.type == 'ARMATURE'] if len(objList) == 0: return elif len(objList) > 1: return #raise exception? dialog box? skeleton = objList[0] jointNames = [bone.name for bone in skeleton.data.bones] for action in bpy.data.actions: # One animation clip per action in Blender, named as the action animationClipFilePath = filepath[0 : filepath.rindex('/') + 1] + action.name + ".aClip" file = open(animationClipFilePath, 'w') file.write('target skeleton: ' + skeleton.name + '\n') file.write('joints count: {:d}'.format(len(jointNames)) + '\n') skeleton.animation_data.action = action keyframeNum = max([len(fcurve.keyframe_points) for fcurve in action.fcurves]) keyframes = [] for fcurve in action.fcurves: for keyframe in fcurve.keyframe_points: keyframes.append(keyframe.co[0]) keyframes = set(keyframes) keyframes = [kf for kf in keyframes] keyframes.sort() file.write('keyframes count: {:d}'.format(len(keyframes)) + '\n') for kfIndex in keyframes: bpy.context.scene.frame_set(kfIndex) file.write('keyframe: {:d}\n'.format(int(kfIndex))) for i in range(0, len(skeleton.data.bones)): file.write('joint: {:d}\n'.format(i)) joint = skeleton.pose.bones[i] jointCurrentPoseTransform = joint.matrix translationV = jointCurrentPoseTransform.to_translation() rotationQ = jointCurrentPoseTransform.to_3x3().to_quaternion() scaleV = jointCurrentPoseTransform.to_scale() file.write('T {:9f} {:9f} {:9f}\n'.format(translationV[0], translationV[1], translationV[2])) file.write('Q {:9f} {:9f} {:9f} {:9f}\n'.format(rotationQ[1], rotationQ[2], rotationQ[3], rotationQ[0])) file.write('S {:9f} {:9f} {:9f}\n'.format(scaleV[0], scaleV[1], scaleV[2])) file.write('\n') file.close() Which I believe follow the theory explained at the beginning of my question. But then I checked out Blender's directX .x exporter for reference.. and what threw me off was that in the .x script they are exporting bind poses like so (transcribed using the same variable names I used so you can compare): if joint.parent: jointTransform = poseJoint.parent.matrix.inverted() else: jointTransform = Matrix() jointTransform *= poseJoint.matrix and exporting current keyframe poses like this: if joint.parent: jointCurrentPoseTransform = joint.parent.matrix.inverted() else: jointCurrentPoseTransform = Matrix() jointCurrentPoseTransform *= joint.matrix why are they using the parent's transform instead of the joint in question's? isn't the join transform assumed to exist in the context of a parent transform since after all it transforms from this joint's space to its parent's? Why are they concatenating in the same order for both bind poses and keyframe poses? If these two are then supposed to be concatenated with each other to cancel out the change of basis? Anyway, any ideas are appreciated.

    Read the article

  • Unity: how to apply programmatical changes to the Terrain SplatPrototype?

    - by Shivan Dragon
    I have a script to which I add a Terrain object (I drag and drop the terrain in the public Terrain field). The Terrain is already setup in Unity to have 2 PaintTextures: 1 is a Square (set up with a tile size so that it forms a checkered pattern) and the 2nd one is a grass image: Also the Target Strength of the first PaintTexture is lowered so that the checkered pattern also reveals some of the grass underneath. Now I want, at run time, to change the Tile Size of the first PaintTexture, i.e. have more or less checkers depending on various run time conditions. I've looked through Unity's documentation and I've seen you have the Terrain.terrainData.SplatPrototype array which allows you to change this. Also there's a RefreshPrototypes() method on the terrainData object and a Flush() method on the Terrain object. So I made a script like this: public class AStarTerrain : MonoBehaviour { public int aStarCellColumns, aStarCellRows; public GameObject aStarCellHighlightPrefab; public GameObject aStarPathMarkerPrefab; public GameObject utilityRobotPrefab; public Terrain aStarTerrain; void Start () { //I've also tried NOT drag and dropping the Terrain on the public field //and instead just using the commented line below, but I get the same results //aStarTerrain = this.GetComponents<Terrain>()[0]; Debug.Log ("Got terrain "+aStarTerrain.name); SplatPrototype[] splatPrototypes = aStarTerrain.terrainData.splatPrototypes; Debug.Log("Terrain has "+splatPrototypes.Length+" splat prototypes"); SplatPrototype aStarCellSplat = splatPrototypes[0]; Debug.Log("Re-tyling splat prototype "+aStarCellSplat.texture.name); aStarCellSplat.tileSize = new Vector2(2000,2000); Debug.Log("Tyling is now "+aStarCellSplat.tileSize.x+"/"+aStarCellSplat.tileSize.y); aStarTerrain.terrainData.RefreshPrototypes(); aStarTerrain.Flush(); } //... Problem is, nothing gets changed, the checker map is not re-tiled. The console outputs correctly tell me that I've got the Terrain object with the right name, that it has the right number of splat prototypes and that I'm modifying the tileSize on the SplatPrototype object corresponding to the right texture. It also tells me the value has changed. But nothing gets updated in the actual graphical view. So please, what am I missing?

    Read the article

  • How to raise an error, if the parsed number of a C++ stdlib stream is immediatly followed by a non whitespace character?

    - by Micha Wiedenmann
    In the following example, I didn't expect, that 1.2345foo would be parsed. Since I am reading data files, it is probably better to raise an error and notify the user. Is peek() the correct thing to do here? #include <iostream> #include <sstream> int main() { std::stringstream in("1.2345foo"); double x; in >> x; if (in) { std::cout << "good\n"; } else { std::cout << "bad\n"; } } Output good

    Read the article

  • is counter has certain value inside a class in python

    - by mazlor
    i am learning classes in python and when i was reading the documentation i found this example that i didn't understand : class MyClass: """A simple example class""" def __init__(self): self.data = [] i = 12345 def f(self): return 'hello world' then if we assign : x = MyClass() x.counter = 1 now if we implement while loop : while x.counter < 10: x.counter = x.counter * 2 so the value of x.counter will be : 16 while for example if we have a variable y : y = 1 while y < 1 : y = y *2 then if we look for the value of y we find it 1 so i don't know how is the value of counter became 16 . thanks

    Read the article

  • vsftpd status stop/waiting Ubuntu

    - by Majin Vegeta
    I'm trying to configure ftp over amazon EC2 instance, I've installed vsftpd and did the steps of adding user and modifying the vsftpd.conf file, but I'm getting my service status as ubuntu@ip-10-38-106-212:~$ sudo service vsftpd status vsftpd stop/waiting I've tried to reinstall vsftpd but still getting the same, I've also added the port 20 and 21 in my security group policy to skip the firewall. Can anyone tell me how to check whats wrong with this vsftpd, why its stopped and not coming into running state. Thank u

    Read the article

  • Why use an event cache with epoll_wait?

    - by user1827356
    Question: epoll man page has some pointers when using epoll with an 'event cache'. But, why would you need to maintain an event cahce at all - Isn't this the same as what epoll is supposed to be doing? Is it to avoid making multiple epoll_wait calls which might be slower than managing the events in user space? Is it to implement a custom 'priority' scheme over the cached events? Background: I'm trying to understand the strengths/shortcomings of epoll and its applicability to different situations

    Read the article

  • ANTRL: token to text in rewrite rule

    - by Antonio
    I'm building an AST using ANTLR. I want to write a production that match a this string: ${identifier} so, in my grammar file I have: reference : DOLLAR LBRACE IDENT RBRACE -> ^(NODE_VAR_REFERENCE IDENT) ; This works fine. I'm using my own adaptor to emit tree nodes. The rewrite rule used creates for me two nodes: one for NODE_VAR_REFERENCE and one for IDENT. What I want to do is create only one node (for NODE_VAR_REFERENCE token) and this node must have the IDENT token in his "token" field. Is this possible using a rewrite rule? Thanks.

    Read the article

  • Overriding fetch in multiple spine models

    - by Adam Charnock
    I need to override Spine's @fetch() method in all of my Spine models. Currently I have code duplication as follows: TastypieEndpointMixin = fromJSON: (data) -> return unless data return Spine.Model.fromJSON(data.objects) class App.models.Position extends Spine.Model @configure 'Position', 'code', 'name' @extend Spine.Model.Ajax @extend TastypieEndpointMixin @url: '/api/v1/position/?format=json' validate: -> 'code is required' unless @code @fetch: -> defer = $.Deferred() @one "refresh", -> defer.resolve() super return defer class App.models.Player extends Spine.Model @configure 'Player', 'first_name', 'last_name', ... @extend Spine.Model.Ajax @extend TastypieEndpointMixin @url: '/api/v1/player/?format=json' @fetch: -> defer = $.Deferred() @one "refresh", -> defer.resolve() super return defer My question is: How can I create some form of parent class which contains @fetch()? I know this should be a simple problem to solve. I have tried many options (including extending Spine.Model and Spine.Model.Ajax), but nothing works and I cannot seem to get my head around it.

    Read the article

  • TIdTCPClient to SSL

    - by waza123
    When I connect to 80 port, plain text web site using TIdTCPClient component, all works fine, data is received without a problem, but, when I connect to 443 port, SSL web site, data not always came. Maybe something with my receive data block ? Need advice. while not Terminated do begin SetLength(data, 0); ws.IOHandler.ReadBytes(data, -1); if Length(data) = 0 then break; // processing_my(data); end; Thanks

    Read the article

  • PHP loop through multidimensional array and change values

    - by stevenpepe
    I have a multidimensional array below and I want to loop through it and change the value of [menu_cats] from a number to a string, which is being pulled from a database selection. Is this possible? The name of the array is 'result'. Array ( [0] => Array ( [0] => Array ( [menu_cats] => 1 [item] => Introduction [link] => needs ) [1] => Array ( [menu_cats] => 1 [item] => Needs Assessment [link] => needs/needs.php ) ) [1] => Array ( [0] => Array ( [menu_cats] => 2 [item] => Introduction [link] => knowledge ) [1] => Array ( [menu_cats] => 2 [item] => Administer Knowledge Pre-Test [link] => knowledge/pre_test.php ) ) )

    Read the article

  • Google Play: how dev can give (already purchased) app to customer as a gift?

    - by Tertium
    Yes, SO, I know, it's not a "programmer's" question:) But customers sometimes help us (devs) with our code, so we (devs) shold be grateful. I think answer to my question will be useful for all fellow android devs. User has purchased my app. Refund period (15min) is over of course. Now I'd like to return money to him as a gift, because he helped me in testing a little. If I refund the entire order in Checkout-Orders will user keep my app 'purchased'? I mean will he be able to uninstall and install it again from GooglePlay-MyApps and will app be marked "purchased"? Will Google LVL accept him to run the app? I've done such refunds before, but then they called it "Android Market", and refund was 12h, and there were no LVL. Maybe somebody know another way to make a small gift using Google Play?

    Read the article

  • PHP Resize image down and crop using imagemagick

    - by mr12086
    I'm trying to downsize image uploaded by users at the time of upload. This is no problem but I want to get specific with sizes now. I'm looking for some advice on an algorithm im struggling to produce that will take any shape image - square or rectangle of any widths/heights and downsize it. This image needs to be downsized to a target box size (this changes but is stored in a variable).. So it needs to downsize the image so that both the width and height are larger than the width and height of the target maintaining aspect ratio. but only just.. The target size will be used to crop the image so there is no white space around the edges etc. I'm looking for just the algorithm behind creating the correct resize based on different dimension images - I can handle the cropping, even resizing in most cases but it fails in a few so i'm reaching out. I'm not really asking for PHP code more pseudo. Either is fine obviously. Thanks Kindly.

    Read the article

  • ArrayList<Int> Collections.Sort and LineNumberReader Help How to

    - by user1819551
    I have a issue i can't get it to work now let going to the point a explain in the code thanks. This is my class: what I want to do is insert the Integers sort the list and buffer writer in a column with out coma. Now I getting this: [1110018, 1110032, 1110056, 1110059, 1110063, 1110085, 1110096, 1110123, 1110125, 1110185, 1110456, 1110459] I want like this: 111xxxxx 111xxxx xxxx....... I can't do it in single array, have to be in ArrayList. This is my collecting: list.addNumbers(numbers); list.display(); This is my writer: Is buffered coma.write("\n"+list.display()); coma.flush();<br/> Here is my class: public class IdCount {<br/> private ArrayList<Integer> properNumber = new ArrayList<>(); public void addNumbers(Integer numbers) { properNumber.add(numbers); Collections.sort(properNumber); } public String display() { //(I try .toString() Not work) return properNumber.toString(); } My second issue is LineNumberReader: This is my collecting and my writing: try { Reader input = new BufferedReader( new FileReader(inputFile)); try (Scanner in = new Scanner(input)) { while (in.hasNext()) { //(More Code) asp = new LineNumberReader(input); int rom = 0; while (asp.readLine()!=null){ rom++; } System.out.println(rom); coma.write(rom); This one will not write anything an my System Print give me only 12 0 in column.

    Read the article

  • UITableView - iPad - Property '' Not Found on Object of type UITableViewCell

    - by user1797508
    I have added a UITableView prototype Cell into a UIView for an iPad application using StoryBoard in Xcode (targeting iOS6). The problem I'm having is that the labels are not being recognized in my viewController when I try to reference them. In my implementation, I have: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"dashboardMessage"; UITableViewCell *cell = [_tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } int row = [indexPath row]; cell.messageSender.text = [_matches valueForKey:@"from"]; } The last line is causing an error: Property 'messageSender' Not Found on Object of type UITableViewCell In the cell's header file I have: @interface DashboardMessageCell : UITableViewCell @property (strong, nonatomic) IBOutlet UILabel *messageSender; @property (strong, nonatomic) IBOutlet UILabel *messageDescr; and the header file is imported into the viewController. I'm lost as to what can be causing the issue, any help would be greatly appreciated. Thanks.

    Read the article

  • Pythonic / itertools way to go through a dict?

    - by dmd
    def reportCSV(t): ret = '' for ev in t: for p in t[ev]: for w in t[ev][p]: ret += ','.join((ev, p, w, t[ev][p][w])) + '\n' return ret What is a more pythonic way to do this, e.g. using itertools or the like? In this case I'm just writing it out to a CSV file. t is a dict t[ev] is a dict t[ev][p] is a dict t[ev][p][w] is a float I'm not sure how I'd use itertools.product in this case.

    Read the article

  • send data from one table to another page

    - by user91599
    I have this table I want when I click on a link in a table row that do a redirect to another page the data will be sent to the new page that can help me I have not found how to start I'm really stuck code table <table cellpadding="0" cellspacing="0" border="0" class="display" id="example"> <thead> <tr> <th>Date</th> <th>provider</th> <th>CI</th> <th>CELL</th> <th>BSC</th> <th>Commentaire</th> <th>nbr</th> <th>Type</th> <th><img src="{{ asset('image/Modify.png') }}" ALIGN="CENTER"/></th> <th><img src="{{ asset('image/Info.png') }}" ALIGN="CENTER"/></th> <th><img src="{{ asset('image/Male.png') }}" ALIGN="CENTER"/></th> <th>type_alertes</th> </tr> </thead> <tbody> <div class="textbox"> <h2> Information KPI dégradées</h2> <div class="textbox_content" id="kpi_dégrades"> {% for liste in listes %} <tr class="gradeU"> <td>{{ liste.DAT }} </td> <td>{{ liste.PROVIDER}} </td> <td>{{ liste.CI}} </td> <td>{{ liste.CELL}} </td> <td>{{ liste.BSC}}</td> <td>{{ liste.Cmts}}</td> <td >{{ liste.nbr}}</td> <td>{{ liste.TYPE}}</td> <td><a class="edit" href="">Edit</a></td> <td onclick="getInfo('{{ liste.CELL}}')">Information KPI dégradés</td> <td>{{ liste.user_name}}</td> <td>{{ liste.type_alertes}}</td> </tr> {% endfor %} </div> </div> </tbody>

    Read the article

  • Is scala's cake pattern possible with parametrized components?

    - by Nicolas
    Parametrized components work well with the cake pattern as long as you are only interested in a unique component for each typed component's, example: trait AComponent[T] { val a:A[T] class A[T](implicit mf:Manifest[T]) { println(mf) } } class App extends AComponent[Int] { val a = new A[Int]() } new App Now my application requires me to inject an A[Int] and an A[String], obviously scala's type system doesn't allow me to extends AComponent twice. What is the common practice in this situation ?

    Read the article

  • ARC and __unsafe_unretained

    - by J Shapiro
    I think I have a pretty good understanding of ARC and the proper use cases for selecting an appropriate lifetime qualifiers (__strong, __weak, __unsafe_unretained, and __autoreleasing). However, in my testing, I've found one example that doesn't make sense to me. As I understand it, both __weak and __unsafe_unretained do not add a retain count. Therefore, if there are no other __strong pointers to the object, it is instantly deallocated. The only difference in this process is that __weak pointers are set to nil, and __unsafe_unretained pointers are left alone. If I create a __weak pointer to a simple, custom object (composed of one NSString property), I see the expected (null) value when trying to access a property: Test * __weak myTest = [[Test alloc] init]; myTest.myVal = @"Hi!"; NSLog(@"Value: %@", myTest.myVal); // Prints Value: (null) Similarly, I would expect the __unsafe_unretained lifetime qualifier to cause a crash, due to the resulting dangling pointer. However, it doesn't. In this next test, I see the actual value: Test * __unsafe_unretained myTest = [[Test alloc] init]; myTest.myVal = @"Hi!"; NSLog(@"Value: %@", myTest.myVal); // Prints Value: Hi! Why doesn't the __unsafe_unretained object become deallocated?

    Read the article

  • any way to simplify this with a form of dynamic class instantiation?

    - by gnychis
    I have several child classes that extend a parent class, forced to have a uniform constructor. I have a queue which keeps a list of these classes, which must extend MergeHeuristic. The code that I currently have looks like the following: Class<? extends MergeHeuristic> heuristicRequest = _heuristicQueue.pop(); MergeHeuristic heuristic = null; if(heuristicRequest == AdjacentMACs.class) heuristic = new AdjacentMACs(_parent); if(heuristicRequest == SimilarInterfaceNames.class) heuristic = new SimilarInterfaceNames(_parent); if(heuristicRequest == SameMAC.class) heuristic = new SameMAC(_parent); Is there any way to simplify that to dynamically instantiate the class, something along the lines of: heuristic = new heuristicRequest.somethingSpecial(); That would flatten that block of if statements.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >