Daily Archives

Articles indexed Thursday June 5 2014

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

  • Should I add rel nofollow to internal links which already have meta noindex?

    - by CamSpy
    Let's say I have a products page with listing producsts and the page has pagination. I would like the 1st page to have all the SE ranking weight so I decided to put meta noindex on the rest of the paginated pages (from page 2 to N). My common sense says that if I don't want pages to not get indexed, I shouldn't also pass link/PR juice to these pages. (Is that smart?) What happens if I set rel="nofollow" for all pagination links from page 2 to page N?

    Read the article

  • Visual Studio 2012 C# web application to hostgator? [duplicate]

    - by Trevor
    This question already has an answer here: How to find web hosting that meets my requirements? 5 answers I have a web application I developed in visual studio and I am looking to get it hosted on a domain I registered. The server side of the application is in C#. Is there a way I can get this application hosted on hostgator? How would I go about doing that? If not, what are some options I have?

    Read the article

  • How to easily delete all email forwarders in cPanel?

    - by psoft
    I know that I can import a list of email forwarders using CPanel, but how can I delete a list? I want to manage 300+ addresses - as a membership list for my organization. I want to be able to delete that many without clicking 'Delete' and then 'Confirm' (or whatever it is) 300 times. Even if I am able to simply delete ALL forwarders, then upload a modified list - that's fine with me. Note: I'm using a shared hosting package through SiteGround. The tech service rep informed me that I can't use CPanel scripts in a shared environment. Any suggestions?

    Read the article

  • How to pause and unpause the animation of a sprite?

    - by user1609578
    My game has a sprite representing a character. When the character picks up an item, the sprite should stop moving for a period of time. I use CCbezier to make the sprite move, like this: sprite->runaction(x) Now I want the sprite to stop its current action (moving) and later resume it. I can make the sprite stop by using: sprite->stopaction(x) but if I do that, I can't resume the movement. How can I do that?

    Read the article

  • Is Unity's Random seeded automatically?

    - by Lohoris
    I seem to recall Unity's Random is automatically seeded; checking the documentation it doesn't say it outright, but a certain interpretation of their words might seem to imply it. The seed is normally set from some arbitrary value like the system clock before the random number functions are used. This prevents the same run of values from occurring each time a game is played and thus avoids predictable gameplay. However, it is sometimes useful to produce the same run of pseudo-random values on demand by setting the seed yourself. (emphasis added)

    Read the article

  • Cocos2d-x v3.1 for WinPhone 8 auto change texture after resumed from background

    - by Bình Nguyên
    I have some sprites in my game (for Windows Phone 8). These are my steps to reproduce the problem: Open game Play (this is an optional step) Press Windows button to send game to background Press Back button to resume game The problem is: After the game has resumed, some sprites exchange textures, some sprites go black (like there is no texture being bound). I'm using cocos2dx version 3.1.1. Can someone help me to solve this problem?

    Read the article

  • projection / view matrix: the object is bigger than it should and depth does not affect vertices

    - by Francesco Noferi
    I'm currently trying to write a C 3D software rendering engine from scratch just for fun and to have an insight on what OpenGL does behind the scene and what 90's programmers had to do on DOS. I have written my own matrix library and tested it without noticing any issues, but when I tried projecting the vertices of a simple 2x2 cube at 0,0 as seen by a basic camera at 0,0,10, the cube seems to appear way bigger than the application's window. If I scale the vertices' coordinates down by 8 times I can see a proper cube centered on the screen. This cube doesn't seem to be in perspective: wheen seen from the front, the back vertices pe rfectly overlap with the front ones, so I'm quite sure it's not correct. this is how I create the view and projection matrices (vec4_initd initializes the vectors with w=0, vec4_initw initializes the vectors with w=1): void mat4_lookatlh(mat4 *m, const vec4 *pos, const vec4 *target, const vec4 *updirection) { vec4 fwd, right, up; // fwd = norm(pos - target) fwd = *target; vec4_sub(&fwd, pos); vec4_norm(&fwd); // right = norm(cross(updirection, fwd)) vec4_cross(updirection, &fwd, &right); vec4_norm(&right); // up = cross(right, forward) vec4_cross(&fwd, &right, &up); // orientation and translation matrices combined vec4_initd(&m->a, right.x, up.x, fwd.x); vec4_initd(&m->b, right.y, up.y, fwd.y); vec4_initd(&m->c, right.z, up.z, fwd.z); vec4_initw(&m->d, -vec4_dot(&right, pos), -vec4_dot(&up, pos), -vec4_dot(&fwd, pos)); } void mat4_perspectivefovrh(mat4 *m, float fovdegrees, float aspectratio, float near, float far) { float h = 1.f / tanf(ftoradians(fovdegrees / 2.f)); float w = h / aspectratio; vec4_initd(&m->a, w, 0.f, 0.f); vec4_initd(&m->b, 0.f, h, 0.f); vec4_initw(&m->c, 0.f, 0.f, -far / (near - far)); vec4_initd(&m->d, 0.f, 0.f, (near * far) / (near - far)); } this is how I project my vertices: void device_project(device *d, const vec4 *coord, const mat4 *transform, int *projx, int *projy) { vec4 result; mat4_mul(transform, coord, &result); *projx = result.x * d->w + d->w / 2; *projy = result.y * d->h + d->h / 2; } void device_rendervertices(device *d, const camera *camera, const mesh meshes[], int nmeshes, const rgba *color) { int i, j; mat4 view, projection, world, transform, projview; mat4 translation, rotx, roty, rotz, transrotz, transrotzy; int projx, projy; // vec4_unity = (0.f, 1.f, 0.f, 0.f) mat4_lookatlh(&view, &camera->pos, &camera->target, &vec4_unity); mat4_perspectivefovrh(&projection, 45.f, (float)d->w / (float)d->h, 0.1f, 1.f); for (i = 0; i < nmeshes; i++) { // world matrix = translation * rotz * roty * rotx mat4_translatev(&translation, meshes[i].pos); mat4_rotatex(&rotx, ftoradians(meshes[i].rotx)); mat4_rotatey(&roty, ftoradians(meshes[i].roty)); mat4_rotatez(&rotz, ftoradians(meshes[i].rotz)); mat4_mulm(&translation, &rotz, &transrotz); // transrotz = translation * rotz mat4_mulm(&transrotz, &roty, &transrotzy); // transrotzy = transrotz * roty = translation * rotz * roty mat4_mulm(&transrotzy, &rotx, &world); // world = transrotzy * rotx = translation * rotz * roty * rotx // transform matrix mat4_mulm(&projection, &view, &projview); // projview = projection * view mat4_mulm(&projview, &world, &transform); // transform = projview * world = projection * view * world for (j = 0; j < meshes[i].nvertices; j++) { device_project(d, &meshes[i].vertices[j], &transform, &projx, &projy); device_putpixel(d, projx, projy, color); } } } this is how the cube and camera are initialized: // test mesh cube = &meshlist[0]; mesh_init(cube, "Cube", 8); cube->rotx = 0.f; cube->roty = 0.f; cube->rotz = 0.f; vec4_initw(&cube->pos, 0.f, 0.f, 0.f); vec4_initw(&cube->vertices[0], -1.f, 1.f, 1.f); vec4_initw(&cube->vertices[1], 1.f, 1.f, 1.f); vec4_initw(&cube->vertices[2], -1.f, -1.f, 1.f); vec4_initw(&cube->vertices[3], -1.f, -1.f, -1.f); vec4_initw(&cube->vertices[4], -1.f, 1.f, -1.f); vec4_initw(&cube->vertices[5], 1.f, 1.f, -1.f); vec4_initw(&cube->vertices[6], 1.f, -1.f, 1.f); vec4_initw(&cube->vertices[7], 1.f, -1.f, -1.f); // main camera vec4_initw(&maincamera.pos, 0.f, 0.f, 10.f); maincamera.target = vec4_zerow; and, just to be sure, this is how I compute matrix multiplications: void mat4_mul(const mat4 *m, const vec4 *va, vec4 *vb) { vb->x = m->a.x * va->x + m->b.x * va->y + m->c.x * va->z + m->d.x * va->w; vb->y = m->a.y * va->x + m->b.y * va->y + m->c.y * va->z + m->d.y * va->w; vb->z = m->a.z * va->x + m->b.z * va->y + m->c.z * va->z + m->d.z * va->w; vb->w = m->a.w * va->x + m->b.w * va->y + m->c.w * va->z + m->d.w * va->w; } void mat4_mulm(const mat4 *ma, const mat4 *mb, mat4 *mc) { mat4_mul(ma, &mb->a, &mc->a); mat4_mul(ma, &mb->b, &mc->b); mat4_mul(ma, &mb->c, &mc->c); mat4_mul(ma, &mb->d, &mc->d); }

    Read the article

  • Are there any reasons to use Legacy (2.X) OpenGL?

    - by user27886
    The benefits are well documented of the Modern OpenGL 3.X & 4.X API's, but I'm wondering if there are ANY benefits to keeping with the old OpenGL, Or if learning OpenGL 2.X is a complete waste of time now no matter what? Particularly I've wondered if using the OpenGL 2.X API is appropriate if the target platform had graphics hardware capable of only up to OpenGL 2.X. Would a driver update on said target platform allow programs compiled using the Modern OpenGL API's to be released on this old platform? If they both work, which would be faster? Thanks

    Read the article

  • Best database setup for one click games

    - by ewizard
    I am building a one click game website/mobile app, and I am debating between using MySQL and MongoDB for the backend. The way I have been exploring it is with a NodeJS/Express/Angular/Passport/MongoDB stack - I have also implemented Socket.io. I have gotten to the point where I am sending data from the flash game to the server (NodeJS). The only data that needs to be sent is basic user information, the players score at the end of each game, and some x,y positions for each players game (for anti-cheating). It seems like MySQL would work fine, but as I am already using MongoDB - are there any major drawbacks to continuing to work with MongoDB on this project?

    Read the article

  • Reflection velocity

    - by MindSeeker
    I'm trying to get a moving circular object to bounce (elastically) off of an immovable circular object. Am I doing this right? (The results look right, but I hate to trust that alone, and I can't find a tutorial that tackles this problem and includes the nitty gritty math/code to verify what I'm doing). If it is right, is there a better/faster/more elegant way to do this? Note that the object (this) is the moving circle, and the EntPointer object is the immovable circle. //take vector separating the two centers <x, y>, and then get unit vector of the result: MathVector2d unitnormal = MathVector2d(this -> Retxpos() - EntPointer -> Retxpos(), this -> Retypos() - EntPointer -> Retypos()).UnitVector(); //take tangent <-y, x> of the unitnormal: MathVector2d unittangent = MathVector2d(-unitnormal.ycomp, unitnormal.xcomp); MathVector2d V1 = MathVector2d(this -> Retxvel(), this -> Retyvel()); //Calculate the normal and tangent vector lengths of the velocity: (the normal changes, the tangent stays the same) double LengthNormal = DotProduct(unitnormal, V1); double LengthTangent = DotProduct(unittangent, V1); MathVector2d VelVecNewNormal = unitnormal.ScalarMultiplication(-LengthNormal); //the negative of what it was before MathVector2d VelVecNewTangent = unittangent.ScalarMultiplication(LengthTangent); //this stays the same MathVector2d NewVel = VectorAddition(VelVecNewNormal, VelVecNewTangent); //combine them xvel = NewVel.xcomp; //and then apply them yvel = NewVel.ycomp; Note also that this question is just about velocity, the position code is handled elsewhere (in other words, assume that this code is implemented at the exact moment that the circles begin to overlap). Thanks in advance for your help and time!

    Read the article

  • How can I generate Sudoku puzzles?

    - by user223150
    I'm trying to make a Sudoku puzzle generator. It's a lot harder than I expected and the more I get into it, the harder it gets! My current approach is to split the problem into 2 steps: Generate a complete (solved) Sudoku puzzle. Remove numbers until it's solveable and has only 1 solution. In step 1, since I'm using a brute force methods, I'm facing some run time issues. Is there an optimal way of filling in a complete Sudoku puzzle? In step 2, what kind of algorithm should I use to "puzzlize" a solved sudoku?

    Read the article

  • LibGDX: transform Texture to TextureRegion

    - by FeRo2991
    I am creating a TowerDefence Game in LibGDX and am now trying to replace the old Tile with a new StaticTiledMapTile. But to create a StaticTiledMapTile I need a TextureRegion, not a Texture. Now I'm trying to create a TextureRegion, which contains the whole Texture, but it doesn't seem to work. It always appears distorted. I have tried the following: TextureRegion region = new TextureRegion(new Texture("someImg.png"), 0, 0, 32, 32); StaticTileMapTile tile = new StaticTiledMapTile(region); getLayer().getCell(x,y).setTile(tile); //setting the new tile In my opinion this should work (if the image, as it is, is 32px wide and 32px high).

    Read the article

  • PHP Variable Encryption

    - by NCoder
    I have the following code that creates an encryption in PHP: $password = "helloworld"; $passwordupper = strtoupper($password); $passwordencode = mb_convert_encoding($passwordupper, 'UTF-16LE'); $passwordsha1 = hash("SHA1", $passwordencode); $passwordbase64 = base64_encode($passwordsha1); The instructions I have from the system I'm trying to connect to states: The encoding process for passwords is: first convert to uppercase, then Unicode it in little-endian UTF 16, then SHA1 it then base64 encode it. I think I'm doing something wrong in my code. Any ideas?! Thanks! NCoder

    Read the article

  • Integrating PayMill: The token filled input field is not created, error "field_invalid_amount"

    - by automatix
    I'm implementing the Credit Card Payment form of PayMill according to the Payment Form docu. So I copied the JS from the Bridge docu page and the form from the Payment Form docu page. But no token is created. When I try to debug the JS and add console.info(error.apierror); into the paymillResponseHandler(...) function, I get the error code: field_invalid_amount. According to the support page There are three possible reasons for this error message: no amount value was provided numbers were rounded wrong delimiter symbol But the amuont is provided and I've already tried different delimiter symbols. What "numbers were rounded" means, is not clear. What can be the problem and how to fix this issue? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content="PSPad editor, www.pspad.com"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <title> </title> </head> <body> <!-- PayMill HEAD start --> <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.no-responsive.no-icons.min.css" /> <script type="text/javascript"> var PAYMILL_PUBLIC_KEY = '51668632777bf03b57f861c5a7278a38'; </script> <script type="text/javascript" src="https://bridge.paymill.com/"></script> <!-- PayMill HEAD stop --> <!-- PayMill FORM start --> <form id="payment-form" class="span4" action="payment.php" method="POST"> <p class="payment-errors alert-error span3" style="display:none;"> </p> <div id="payment-form-cc"> <div class="controls controls-row"> <div class="span2"> <label class="card-number-label">Kreditkarte </label> <input class="card-number span2" type="text" size="20" value="4111111111111111"/> </div> <div class="span1"> <label class="card-cvc-label">CVC </label> <input class="card-cvc span1" type="text" size="4" value="111"/> </div> </div> <div class="controls controls-row"> <div class="span3 card-icon"> </div> </div> <div class="controls controls-row"> <div class="span3"> <label class="card-holdername-label">Karteninhaber </label> <input class="card-holdername span3" type="text" size="20" value="lala"/> </div> </div> <div class="controls controls-row"> <div class="span3"> <label class="card-expiry-label">Gültigkeitsdatum (MM/YYYY) </label> <input class="card-expiry-month span1" type="text" size="2" value="12"/> <span style="float:left;"> / </span> <input class="card-expiry-year span1" type="text" size="4" value="2015"/> </div> </div> </div> <div class="controls controls-row"> <div class="span2"> <label class="amount-label">Betrag </label> <input class="amount span2" type="text" size="5" value="9,99" name="amount"/> </div> <div class="span1"> <label class="currency-label">Währung </label> <input class="currency span1" type="text" size="3" value="EUR" name="currency"/> </div> </div> <div class="controls controls-row"> <div class="span4"> <button class="submit-button btn btn-primary" type="submit" >Pay!</button> </div> </div> </form> <!-- PayMill FORM stop --> <!-- PayMill FOOT start --> <script type="text/javascript"> function paymillResponseHandler(error, result) { if (error) { console.info(error.apierror); // Displays the error above the form $(".payment-errors").text(error.apierror); } else { console.info('OK'); var form = $("#payment-form"); // Output token var token = result.token; // Insert token into form in order to submit to server form.append( "<input type='hidden' name='paymillToken' value='"+token+"'/>" ); // Submit form form.get(0).submit(); } } </script> <script type="text/javascript"> paymill.createToken({ number: $('.card-number').val(), // required exp_month: $('.card-expiry-month').val(), // required exp_year: $('.card-expiry-year').val(), // required cvc: $('.card-cvc').val(), // required amount_int: $('.card-amount-int').val(), // required, e.g. "4900" for 49.00 EUR currency: $('.currency').val(), // required cardholder: $('.card-holdername').val() // optional }, paymillResponseHandler); </script> <!-- PayMill FOOT stop --> </body> </html>

    Read the article

  • Display radio buttons in prolog xpce

    - by Ben03
    I created a menu with Radio Buttons in XPCE prolog, but my radio buttons are showing on the same line, and I want to have each one on a separate line. My code is the following: new(D, dialog('title')), send(D, size, size(500,500)), send(D, append, new(Op, menu(options, marked))), send(Op, append, option1), send(Op, append, option2), send(Op, append, option3), send(Op, size, size(300,300)), send(D, display, Op, point(100, 40)), send(D, append(new(B1,button(ok, message(D, return, Op?selection))))), send(D, display, B1, point(100, 100)), send(D, append(button(cancel, message(D, return, @nil)))), send(D, default_button(ok)), get(D, confirm, Rval), free(D). Thanks in advance

    Read the article

  • How can I access the row index numbers on a data frame in R?

    - by user123276
    I have a data frame that was sampled from another data frame. As a result, when I print the output of the data frame, I get a jumble of numbers on the left hand side of the data frame. The original data frame was nicely numbered from 1,2,3,4,5, and so on. But my new data frame is numbered 5,15,3,65, etc on the left hand side. Is there a way I can access the row index information for a data frame in R? thank you!

    Read the article

  • ExtJS Grid slow with 3000+ records

    - by Oliver Watkins
    I am using ExtJS Grid and its getting pretty slow with 3000+ records. Sorting takes about 4 seconds. Compared to other more Javascript tables, this is pretty slow. I am thinking maybe to use pagination in my table. However after reading the documentation, I am still a bit unsure about how pagination works in extjs. Does this pull data from the server each time u turn a page? I would prefer that wasn't the case. I would prefer the 3000 records are saved in the browser and then what is rendered is just a portion of those rows. Also I am using Extjs version 4.2.1. If I upgrade to version 5. will I get some performance improvements?

    Read the article

  • java util iterator but cannot import java.util.iterator

    - by qwertzuiop13
    Given this Code import java.util.Iterator; private static List<String> someList = new ArrayList<String>(); public static void main(String[] args) { someList.add("monkey"); someList.add("donkey"); //Code works when I change Iterator to java.util.Iterator, but import //is not possible? for(Iterator<String> i = someList.iterator(); i.hasNext(); ) { String item = i.next(); System.out.println(item); } } I receive the error: The type Iterator is not generic; it cannot be parameterized with arguments Eclipse tells me that the import java.util.iterator conflicts with a type defined in the same file. lol... ?

    Read the article

  • Error showing is NullPointerException [duplicate]

    - by user3659612
    This question already has an answer here: How to check a string against null in java? 11 answers I was trying to code a wifi scanner which does 20 scans but it shows NullPointerException at if(bssid[j].equals(null)){ My code is slightly huge package com.example.scanner; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import android.annotation.SuppressLint; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.wifi.ScanResult; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; import android.os.Bundle; import android.os.Environment; import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; public class MainActivity extends ActionBarActivity { WifiManager wifi; WifiScanReceiver wifireciever; WifiInfo info; Button scan, save; List<ScanResult> wifilist; ListView list; String wifis[]; String name; String[] ssid = new String[100]; String[] bssid = new String[100]; int[] lvl = new int[100]; int[] count = new int[100]; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment_main); list=(ListView)findViewById(R.id.listView1); scan=(Button)findViewById(R.id.button1); save=(Button)findViewById(R.id.button2); scan.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub wifi=(WifiManager)getSystemService(Context.WIFI_SERVICE); if (wifi.isWifiEnabled()==false){ wifi.setWifiEnabled(true); } wifireciever = new WifiScanReceiver(); for (int i=0;i<20;i++){ registerReceiver(wifireciever, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); wifi.startScan(); if (i==19){ Toast.makeText(getBaseContext(), "Scan Finish", Toast.LENGTH_LONG).show(); } } } }); save.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub savedata(); } }); } protected void savedata() { // TODO Auto-generated method stub try { File sdcard = Environment.getExternalStorageDirectory(); File directory = new File(sdcard.getAbsolutePath() + "/WIFI_RESULT"); directory.mkdirs(); name = new SimpleDateFormat("yyyy-MM-dd HH mm ss").format(new Date()); File file = new File(directory,name + "wifi_data.txt"); FileOutputStream fou = new FileOutputStream(file); OutputStreamWriter osw = new OutputStreamWriter(fou); try { for (int i =0; i < list.getCount(); i++){ osw.append(list.getItemAtPosition(i).toString()); } osw.flush(); osw.close(); Toast.makeText(getBaseContext(), "Saved", Toast.LENGTH_LONG).show(); } catch (IOException e){ e.printStackTrace(); } } catch (FileNotFoundException e){ e.printStackTrace(); } } class WifiScanReceiver extends BroadcastReceiver { @SuppressLint("UseValueOf") public void onReceive(Context c, Intent intent) { int a =0; wifi.startScan(); List<ScanResult> wifilist = wifi.getScanResults(); if (a<wifilist.size()){ a=wifilist.size(); } for(int j=0;j<wifilist.size();j++){ if(bssid[j].equals(null)){ ssid[j] = wifilist.get(j).SSID.toString(); bssid[j] = wifilist.get(j).BSSID.toString(); lvl[j] = wifilist.get(j).level; count[j]++; } else if (bssid[j].equals(wifilist.get(j).BSSID.toString())){ lvl[j] = lvl[j] + wifilist.get(j).level; count[j]++; } } wifis = new String[a]; for (int i =0; i<a; i++){ wifis[i] = ("\n" + ssid[i] + "\n AP Address" + bssid[i] + "\n Signal Strength:" + lvl[i]/count[i]).toString(); } list.setAdapter(new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1,wifis)); } } protected void onDestroy() { unregisterReceiver(wifireciever); super.onPause(); } protected void onResume() { registerReceiver(wifireciever, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); super.onResume(); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } NullPointerException at that point mean my array bssid isn't initialize. So I just want to know how to initialize it in main activity so that I can use that string bssid anywhere.

    Read the article

  • How do machine code instructions get transferred to the CPU?

    - by user3711789
    I'm currently investigating what the runtime of different programming languages looks like behind the scenes. For a compiled language like C, people usually give the explanation of "Code is compiled to assembly which is assembled and linked into a binary executable. The executable is then loaded into memory and the CPU interprets it." My question is how does the CPU know where to look for the next instruction to execute? Is it a memory address stored in one of the registers?

    Read the article

  • What algorithm should i follow to retrieve data in the prescribed format?

    - by Prateek
    I have to retrieve data from a database in which tables are consisting of fields like "ttc, rm, atc and lta" namely. Actually these values are stored on daily basis with a 15 min interval like From_time to_time ttc rm atc lta 00:00 00:15 45 10 35 25, 00:15 00:30 35 10 25 25 and so on .. These values are stored for every day of every month and i want it to be previewed in the prescribed format then what algorithm should i follow. I am confused about how to do comparisons for a format like below mentioned. The format is at this link https://drive.google.com/a/itbhu.ac.in/file/d/0B_J0Ljq64i4Za2J1V0lvbDZ4eGc/edit?usp=sharing To be specific once again, my question is, I have to prepare a report from the retrieved data which is being stored in the databases as explained above. But the report which is going to be prepared will be of entire month. So, to say the least, there may be cases that for two particular days the value of "ttc" would be same for some time so i want it to be listed together (as shown in format). And the confusing part is any of the values "ttc", "rm", "atc", "lta" can be same for any particular interval. So what algorithm should i follow for such comparisons. And if still any query with question, u can ask your doubt. Thanks

    Read the article

  • In Perl, how to match several prefixes

    - by xorsyst
    I have 2 input files. One is a list of prefix and lengths, like this: 101xxx 102xxx 30xx 31xx (where x is any number) And another is a list of numbers. I want to iterate through the second file, matching each number against any of the prefix/lengths. This is fairly easy. I build a list of regexps: my @regexps = ('101...', '102...', '30..', '31..'); Then: foreach my $regexp (@regexps) { if (/$regexp/) { # do something But, as you can guess, this is slow for a long list. I could convert this to a single regexp: my $super_regexp = '101...|102...|30..|31..'; ...but, what I need is to know which regexp matched the item, and what the ..s matched. I tried this: my $catching_regexp = '(101)(...)|(102)(...)|(30)(..)|(31)(..)'; but then I don't know whether to look in $1, $3, %5 or $7. Any ideas? How can I match against any of these prefix/lengths and know which prefix, and what the remaining digits where?

    Read the article

  • CSS Z-Index with Gradient Background

    - by Jona
    I'm making a small webpage where the I would like the top banner with some text to remain on top, as such: HTML: <div id = "topBanner"> <h1>Some Text</h1> </div> CSS: #topBanner{ position:fixed; background-color: #CCCCCC; width: 100%; height:200px; top:0; left:0; z-index:900; background: -moz-linear-gradient(top, rgba(204,204,204,0.65) 0%, rgba(204,204,204,0.44) 32%, rgba(204,204,204,0.12) 82%, rgba(204,204,204,0) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(204,204,204,0.65)), color-stop(32%,rgba(204,204,204,0.44)), color-stop(82%,rgba(204,204,204,0.12)), color-stop(100%,rgba(204,204,204,0))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(204,204,204,0.65) 0%,rgba(204,204,204,0.44) 32%,rgba(204,204,204,0.12) 82%,rgba(204,204,204,0) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(204,204,204,0.65) 0%,rgba(204,204,204,0.44) 32%,rgba(204,204,204,0.12) 82%,rgba(204,204,204,0) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(204,204,204,0.65) 0%,rgba(204,204,204,0.44) 32%,rgba(204,204,204,0.12) 82%,rgba(204,204,204,0) 100%); /* IE10+ */ background: linear-gradient(to bottom, rgba(204,204,204,0.65) 0%,rgba(204,204,204,0.44) 32%,rgba(204,204,204,0.12) 82%,rgba(204,204,204,0) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a6cccccc', endColorstr='#00cccccc',GradientType=0 ); /* IE6-9 */ } /*WebPage Header*/ h1{ font-size:3em; color:blue; text-shadow:#CCCCCC 2px 2px 2px, #000 0 -1px 2px; position: absolute; width: 570px; left:50%; right:50%; line-height:20px; margin-left: -285px; z-index:999; } The z-index works fine, except that because I'm using a gradient any time I scroll down the elements behind the banner are still visible, albeit somewhat transparent. Is there any way to make them total invisible? i.e., what I'm trying to do is make it as though the banner is a solid color, even though it's a gradient. Thanks in advance for any help!

    Read the article

  • singledispatch in class, how to dispatch self type

    - by yanxinyou
    Using python3.4. Here I want use singledispatch to dispatch different type in __mul__ method . The code like this : class Vector(object): ## some code not paste @functools.singledispatch def __mul__(self, other): raise NotImplementedError("can't mul these type") @__mul__.register(int) @__mul__.register(object) # Becasue can't use Vector , I have to use object def _(self, other): result = Vector(len(self)) # start with vector of zeros for j in range(len(self)): result[j] = self[j]*other return result @__mul__.register(Vector) # how can I use the self't type @__mul__.register(object) # def _(self, other): pass # need impl As you can see the code , I want support Vector*Vertor , This has Name error Traceback (most recent call last): File "p_algorithms\vector.py", line 6, in <module> class Vector(object): File "p_algorithms\vector.py", line 84, in Vector @__mul__.register(Vector) # how can I use the self't type NameError: name 'Vector' is not defined The question may be How Can I use class Name a Type in the class's method ? I know c++ have font class statement . How python solve my problem ? And it is strange to see result = Vector(len(self)) where the Vector can be used in method body .

    Read the article

  • C#: Using regular expression (Regex) to duplicate a specific character in a string

    - by user3703944
    Anyone know how to use regex to duplicate a specific character in a string? I have a path that is entered like this: C:/Example/example I would like to use regex (or any other method) to display it like this: C://Example//example Is it possible? This is where I'm getting the file path private void btnSearchImage_Click_1(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string filenName = ofd.FileName; pictureBox1.Image = new Bitmap(filenName); string path = filenName; txtimgPath.Text = path; } } Thanks

    Read the article

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