Daily Archives

Articles indexed Friday August 22 2014

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

  • ASP.NET Web Optimization - confusion about loading order

    - by Ciel
    Using the ASP.NET Web Optimization Framework, I am attempting to load some javascript files up. It works fine, except I am running into a peculiar situation with either the loading order, the loading speed, or its execution. I cannot figure out which. Basically, I am using ace code editor for javascript, and I also want to include its autocompletion package. This requires two files. /ace.js /ext-language_tools.js This isn't an issue, if I load both of these files the normal way (with <script> tags) it works fine. But when I try to use the web optimization bundles, it seems as if something goes wrong. Trying this out... bundles.Add(new ScriptBundle("~/bundles/js") { .Include("~/js/ace.js") .Include("~/js/ext-language_tools.js") }); and then in the view .. @Scripts.Render("~/bundles/js") I get the error ace is not defined This means that the ace.js file hasn't run, or hasn't loaded. Because if I break it apart into two bundles, it starts working. bundles.Add(new ScriptBundle("~/bundles/js") { .Include("~/js/ace.js") }); bundles.Add(new ScriptBundle("~/bundles/js/language_tools") { .Include("~/js/ext-language_tools.js") }); Can anyone explain why this would behave in this fashion?

    Read the article

  • Show UIView for app presentation only once in iOS

    - by André Muniz
    I need to show an UIScrollView with some pages for present the app to user when launched for the first time. My slides are working correctly, lefting the logic to present it. Is a good practice to set the UIScrollViewController as root controller and set a NSUserDefault variable to control the presentation and redirect to main controller or set the main ViewController as root normally and call the presentation view if needed is a better approach? If there is a better way to do this can someone help? Thanks.

    Read the article

  • Task.wait not working as I imagined

    - by user2357446
    I am trying to download a file, wait for the file to finish downloading, and then read the file afterwards. I have the following methods to do this: private async Task startDownload(string link, string savePath) { WebClient client = new WebClient(); client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged); client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted); await client.DownloadFileTaskAsync(new Uri(link), savePath); } private void checkUpdateButton_Click(object sender, EventArgs e) { Task task = Task.Factory.StartNew(() => startDownload(versionLink, versionSaveTo)); task.Wait(); if (task.IsCompleted) { checkVersion(); } } The checkVersion() method reads the file that was downloaded. This is throwing an IOException saying that the file is in use by something else and cannot be read. I thought that having task.Wait would prevent the rest of the method from executing until the task was finished?

    Read the article

  • Android - BaseGameUtil Complicated Import

    - by Fabiow Quixadá
    I've seen many topics in stackoverflow, such as Cannot import BaseGameUtils (Eclipse weirdness) and Android: cannot import BaseGameUtils successfully in Eclipse but none resolved my problem. I've followed https://developer.android.com/google/play-services/setup.html#Setup - the Add Google Play Services to Your Project [Using Eclipse with ADT], I THINK my project correctly references the google play services lib since up to that point nothing wrong happened. Then, following https://developers.google.com/games/services/android/quickstart, I've downloaded BaseGameUtils but when I import the two projects [TypeANumber & BaseGameUtil], they came named as main and MainActivity. I've renamed BaseGameUtil as so and have marked it as lib and imported it to my project through Properties Android Library, but I can't extend extend a class from BaseGameUtil because it's not even suggested. Also, I have not installed Android L and Android 4.4W from SDK Manager in Eclipse, altough I think that's no the case. Can anyone please help in this? Thanks so much in advance

    Read the article

  • Android how to create notification that resumes activity

    - by Adam Praiswater
    I a have a notification in a receiver that fires off fine, but it restarts the activity (thus clearing the edittexts and resetting the toggle button) How can i set it so that when its tapped on it resumes the activity rather that clearing and resetting everything? My current code doesnt work. Current Code String currentDateTimeString = DateFormat.getDateTimeInstance().format(new Date()); Intent intenti= new Intent(context, Locator.class); intenti.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intenti, 0); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) .setSmallIcon(R.drawable.xxxxxxnotifyicon) .setContentTitle("xxxxxxx Link") .setContentText("Auto Check In Complete at " + currentDateTimeString); mBuilder.setContentIntent(contentIntent); mBuilder.setDefaults(Notification.DEFAULT_SOUND); mBuilder.setAutoCancel(true); NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mNotificationManager.notify(1, mBuilder.build());

    Read the article

  • Check for duplicate rows in 2 columns before update

    - by user3891378
    I have a table with 4 columns, and I need to check to see if a Column Pair exists before inserting a row into the database: INSERT INTO dbo.tblCallReport_Detail (fkCallReport, fkProductCategory, Discussion, Action) VALUES (?, ?, ?, ?) The pair in question is fkCallReport and fkProductCategory. For example if the row trying to be inserted has fkCallReport = 3 and fkProductCategory = 5, and the database already has both of those values together, it should display an error and ask if they would like to combine the Disuccsion and Action with the current record. Keep in mind I'm doing this in VBA Access 2010 and am still very new.

    Read the article

  • Simple image displaying php error

    - by Rani dubey
    In a query say i have a image path that have multiple images stored as path=http://localhost/images/xyz.When i run the code: <?php //Retrieves data from MySQL mysql_connect("localhost", "root", "") or die ("Could not save image name Error: " . mysql_error()); mysql_select_db("dawat") or die("Could not select database"); $data = mysql_query("SELECT 'images_path' FROM images_tbl") or die(mysql_error()); //Puts it into an array $file_path = 'http://localhost/images/xyz'; while($row = mysql_fetch_assoc( $data )) {//Outputs the image and other data $src=$file_path.$row["images_path"]; echo "<img src=".$src."> <br>"; } ?> Everything is working fine,but only images are not showing.On place of images it is showing small thumnails.Please suggest what to do.... Sql query i used is: CREATE TABLE images_tbl( images_id INT NOT NULL AUTO_INCREMENT, images_path VARCHAR(200) NOT NULL, submission_date DATE, PRIMARY KEY (images_id) );

    Read the article

  • How can I find out if an data- attribute is set to an empty value?

    - by Stephan Wagner
    Is there a way to find out if an data- attribute is set to an empty value or if it is not set at all? See this fiddle example (Check the console when clicking on the elements): http://jsfiddle.net/StephanWagner/yy8qvwfp/ <div onclick="console.log($(this).attr('data-test'))">undefined</div> <div data-test="" onclick="console.log($(this).attr('data-test'))">empty</div> <!-- this one will also return an empty value --> <div data-test onclick="console.log($(this).attr('data-test'))">null</div> <div data-test="value" onclick="console.log($(this).attr('data-test'))">value</div> Im having the issue with the third example. I need to know if the attribute actually is set to an empty value or if it is not set at all. Is that actually possible? EDIT: The reason I'm asking is that I'm updating content with the attributes value, so data-test="" should update the content to an empty value, but data-test should do nothing at all

    Read the article

  • Getting keyboard size from user info in Swift

    - by user3746428
    I have been trying to add some code to move my view up when the keyboard appears, however I am having issues trying to translate the Objective C examples into Swift. I have made some progress but I am stuck on one particular line. These are the two tutorials/questions I have been following: How to move content of UIViewController upwards as Keypad appears using Swift http://www.ioscreator.com/tutorials/move-view-when-keyboard-appears Here is the code I currently have: override func viewWillAppear(animated: Bool) { NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil) NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillHide:", name: UIKeyboardWillHideNotification, object: nil) } override func viewWillDisappear(animated: Bool) { NSNotificationCenter.defaultCenter().removeObserver(self) } func keyboardWillShow(notification: NSNotification) { var keyboardSize = notification.userInfo(valueForKey(UIKeyboardFrameBeginUserInfoKey)) UIEdgeInsets(top: 0, left: 0, bottom: keyboardSize.height, right: 0) let frame = self.budgetEntryView.frame frame.origin.y = frame.origin.y - keyboardSize self.budgetEntryView.frame = frame } func keyboardWillHide(notification: NSNotification) { // } At the moment I am getting an error on this line: var keyboardSize = notification.userInfo(valueForKey(UIKeyboardFrameBeginUserInfoKey)) If someone could let me know what this line of code should be, I should manage to figure out the rest myself.

    Read the article

  • How to define one-to-many connection between a same model through another model

    - by Mekajiki
    I want to define one-to-many relationship as follows; User has one introducer User has many newcomers(who is introduced by the user) Use "Introduction" model instead of adding a column to users table. My table and model definition is as follows; DB Scheme: create_table "introductions", force: true do |t| t.integer "introducer_id" t.integer "newcomer_id" t.datetime "created_at" t.datetime "updated_at" User model: class User < ActiveRecord::Base has_many :introductions, foreign_key: :introducer_id has_many :newcomers, through: :introductions, source: :newcomer belongs_to :introduction, foreign_key: :newcomer_id belongs_to :introducer end Introduction model: class Introduction < ActiveRecord::Base belongs_to :introducer, class_name: 'User' belongs_to :newcomer, class_name: 'User' end This works fine: user1.newcomers.push user2 but, user2.introducer # => nil How can I define belongs_to relationship correctly?

    Read the article

  • What version of mongodb was full $text query operator introduced?

    - by Marc Maxson
    Stupid question, right? But the official docs for 'text index' say: http://docs.mongodb.org/manual/core/index-text/ Text Indexes New in version 2.4. To perform queries that access the text index, use the $text query operator. Whereas if you click on the help for searching the index you created with the $text operator, it reads: http://docs.mongodb.org/manual/reference/operator/query/text/#op._S_text $text New in version 2.6. Seems to be 2.4 but still having problems wiht it.

    Read the article

  • A Perl script and a Perl module are using `use lib` and referencing the same module

    - by miss_a
    I have a Perl script that is using two modules. The first module also uses the second module. If the the first module does use lib 'dir1', and the script does use lib 'dir2': module1.pm use lib "dir1"; use module2; script.pl use lib "dir2"; use module1; use module2; which directory is being used by the first module? Does the script's use lib, 'dir2' override the use lib, 'dir1' in the first module, or do they have different scope?

    Read the article

  • Laravel: validation for unique username issue

    - by T2theC
    I have a noodle scratcher that I can't seem to figure out. I am validating for unique usernames and emails addresses. I have the following rules: protected $rules = array( 'username' => 'required|min:4|unique:users,username', 'email' => 'email|unique:users,email', 'password' => 'min:6', ); If I update a form that has the username (which is the same as it currently is), I get a The username has already been taken. error. If I do the same with the email, I get no error at all. I know about adding the last param to the unique validation: 'unique:users,username,{{$id}}' or 'unique:users,username,'.$id This doesn't work on the username. I get the same issue. I can't figure out why this works for the email, but not the username. Anyone had a similar issue or know where I am going wrong? Many thanks,

    Read the article

  • Windows phone app xaml error

    - by thewarri0r9
    i am developing an app for windows phone 8 and i stuck on this code which visual studio showing invalid xaml. But Code compiles and works well. Invalid xaml Code is : <DataTemplate x:Key="AddrBookItemTemplate"> <StackPanel Margin="0,0,0,2" Orientation="Horizontal"> <StackPanel Width="80" Orientation="Horizontal" Height="80"> <Ellipse Margin="0" Height="70" Width="70" HorizontalAlignment="Left" Stroke="{x:Null}"> <Ellipse.Fill> <ImageBrush Stretch="Fill" ImageSource="{Binding imageBytes, Converter={StaticResource BytesToImageConverter}}"/> </Ellipse.Fill> </Ellipse> </StackPanel> <StackPanel Height="80" Margin="0" Width="380" HorizontalAlignment="Left"> <TextBlock FontWeight="Bold" Text="{Binding FirstName}" FontFamily="Segoe WP Semibold" FontSize="30" VerticalAlignment="Top" Margin="5,0,0,0" HorizontalAlignment="Left" /> <TextBlock Text="{Binding Phone}" FontFamily="Segoe WP" FontSize="24" Foreground="{StaticResource PhoneTextBoxReadOnlyBrush}" Margin="5,0,0,-12" Width="320" HorizontalAlignment="Left" VerticalAlignment="Top"/> </StackPanel> </StackPanel> </DataTemplate> I am serializing image by converting it to byte, it works fine but if image is null it gives an error. code behind: if (e.Results != null) { List<AddressBook> source = new List<AddressBook>(); foreach (var result in e.Results) { if (result.PhoneNumbers.FirstOrDefault() != null && result.GetPicture()!=null) { BitmapImage bmp = new BitmapImage(); BitmapImage nullbmp = new BitmapImage(); if (result.GetPicture() == null) { bmp.UriSource = new Uri(@"/Images/ci2.png", UriKind.RelativeOrAbsolute); } else { bmp.SetSource(result.GetPicture()); } listobj.Add(new AddressBook() { FirstName = result.DisplayName != null ? result.DisplayName : "", imageBytes = AddressBook.imageConvert(bmp), EmailAddress = "", LastName = "", Phone = result.PhoneNumbers.FirstOrDefault() != null ? result.PhoneNumbers.FirstOrDefault().PhoneNumber : "", }); } } Above code show an error "object reference not set to instance of an object". I want to show the default image (or color) in ellipse when image is null.What should I do?

    Read the article

  • Sublime Text LaTeXTools console autohide

    - by DCh
    The build script in the LaTeXTools plugin for Sublime Text editor pops up the console, where the result of the compilation is written. I would like the console to auto-hide once the compilation is finished and there are no errors (and to stay open otherwise). I knew how to achieve this with Sublime Text 2. (I think I inserted two lines sublime.active_window().run_command("show_panel", {"panel": "console", "toggle": True})) somewhere in the build script.) How to achieve this behavior with Sublime Text 3? How to (properly) achieve this behavior with Sublime Text 2?

    Read the article

  • TileMap in Sprite kit tile size issue

    - by TazmanNZL
    I am loading a TMX tile map into sprite kit using JSTileMap and the issue I am having is that if I use a tileSet.png the tiles appear too big when displayed. If I use a [email protected] the tiles appear the correct size but my tmx map does not show correctly instead all I see is the tileSet in a grid. I have tried renaming the [email protected] to tileSet.png but once again the tiles appear too big. Can I use a [email protected] with JSTileMap? The tiles in both png files are 128x128 Any help is appreciated.

    Read the article

  • Parsing xml file that comes in as one object per line

    - by Casey
    I haven't been here in so long, I forgot my prior account! Anyways, I am working on parsing an xml document that comes in ugly. It is for banking statements. Each line is a <statement>all tags</statement>. Now, what I need to do is read this file in, and parse the XML document at the same time, while formatting it more human readable too. Point beeing, Original input looks like this: <statement><accountHeader><fiAddress></fiAddress><accountNumber></accountNumber><startDate>20140101</startDate><endDate>20140228</endDate><statementGroup>1</statementGroup><sortOption>0</sortOption><memberBranchCode>1</memberBranchCode><memberName></memberName><jointOwner1Name></jointOwner1Name><jointOwner2Name></jointOwner2Name></summary></statement> <statement><accountHeader><fiAddress></fiAddress><accountNumber></accountNumber><startDate>20140101</startDate><endDate>20140228</endDate><statementGroup>1</statementGroup><sortOption>0</sortOption><memberBranchCode>1</memberBranchCode><memberName></memberName><jointOwner1Name></jointOwner1Name><jointOwner2Name></jointOwner2Name></summary></statement> <statement><accountHeader><fiAddress></fiAddress><accountNumber></accountNumber><startDate>20140101</startDate><endDate>20140228</endDate><statementGroup>1</statementGroup><sortOption>0</sortOption><memberBranchCode>1</memberBranchCode><memberName></memberName><jointOwner1Name></jointOwner1Name><jointOwner2Name></jointOwner2Name></summary></statement> I need the final output to be as follows: <statement> <name></name> <address></address> </statement> This is fine and dandy. I am using the following "very slow considering 5.1 million lines, 254k data file, and about 60k statements takes around 8 minutes". foreach(String item in lines) { XElement xElement = XElement.Parse(item); sr.WriteLine(xElement.ToString().Trim()); } Then when the file is formatted this is what sucks. I need to check every single tag in transaction elements, and if a tag is missing that could be there, I have to fill it in. Our designer software will default prior values in if a tag is possible, and the current objects does not have. It defaults in the value of a prior one that was not Null. "I know, and they swear up and down it is not a bug... ok?" So, that is also taking about 5 to 10 minutes. I need to break all this down, and find a faster method for working with the initial XML. This is a preprocess action, and cannot take that long if not necessary. It just seems redundant. Is there a better way to parse the XML, or is this the best I can do? I parse the XML, write to a temp file, and then read that file in, to the output file inserting the missing tags. 2 IO runs for one process. Yuck.

    Read the article

  • Avoid duplication of values in a SELECT query in PostgreSQL

    - by Shyam Solanki
    I have a table named product which contains two columns: id name 1 p1 2 p2 3 p1 4 p3 5 p4 I run the following query: SELECT DISTINCT id, name FROM product; As a result, PostgreSQL gives me the following output: id name 1 p1 2 p2 3 p1 4 p3 5 p4 I want to avoid duplication of values in the name field, so the desired output should look like this: 1 p1 2 p2 4 p3 5 p4 How should I go about achieving this?

    Read the article

  • winUserControl in VS2010 - properties are not visible in designer

    - by mj82
    I have a problem with (I suppose) my Visual Studio 2010 Express environment: when I design my own UserControl, in Properties grid I can't see public properties of that control. They are however visible in the project, that reference this control. As it's Express Edition, I create new empty project, then add new UserControl to it. Then, for a test, I put following code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Linq; using System.Text; using System.Windows.Forms; namespace Project1 { public partial class UserControl1 : UserControl { private int myNumber; [Browsable(true)] public int MyNumber { get { return myNumber; } set { myNumber = value; } } public UserControl1() { InitializeComponent(); } } } In VS 2008, as I remember, that should be enogh to show MyNumber property in Properties grid, even without [Browsable(true)] attribute. In VS 2010 however, when I double click UserControl1.cs in Solution Explorer and look in Properties, I don't see MyNumber. When I reference and use this control in another project, there is an access to it's properties. I've tried to competly reinstall VS 2010 environment, including SP1, but with no success. Do you have any idea what can be wrong? By the way: none of these attributes are working, either: [Browsable(true)] [EditorBrowsable(EditorBrowsableState.Always)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] [Bindable(true)] Best regards, Marcin

    Read the article

  • Connection failed between Windows Servers

    - by Kerby82
    I'm setting up an infrastructure based on Windows Server 2012. The firewall is turned off and I can't access the Domain controller to check for the group policy. I'm experiencing some connection problem between servers. All the servers are running a site on the TCP Port 80 and I check with netstat that the web server is binding on every Ip of the servers. If i try to telnet from the server itself on the port 80 it works (using DNS name) if I try same telnet from another machine I get connection failed. The DNS works, the ping is successfull, the servers are on the same subnet, the firewall is turned off (even though windows advanced firewall says that some settings can be managed by the System Administrator, i guess group policy). I don't know how to troubleshoot further. Do you have any idea? Is that possible that the FW looks turned off but there are some group policy blocking the connections? (I also check group policy-Administrative Template-Network Connections- Windows FW everything is not configured) I need some hint on how to keep troubleshooting such a problem.

    Read the article

  • Java: very slow tomcat and too big war file

    - by NaN
    I created some sort of RESTful API backend for a mobile app. It's written completely in Java using Jersey as Framework. At the moment no database is used, it's all in the memory, but this is no problem so far (it's only for prototyping purposes). I ordered the smallest package from digital ocean and installed tomcat7. All in all tomcat works, but I have three major problems: 1) It takes a long time until tomcat deploys the app: I deploy it per tomcat manager and it takes about 2 minutes unit the site works (excl. war upload time). 2) The war files are quite big (16MB): I don't know why they are so big. There are no database dependencies and most logic is written in plain java. Okay, we are using jersey, but 16MB are a lot for the logic of a small webservice. 3) I have to restart tomcat all 3 days or so. It looks like a memory leak or something similar. If the app runs for a few days the response time is quite high and the server seems to be frozen. It works again, if I restart tomcat per ssh. You can find my mvn pom file right here. Do you have some tips? Are there good tomcat alternatives?

    Read the article

  • Determining which database instance makes biggest IO

    - by user2008937
    Assuming that I have a dedicated server on which I am running multiple instances of mysql and postresql servers. How without iotop determine which instance in particular time (proc/pid/io shows data collected in some peroid of time) makes the biggest IO (so it increases IOWAIT)? When lots of ppl do something on DB then I clearly see which instance is making the load because of high cpu usage, but I had a situation when the cpu usage was just normal, but very high iowait made a huge load on server and i had problem finding process that was making some outstanding IO

    Read the article

  • Cannot send email to info@ or support@

    - by user3022598
    I am trying to send email from my gmail account to a couple user accounts I have on my new Centos server. The email is setup correctly and I can send receive from accounts ok except info and support. I tried to setup two users "info" and "support" I have a php form that sends out email that works fine for all users except info and support. To test this and make sure that something did not change from yesterday i just created a new user "frank" and tried the submit form and it worked fine. From my gmail account i can email "frank" however i cannot email "info" or "support" The logs I pulled are as follows and i think i see the issue but no idea how to fix it. Aug 15 12:20:55 mail postfix/qmgr[1568]: 1815C20A83: from=, size=1815, nrcpt=1 (queue active) Aug 15 12:20:55 mail postfix/local[2270]: 1815C20A83: to=, relay=local, delay=0.28, delays=0.26/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir) Aug 15 12:17:13 mail postfix/qmgr[1568]: 3C18520A7F: from=, size=1818, nrcpt=1 (queue active) Aug 15 12:17:13 mail postfix/local[2201]: 3C18520A7F: to=, orig_to=, relay=local, delay=0.28, delays=0.25/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir) Aug 15 12:15:24 mail postfix/qmgr[1568]: 2F79420A79: from=, size=1813, nrcpt=1 (queue active) Aug 15 12:15:24 mail postfix/local[2155]: 2F79420A79: to=, orig_to=, relay=local, delay=0.29, delays=0.27/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to maildir) For some reason frank goes out fine, however support and info go to root? Why?

    Read the article

  • Netcat UDP File Transfer Between Two Servers Times Out?

    - by Mark Bowytz
    I'm testing file transfer speeds between two Red Hat servers that are connected to the same switch within the data center and I decided to use netcat to eliminate protocol overhead as much as possible. Testing in TCP mode went well and I was wondering how UDP might fare. On my receiving (client) end, I ran this: nc -u -l 11225 -v > myfile.out And then on the sending (server) end I ran the following: cat myfile.out | nc -u myserver.foo.zzz.com 11225 -v The file I'm testing with is 38 GB but the transfer seems to stop at around 15 GB (one time at 14.9, another at 15.6). I've tested by adding a "-w 5000" just in case it's timing out but no joy. Adding the -v doesn't show anything except acknowledging that the connection occurred. No errors. So - any suggestions as to why would the transfer cease?

    Read the article

  • Xen Vif creation xl vs xm

    - by exaju
    Hi everyone, I switch my server from a xend/xm Xen install to a 4.1 xl Xen install. Therefore Xen does not create vif network interface when I launch xl create /etc/xen/my_server.cfg but does create vif network interface with the command xm create /etc/xen/my_server.cfg Here are sample configuration: nano /etc/xen/xl.conf vifscript="vif-bridge" nano /etc/xen/xend-config.sxp (network-script network-bridge) (vif-script vif-bridge) nano /etc/default/xen TOOLSTACK=xl Any idea ? I'm lost :-( Best Regards.

    Read the article

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