Search Results

Search found 56 results on 3 pages for 'sour lemon'.

Page 1/3 | 1 2 3  | Next Page >

  • Sweet and Sour Source Control

    - by Tony Davis
    Most database developers don't use Source Control. A recent anonymous poll on SQL Server Central asked its readers "Which Version Control system do you currently use to store you database scripts?" The winner, with almost 30% of the vote was...none: "We don't use source control for database scripts". In second place with almost 28% of the vote was Microsoft's VSS. VSS? Given its reputation for being buggy, unstable and lacking most of the basic features required of a proper source control system, answering VSS is really just another way of saying "I don't use Source Control". At first glance, it's a surprising thought. You wonder how database developers can work in a team and find out what changed, when the system worked before but is now broken; to work out what happened to their changes that now seem to have vanished; to roll-back a mistake quickly so that the rest of the team have a functioning build; to find instantly whether a suspect change has been deployed to production. Unfortunately, the survey didn't ask about the scale of the database development, and correlate the two questions. If there is only one database developer within a schema, who has an automated approach to regular generation of build scripts, then the need for a formal source control system is questionable. After all, a database stores far more about its metadata than a traditional compiled application. However, what is meat for a small development is poison for a team-based development. Here, we need a form of Source Control that can reconcile simultaneous changes, store the history of changes, derive versions and builds and that can cope with forks and merges. The problem comes when one borrows a solution that was designed for conventional programming. A database is not thought of as a "file", but a vast, interdependent and intricate matrix of tables, indexes, constraints, triggers, enumerations, static data and so on, all subtly interconnected. It is an awkward fit. Subversion with its support for merges and forks, and the tolerance of different work practices, can be made to work well, if used carefully. It has a standards-based architecture that allows it to be used on all platforms such as Windows Mac, and Linux. In the words of Erland Sommerskog, developers should "just do it". What's in a database is akin to a "binary file", and the developer must work only from the file. You check out the file, edit it, and save it to disk to compile it. Dependencies are validated at this point and if you've broken anything (e.g. you renamed a column and broke all the objects that reference the column), you'll find out about it right away, and you'll be forced to fix it. Nevertheless, for many this is an alien way of working with SQL Server. Subversion is the powerhouse, not the GUI. It doesn't work seamlessly with your existing IDE, and that usually means SSMS. So the question then becomes more subtle. Would developers be less reluctant to use a fully-featured source (revision) control system for a team database development if they had a turn-key, reliable system that fitted in with their existing work-practices? I'd love to hear what you think. Cheers, Tony.

    Read the article

  • Sweet and Sour Source Control

    A recent survey on SQL Server Central showed that most database developers don't use Source Control. At first glance, it's a surprising thought. Unfortunately, the survey didn't ask about the scale of the database development. If there is only one database developer within a schema, who has an automated approach to regular generation of build scripts, then the need for a formal source control system is questionable....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Open Source Utilization Questions: How do you lone wold programmers best take advantage of open sour

    - by Funkyeah
    For Clarity: So you come up with an idea for a new program and want to start hacking, but you also happen to be a one-man army. How do you programming dynamos best find and utilize existing open-source software to give you the highest jumping off point possible when diving into your new project? When you do jump in where the shit do you start from? Any imaginary scenarios would be welcome, e.g. a shitty example might be utilizing a open-source database with an open-source IM client as a starting off point to a make a new client where you could tag and store conversations and query those tags at a later time.

    Read the article

  • Convert Ruby array of tuples into a hash given an array of keys?

    - by Kit Ho
    I have an simple array array = ["apple", "orange", "lemon"] array2 = [["apple", "good taste", "red"], ["orange", "bad taste", "orange"], ["lemon" , "no taste", "yellow"]] how can i convert in to this hash whenever element in array match the first element of each element in array2? hash = {"apple" => ["apple" ,"good taste", "red"], "orange" => ["orange", "bad taste", "orange"], "lemon" => ["lemon" , "no taste", "yellow"] } I am quite new to ruby, and spend a lot to do this manipulation, but no luck, any help ?

    Read the article

  • is there a such thing as a randomly accessible pseudo-random number generator? (preferably open-sour

    - by lucid
    first off, is there a such thing as a random access random number generator, where you could not only sequentially generate random numbers as we're all used to, assuming rand100() always generates a value from 0-100: for (int i=0;i<5;i++) print rand100() output: 14 75 36 22 67 but also randomly access any random value like: rand100(0) would output 14 as long as you didn't change the seed rand100(3) would always output 22 rand100(4) would always output 67 and so on... I've actually found an open-source generator algorithm that does this, but you cannot change the seed. I know that pseudorandomness is a complex field; I wouldn't know how to alter it to add that functionality. Is there a seedable random access random number generator, preferably open source? or is there a better term for this I can google for more information? if not, part 2 of my question would be, is there any reliably random open source conventional seedable pseudorandom number generator so I could port it to multiple platforms/languages while retaining a consistent sequence of values for each platform for any given seed?

    Read the article

  • Ingredient Substitutes while Baking

    - by Rekha
    In our normal cooking, we substitute the vegetables for the gravies we prepare. When we start baking, we look for a good recipe. At least one or two ingredient will be missing. We do not know where to substitute what to bring same output. So we finally drop the plan of baking. Again after a month, we get the interest in baking. Again one or two lack of ingredient and that’s it. We keep on doing this for months. When I was going through the cooking blogs, I came across a site with the Ingredient Substitutes for Baking: (*) is to indicate that this substitution is ideal from personal experience. Flour Substitutes ( For 1 cup of Flour) All Purpose Flour 1/2 cup white cake flour plus 1/2 cup whole wheat flour 1 cup self-rising flour (omit using salt and baking powder if the recipe calls for it since self raising flour has it already) 1 cup plus 2 tablespoons cake flour 1/2 cup (75 grams) whole wheat flour 7/8 cup (130 grams) rice flour (starch) (do not replace all of the flour with the rice flour) 7/8 cup whole wheat Bread Flour 1 cup all purpose flour 1 cup all purpose flour plus 1 teaspoon wheat gluten (*) Cake Flour Place 2 tbsp cornstarch in 1 cup and fill the rest up with All Purpose flour (*) 1 cup all purpose flour minus 2 tablespoons Pastry flour Place 2 tbsp cornstarch in 1 cup and fill the rest up with All Purpose flour Equal parts of All purpose flour plus cake flour (*) Self-rising Flour 1½ teaspoons of baking powder plus ½ teaspoon of salt plus 1 cup of all-purpose flour. Cornstarch (1 tbsp) 2 tablespoons all-purpose flour 1 tablespoon arrowroot 4 teaspoons quick-cooking tapioca 1 tablespoon potato starch or rice starch or flour Tapioca (1 tbsp) 1 – 1/2 tablespoons all-purpose flour Cornmeal (stone ground) polenta OR corn flour (gives baked goods a lighter texture) if using cornmeal for breading,crush corn chips in a blender until they have the consistency of cornmeal. maize meal Corn grits Sweeteners ( for Every 1 cup ) * * (HV) denotes Healthy Version for low fat or fat free substitution in Baking Light Brown Sugar 2 tablespoons molasses plus 1 cup of white sugar Dark Brown Sugar 3 tablespoons molasses plus 1 cup of white sugar Confectioner’s/Powdered Sugar Process 1 cup sugar plus 1 tablespoon cornstarch Corn Syrup 1 cup sugar plus 1/4 cup water 1 cup Golden Syrup 1 cup honey (may be little sweeter) 1 cup molasses Golden Syrup Combine two parts light corn syrup plus one part molasses 1/2 cup honey plus 1/2 cup corn syrup 1 cup maple syrup 1 cup corn syrup Honey 1- 1/4 cups sugar plus 1/4 cup water 3/4 cup maple syrup plus 1/2 cup granulated sugar 3/4 cup corn syrup plus 1/2 cup granulated sugar 3/4 cup light molasses plus 1/2 cup granulated white sugar 1 1/4 cups granulated white or brown sugar plus 1/4 cup additional liquid in recipe plus 1/2 teaspoon cream of tartar Maple Syrup 1 cup honey,thinned with water or fruit juice like apple 3/4 cup corn syrup plus 1/4 cup butter 1 cup Brown Rice Syrup 1 cup Brown sugar (in case of cereals) 1 cup light molasses (on pancakes, cereals etc) 1 cup granulated sugar for every 3/4 cup of maple syrup and increase liquid in the recipe by 3 tbsp for every cup of sugar.If baking soda is used, decrease the amount by 1/4 teaspoon per cup of sugar substituted, since sugar is less acidic than maple syrup Molasses 1 cup honey 1 cup dark corn syrup 1 cup maple syrup 3/4 cup brown sugar warmed and dissolved in 1/4 cup of liquid ( use this if taste of molasses is important in the baked good) Cocoa Powder (Natural, Unsweetened) 3 tablespoons (20 grams) Dutch-processed cocoa plus 1/8 teaspoon cream of tartar, lemon juice or white vinegar 1 ounce (30 grams) unsweetened chocolate (reduce fat in recipe by 1 tablespoon) 3 tablespoons (20 grams) carob powder Semisweet baking chocolate (1 oz) 1 oz unsweetened baking chocolate plus 1 Tbsp sugar Unsweetened baking chocolate (1 oz ) 3 Tbsp baking cocoa plus 1 Tbsp vegetable oil or melted shortening or margarine Semisweet chocolate chips (1 cup) 6 oz semisweet baking chocolate, chopped (Alternatively) For 1 cup of Semi sweet chocolate chips you can use : 6 tablespoons unsweetened cocoa powder, 7 tablespoons sugar ,1/4 cup fat (butter or oil) Leaveners and Diary * * (HV) denotes Healthy Version for low fat or fat free substitution in Baking Compressed Yeast (1 cake) 1 envelope or 2 teaspoons active dry yeast 1 packet (1/4 ounce) Active Dry yeast 1 cake fresh compressed yeast 1 tablespoon fast-rising active yeast Baking Powder (1 tsp) 1/3 teaspoon baking soda plus 1/2 teaspoon cream of tartar 1/2 teaspoon baking soda plus 1/2 cup buttermilk or plain yogurt 1/4 teaspoon baking soda plus 1/3 cup molasses. When using the substitutions that include liquid, reduce other liquid in recipe accordingly Baking Soda(1 tsp) 3 tsp Baking Powder ( and reduce the acidic ingredients in the recipe. Ex Instead of buttermilk add milk) 1 tsp potassium bicarbonate Ideal substitution – 2 tsp Baking powder and omit salt in recipe Cream of tartar (1 tsp) 1 teaspoon white vinegar 1 tsp lemon juice Notes from What’s Cooking America – If cream of tartar is used along with baking soda in a cake or cookie recipe, omit both and use baking powder instead. If it calls for baking soda and cream of tarter, just use baking powder.Normally, when cream of tartar is used in a cookie, it is used together with baking soda. The two of them combined work like double-acting baking powder. When substituting for cream of tartar, you must also substitute for the baking soda. If your recipe calls for baking soda and cream of tarter, just use baking powder. One teaspoon baking powder is equivalent to 1/4 teaspoon baking soda plus 5/8 teaspoon cream of tartar. If there is additional baking soda that does not fit into the equation, simply add it to the batter. Buttermilk (1 cup) 1 tablespoon lemon juice or vinegar (white or cider) plus enough milk to make 1 cup (let stand 5-10 minutes) 1 cup plain or low fat yogurt 1 cup sour cream 1 cup water plus 1/4 cup buttermilk powder 1 cup milk plus 1 1/2 – 1 3/4 teaspoons cream of tartar Plain Yogurt (1 cup) 1 cup sour cream 1 cup buttermilk 1 cup crème fraiche 1 cup heavy whipping cream (35% butterfat) plus 1 tablespoon freshly squeezed lemon juice Whole Milk (1 cup) 1 cup fat free milk plus 1 tbsp unsaturated Oil like canola (HV) 1 cup low fat milk (HV) Heavy Cream (1 cup) 3/4 cup milk plus 1/3 cup melted butter.(whipping wont work) Sour Cream (1 cup) (pls refer also Substitutes for Fats in Baking below) 7/8 cup buttermilk or sour milk plus 3 tablespoons butter. 1 cup thickened yogurt plus 1 teaspoon baking soda. 3/4 cup sour milk plus 1/3 cup butter. 3/4 cup buttermilk plus 1/3 cup butter. Cooked sauces: 1 cup yogurt plus 1 tablespoon flour plus 2 teaspoons water. Cooked sauces: 1 cup evaporated milk plus 1 tablespoon vinegar or lemon juice. Let stand 5 minutes to thicken. Dips: 1 cup yogurt (drain through a cheesecloth-lined sieve for 30 minutes in the refrigerator for a thicker texture). Dips: 1 cup cottage cheese plus 1/4 cup yogurt or buttermilk, briefly whirled in a blender. Dips: 6 ounces cream cheese plus 3 tablespoons milk,briefly whirled in a blender. Lower fat: 1 cup low-fat cottage cheese plus 1 tablespoon lemon juice plus 2 tablespoons skim milk, whipped until smooth in a blender. Lower fat: 1 can chilled evaporated milk whipped with 1 teaspoon lemon juice. 1 cup plain yogurt plus 1 tablespoon cornstarch 1 cup plain nonfat yogurt Substitutes for Fats in Baking * * (HV) denoted Healthy Version for low fat or fat free substitution in Baking Butter (1 cup) 1 cup trans-free vegetable shortening 3/4 cups of vegetable oil (example. Canola oil) Fruit purees (example- applesauce, pureed prunes, baby-food fruits). Add it along with some vegetable oil and reduce any other sweeteners needed in the recipe since fruit purees are already sweet. 1 cup polyunsaturated margarine (HV) 3/4 cup polyunsaturated oil like safflower oil (HV) 1 cup mild olive oil (not extra virgin)(HV) Note: Butter creates the flakiness and the richness which an oil/purees cant provide. If you don’t want to compromise that much to taste, replace half the butter with the substitutions. Shortening(1 cup) 1 cup polyunsaturated margarine like Earth Balance or Smart Balance(HV) 1 cup + 2tbsp Butter ( better tasting than shortening but more expensive and has cholesterol and a higher level of saturated fat; makes cookies less crunchy, bread crusts more crispy) 1 cup + 2 tbsp Margarine (better tasting than shortening but more expensive; makes cookies less crunchy, bread crusts tougher) 1 Cup – 2tbsp Lard (Has cholesterol and a higher level of saturated fat) Oil equal amount of apple sauce stiffly beaten egg whites into batter equal parts mashed banana equal parts yogurt prune puree grated raw zucchini or seeds removed if cooked. Works well in quick breads/muffins/coffee cakes and does not alter taste pumpkin puree (if the recipe can handle the taste change) Low fat cottage cheese (use only half of the required fat in the recipe). Can give rubbery texture to the end result Silken Tofu – (use only half of the required fat in the recipe). Can give rubbery texture to the end result Equal parts of fruit juice Note: Fruit purees can alter the taste of the final product is used in large quantities. Cream Cheese (1 cup) 4 tbsps. margarine plus 1 cup low-fat cottage cheese – blended. Add few teaspoons of fat-free milk if needed (HV) Heavy Cream (1 cup) 1 cup evaporated skim milk (or full fat milk) 1/2 cup low fat Yogurt plus 1/2 low fat Cottage Cheese (HV) 1/2 cup Yogurt plus 1/2 Cottage Cheese Sour Cream (1 cup) 1 cup plain yogurt (HV) 3/4 cup buttermilk or plain yogurt plus 1/3 cup melted butter 1 cup crème fraiche 1 tablespoon lemon juice or vinegar plus enough whole milk to fill 1 cup (let stand 5-10 minutes) 1/2 cup low-fat cottage cheese plus 1/2 cup low-fat or nonfat yogurt (HV) 1 cup fat-free sour cream (HV) Note: How to Make Maple Syrup Substitute at home For 1 Cup Maple Syrup 1/2 cup granulated sugar 1 cup brown sugar, firmly packed 1 cup boiling water 1 teaspoon butter 1 teaspoon maple extract or vanilla extract Method In a heavy saucepan, place the granulated sugar and keep stirring until it melts and turns slightly brown. Alternatively in another pan, place brown sugar and water and bring to a boil without stirring. Now mix both the sugars and simmer in low heat until they come together as one thick syrup. Remove from heat, add butter and the extract. Use this in place of maple syrup. Store it in a fridge in an air tight container. Even though this was posted in their site long back, I found it helpful. So posting it for you. via chefinyou . cc image credit: flickr/zetrules

    Read the article

  • Ubuntu 12.04 share the internet over WiFi from wvdial?

    - by Sour Lemon
    I have just installed Ubuntu 12.04 on a separate partition on my hard drive so I can dual boot to either Windows 7 or Ubuntu. I am living in Japan and so I'm using a mobile broadband USB device called "Softbank C02LC". By default it seems that this device isn't recognised so I did the following: Terminal: sudo su nano /usr/bin/usbModemScript Nano: #!/bin/bash echo 1c9e 9900 > /sys/bus/usb-serial/drivers/option1/new_id Terminal: chmod +x /usr/bin/usbModemScript nano /etc/udev/rules.d/option.rules Nano: ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9900", RUN+="/usr/bin/usbModemScript" ATTRS{idVendor}=="1c9e", ATTRS{idProduct}=="9900", RUN+="/sbin/modprobe option" which made the device visible from the network manager etc. However even though I set up my details correctly when I created a new connection (Correct username, APN etc) as soon as I try to connect it almost immediately disconnects. Because of this I then followed the instructions at this site: http://debugitos.main.jp/index.php?Ubuntu%2F%A5%E2%A5%D0%A5%A4%A5%EB%A5%A4%A5%F3%A5%BF%A1%BC%A5%CD%A5%C3%A5%C8 And I ended up using the c02lc_connect script at the bottom of the page to connect to the internet. The file contains the following bash script: #!/bin/sh usbinterfece=/dev/ttyUSB2 VID=1c9e PID=9900 WRONG_PID=f000 LSUSB=/usr/sbin/lsusb GREP=/bin/grep MODPROBE=/sbin/modprobe SWITCH=/usr/sbin/usb_modeswitch SWITCH_D=/etc/usb_modeswitch.d WVDIAL=/usr/bin/wvdial SLEEP=/bin/sleep SUDO=/usr/bin/sudo WHICH=/usr/bin/which switch_config="$SWITCH_D/$VID:$WRONG_PID" if ! [ -x $WVDIAL -a -x $SWITCH ]; then echo "Install wvdial and usb_modeswitch." exit 0 fi check_usb() { local vid="$1" local pid="$2" ($LSUSB | $GREP "$vid:$pid") } if ! (check_usb "$VID" "$PID"); then echo "Cannot find modem device..." if (check_usb "$VID" "$WRONG_PID") && ( [ -f "$switch_config" ] ); then echo "The device is attached but its mode is wrong." echo "Try usb_modeswitch..." $SUDO $SWITCH -c "$switch_config" $SLEEP 1 if (check_usb "$VID" "$PID"); then echo "Successfully switched the mode." else echo "Failed to switch the mode..." exit 1 fi else exit 1 fi fi if [ ! -c "$usbinterface" ]; then $SUDO $MODPROBE usbserial vendor=0x$VID product=0x$PID $SLEEP 2 fi $SUDO $WVDIAL which works completely fine - no problems what-so-ever. But we also have 1 more laptop here which I need to share the internet connection with. In Windows 7 I do this with the Connectify program, and in Ubuntu I have seen that you can do things like set up hotspots etc. But because I am using WvDial I am not sure how I would share the internet. I am only beginning to use Ubuntu but unfortunately until I can figure out how to share the internet over WiFi when connected via WvDial I have to stick with Windows. If you have any ideas on how to do this it would be much appreciated!

    Read the article

  • Which C++ graphics library should I use?

    - by mspoerr
    Hello, I found the following graphics libraries, but I am not sure which one I should use. Maybe there are some more... Graphviz (http://www.graphviz.org/) Boost Graph Library (http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/index.html) Lemon (http://lemon.cs.elte.hu/trac/lemon) igraph (http://igraph.sourceforge.net/introduction.html) What it should do: draw a undirected network map come as header only or static lib for Windows the output format should be user editable Graphviz is the only one I tried so far, but I found no static lib for it, I failed to build it by my own and the documentation could be better. Therefore I looked around and found these other three libs. I would be glad to get some recommendations which lib to choose. Thanks, /mspoerr

    Read the article

  • Which C++ graph library should I use?

    - by mspoerr
    Hello, I found the following graph libraries, but I am not sure which one I should use. Maybe there are some more... Graphviz (http://www.graphviz.org/) Boost Graph Library (http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/index.html) Lemon (http://lemon.cs.elte.hu/trac/lemon) igraph (http://igraph.sourceforge.net/introduction.html) What it should do: draw a undirected network map come as header only or static lib for Windows the output format should be user editable Graphviz is the only one I tried so far, but I found no static lib for it, I failed to build it by my own and the documentation could be better. Therefore I looked around and found these other three libs. I would be glad to get some recommendations which lib to choose. Thanks, /mspoerr

    Read the article

  • git init --bare permission denied on 16gb USB stick

    - by Sour Lemon
    I am using GIT on a Windows 7 machine (64 bit) and have been learning how to use GIT to version control my files. Now I want to be able to create a --bare repository on an external device (in this case a 16gb USB stick) but unfortunately when I try to create a --bare repository on it I get the following error: f:/: Permission denied I am using the GIT Bash program which is installed with GIT on Windows machines, so these are the commands I am typing in (I am also opening the program as administrator by holding ctrl + shift when I open it) cd /f git init --bare f:/: Permission denied However if I create a normal repository it works just fine: cd /f git init Initialized empty repository in f:/.git/ Can anybody shed some light on why I can't create a --bare repository? Any help would be much appreciated.

    Read the article

  • authentication error while importing from netbeans to subversion

    - by SpikETidE
    Hi Everyone.... I just began looking into source control.... And installed subversion from collabnet... I also use netbeans(6.8) to work with PHP... I have done the following steps I have installed subversion is c:\program files\collabnet\ and the root for the repositories in e:\svn_repository I then created a repository as e:\svn_repository\lemon I then edited the passwd file and added the user and password I then tried importing an existing project into the repository with the address - svn://localhost/lemon with the new user and password. After all this, i get the error "authentication failed"... I am pretty sure the authentication is correct... I tried importing the project with the address file:///E:/sv_repository/lemon with no authentication and it connected... But i got other guys who got to connect to this server through lan and svn:// protocol is the only option.... What am i doing wrong here..? Also.. where can i find a proper tutorial to connect netbeans and collabnet subversion.....? Thanks for your suggestions and time...

    Read the article

  • PHP - Tricky... array into columns, but in a specific order.

    - by Joe
    <?php $combinedArray = array("apple","banana","watermelon","lemon","orange","mango"); $num_cols = 3; $i = 0; foreach ($combinedArray as $r ){ /*** use modulo to check if the row should end ***/ echo $i++%$num_cols==0 ? '<div style="clear:both;"></div>' : ''; /*** output the array item ***/ ?> <div style="float:left; width:33%;"> <?php echo $r; ?> </div> <?php } ?> <div style="clear:both;"></div> The above code will print out the array like this: apple --- banana --- watermelon lemon --- orange --- mango However, I need it like this: apple --- watermelon --- orange banana --- lemon --- mango Do you know how to convert this? Basically, each value in the array needs to be placed underneath the one above, but it must be based on this same structure of 3 columns, and also an equal amount of fruits per column/row (unless there was like 7 fruits there would be 3 in one column and 2 in the other columns. Sorry I know it's confusing lol

    Read the article

  • Generating Random Paired Images in C#

    - by Lemon
    im trying create cards matching game. normally these type of games they match paired cards together (with the same file name "A.jpg with A.jpg") but in my case, im matching cards with different names "B.jpg with A.jpg" (correct), "C.jpg with D.jpg" (correct) but with "B.jpg with C.jpg" (incorrect answer). A.jpg-B.jpg <--correct C.jpg-D.jpg <--correct E.jpg-F.jpg <--correct i face a problem when i generate the cards in random. I manage to generate random cards but i dont manage to generate it with their paired onces. Below is an illustration of the problem A.jpg-B.jpg <--correct C.jpg-F.jpg <--incorrect so how should i code it so that it always generate with their paired onces, so that my game can proceed?

    Read the article

  • mysql query - blog posts and comments with limit

    - by Lemon
    Hi, I have 2 tables: comments and posts and I'd like to display a list of 15 posts and maximum 2 most recent comments under each blog post the database scheme looks like this posts_table: post_id, post_txt, post_timestamp comments_table: post_id, comment_txt, comment_timestamp how the mysql query should look like to select 15 posts and related comments (max 2 most recent ones per post) ??? thanks, Leo

    Read the article

  • [as3] list cellRenderer

    - by lemon
    I'm quite new with as3 via cs4 so please bear with me. I'm trying to make a phone book type list that displays the users name, cellnumber and possible a delete button. --- Bob 09XXXXXXXXX delete --- Sussie 09XXXXXXXXX delete --- Johnny 09XXXXXXXXX delete --- I've tried making a list and added to it a XML dataprovider <profiles> <profile> <label>Bob</label> ... </profile> It'll then display a list of names Bob Sussie Johnny But what do I have to do in order to get it print like fig 1? I know that it has something to do with CellRender but I can't seem to find any decent examples in Google.

    Read the article

  • [Android] ProgressBar inside SimpleAdapter

    - by lemon
    I'm trying to add a ProgressBar to my row.xml view but I can't seem to make it work I keep getting 06-09 12:44:44.802: ERROR/AndroidRuntime(1012): java.lang.IllegalStateException: android.widget.ProgressBar is not a view that can be bounds by this SimpleAdapter ArrayList arr = new ArrayList(); HashMap map = new HashMap(); map.put("progress", 10); arr.add(map); String [] fieldNames = {"progress"}; int [] fieldIds = {R.id.progress}; SimpleAdapter adapter = new SimpleAdapter(this, arr, R.layout.row, fieldNames, fieldIds); list = (ListView) findViewById(R.id.list); list.setAdapter(adapter); <ProgressBar android:id="@+id/progress" style="?android:attr/progressBarStyleHorizontal" android:max="100" android:progress="5" android:layout_width="fill_parent" android:layout_height="fill_parent" /> Does anyone have any idea what I'm missing?

    Read the article

  • how to get last inserted id - zend

    - by Lemon
    I'm trying to get latest inserted id from a table using this code: $id = $tbl->fetchAll (array('public=1'), 'id desc'); but it's always returning "1" any ideas? update: I've just discovered toArray();, which retrieves all the data from fetchAll. The problem is, I only need the ID. My current code looks like this: $rowsetArray = $id->toArray(); $rowCount = 1; foreach ($rowsetArray as $rowArray) { foreach ($rowArray as $column => $value) { if ($column="id") {$myid[$brr] = $value;} //echo"\n$myid[$brr]"; } ++$rowCount; ++$brr; } Obviously, I've got the if ($column="id") {$myid[$brr] = $value;} thing wrong. Can anyone point me in the right direction? An aternative would be to filter ID's from fetchAll. Is that possible?

    Read the article

  • [Android] XML Parser

    - by lemon
    I'm trying to extract n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs= using w3c dom <html> <div id='token' style='display:none;'> n0Y7ezLlIYA8R0K54rEmHaTOraBQVSPDjQaGlQxlGso4jdVN1kRxtcfskEs= </div> </html> but I seem to be stuck DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = builder.parse(con.getInputStream()); NodeList list = doc.getElementsByTagName("div"); Can someone please point me to some basic tutorials that would help me solve my dilemma. Thanks.

    Read the article

  • What is the most efficient way to convert to binary and back in C#?

    - by Saad Imran.
    I'm trying to write a general purpose socket server for a game I'm working on. I know I could very well use already built servers like SmartFox and Photon, but I wan't to go through the pain of creating one myself for learning purposes. I've come up with a BSON inspired protocol to convert the the basic data types, their arrays, and a special GSObject to binary and arrange them in a way so that it can be put back together into object form on the client end. At the core, the conversion methods utilize the .Net BitConverter class to convert the basic data types to binary. Anyways, the problem is performance, if I loop 50,000 times and convert my GSObject to binary each time it takes about 5500ms (the resulting byte[] is just 192 bytes per conversion). I think think this would be way too slow for an MMO that sends 5-10 position updates per second with a 1000 concurrent users. Yes, I know it's unlikely that a game will have a 1000 users on at the same time, but like I said earlier this is supposed to be a learning process for me, I want to go out of my way and build something that scales well and can handle at least a few thousand users. So yea, if anyone's aware of other conversion techniques or sees where I'm loosing performance I would appreciate the help. GSBitConverter.cs This is the main conversion class, it adds extension methods to main datatypes to convert to the binary format. It uses the BitConverter class to convert the base types. I've shown only the code to convert integer and integer arrays, but the rest of the method are pretty much replicas of those two, they just overload the type. public static class GSBitConverter { public static byte[] ToGSBinary(this short value) { return BitConverter.GetBytes(value); } public static byte[] ToGSBinary(this IEnumerable<short> value) { List<byte> bytes = new List<byte>(); short length = (short)value.Count(); bytes.AddRange(length.ToGSBinary()); for (int i = 0; i < length; i++) bytes.AddRange(value.ElementAt(i).ToGSBinary()); return bytes.ToArray(); } public static byte[] ToGSBinary(this bool value); public static byte[] ToGSBinary(this IEnumerable<bool> value); public static byte[] ToGSBinary(this IEnumerable<byte> value); public static byte[] ToGSBinary(this int value); public static byte[] ToGSBinary(this IEnumerable<int> value); public static byte[] ToGSBinary(this long value); public static byte[] ToGSBinary(this IEnumerable<long> value); public static byte[] ToGSBinary(this float value); public static byte[] ToGSBinary(this IEnumerable<float> value); public static byte[] ToGSBinary(this double value); public static byte[] ToGSBinary(this IEnumerable<double> value); public static byte[] ToGSBinary(this string value); public static byte[] ToGSBinary(this IEnumerable<string> value); public static string GetHexDump(this IEnumerable<byte> value); } Program.cs Here's the the object that I'm converting to binary in a loop. class Program { static void Main(string[] args) { GSObject obj = new GSObject(); obj.AttachShort("smallInt", 15); obj.AttachInt("medInt", 120700); obj.AttachLong("bigInt", 10900800700); obj.AttachDouble("doubleVal", Math.PI); obj.AttachStringArray("muppetNames", new string[] { "Kermit", "Fozzy", "Piggy", "Animal", "Gonzo" }); GSObject apple = new GSObject(); apple.AttachString("name", "Apple"); apple.AttachString("color", "red"); apple.AttachBool("inStock", true); apple.AttachFloat("price", (float)1.5); GSObject lemon = new GSObject(); apple.AttachString("name", "Lemon"); apple.AttachString("color", "yellow"); apple.AttachBool("inStock", false); apple.AttachFloat("price", (float)0.8); GSObject apricoat = new GSObject(); apple.AttachString("name", "Apricoat"); apple.AttachString("color", "orange"); apple.AttachBool("inStock", true); apple.AttachFloat("price", (float)1.9); GSObject kiwi = new GSObject(); apple.AttachString("name", "Kiwi"); apple.AttachString("color", "green"); apple.AttachBool("inStock", true); apple.AttachFloat("price", (float)2.3); GSArray fruits = new GSArray(); fruits.AddGSObject(apple); fruits.AddGSObject(lemon); fruits.AddGSObject(apricoat); fruits.AddGSObject(kiwi); obj.AttachGSArray("fruits", fruits); Stopwatch w1 = Stopwatch.StartNew(); for (int i = 0; i < 50000; i++) { byte[] b = obj.ToGSBinary(); } w1.Stop(); Console.WriteLine(BitConverter.IsLittleEndian ? "Little Endian" : "Big Endian"); Console.WriteLine(w1.ElapsedMilliseconds + "ms"); } Here's the code for some of my other classes that are used in the code above. Most of it is repetitive. GSObject GSArray GSWrappedObject

    Read the article

  • Tips For Getting the Best Web Development

    For many people getting custom web development sounds like a complicated endeavor. It is true, that getting a good overall work output from a company or an individual in regards to web creation can turn sour fast, but you can utilize a few tips and ask a few questions to make sure that you're not getting swindled.

    Read the article

  • [PHP] Sorting data in an array

    - by kwokwai
    Hi all, I got an array which has 7 types of fruit: $fruits = array( "lemon", "orange", "banana", "apple", "cherry", "apricot", "Blueberry" ); I don't know how to print out the data in a way that the outcome will like this: <A> Apple, Apricot (Note that Apricot is followed by Apple in alphabetic order) <B> Banana <C> Cherry <L> Lemon <O> Orange I am sorry that the question may be a bit difficult. But please kindly help if you could.

    Read the article

  • Selling Solutions, Not Products

    - by David Dorf
    When I think about next-generation retailers, the names that come to mind are Apple, Whole Foods, Lulu Lemon, and IKEA.  They may not be the biggest retailers, but they are certainly growing fast. Success is never defined by just one dimension, and these retailers execute well across many dimensions, but the one that stands out for me is customer experience.  These stores feel...approachable...part of the community...local.  Customers are not intimidated to ask questions, and staff seem to go out of their way to help. What's makes these retailers stand out in the industry?  These retailers aren't selling products -- they're selling solutions.  Think about that.  You think you're going to the Apple store to buy a phone, but you're actually buying a communications solution that handles much, much more.  If you carry an iPhone, your life has changed.  The way you do things is different.  The impacts go much beyond a simple phone. Solutions start with a problem, which is why these retailers greet customers with "what brought you in today," or "can I answer any questions for you?"  Good retailers establish a relationship, even if it lasts only a few minutes. You don't walk into Whole Foods looking for cans of soup.  You are looking for meals: healthy snacks, interesting lunches, exotic dinners.  Its a learning experience where you might discover solutions to problems you didn't know you had.  Mention what foods you like, and you'll get a list of similar items you had not considered.  I didn't know I needed a closet organizer until I visited an IKEA and learned about all the options.  They were able to customize the solution to meet my needs, and now I'm much more organized. One of the differences between selling products and selling solutions is training.  Visit any of these retailers' sites and you'll see a long list of in-store events for the benefit of customers.  You can buy exercise clothing from Lulu Lemon, and also learn new yoga techniques, meet like-minded people, and branch off to other fitness regimes via their ambassadors.  You can visit the Geek Bar at Apple, eat lunch at IKEA, and learn to cook at Whole Foods. These retailers are making an investment in a relationship with their customers.  They are showing loyalty to their customers before asking for it back.  In the long-run, this strategic approach will outlive any scan-and-bag mentality.

    Read the article

  • DVD drive not recognized

    - by David Oneill
    I'm in the midst of building a computer (first time builder) I got everything plugged in, and hit the power button. After the excitement of the first boot coming up on my screen, I was looking through the BIOS settings. However, joy soon turned sour, as I looked at the list of installed SATA devices. My DVD drive wasn't on the list :( So, what are common things I should check/try?

    Read the article

1 2 3  | Next Page >