unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
input_ids
list
token_type_ids
list
attention_mask
list
Does the VS2012 SDK Include the VSIX Project Template? === I installed the VS2012 RC SDK but am not seeing a VSIX Project Template when creating a new project. Am I missing something or is that template in a different SDK or something?
0
[ 2, 630, 14, 4611, 3212, 13, 18, 43, 197, 468, 14, 566, 6742, 669, 22894, 60, 800, 3726, 3726, 31, 4066, 14, 4611, 3212, 16462, 13, 18, 43, 197, 47, 589, 52, 2078, 21, 566, 6742, 669, 22894, 76, 2936, 21, 78, 669, 9, 589, 31, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
Auto Executing objective c? === I'm looking to write a program that will work along side with the components of the iphone, however I run into the issue of when someone turns off their iphone the program doesn't restart. You need to manually restart it. How can I make it so when the iphone turns on it auto executes this program? What can I include in my code so this happens?
0
[ 2, 3108, 25836, 7038, 272, 60, 800, 3726, 3726, 31, 22, 79, 699, 20, 2757, 21, 625, 30, 129, 170, 303, 270, 29, 14, 5090, 16, 14, 21024, 15, 207, 31, 485, 77, 14, 1513, 16, 76, 737, 2844, 168, 66, 21024, 14, 625, 1437, 22, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Why StreamWriter dosent work good inside a paint event? Getting big red x in the pictureBox === I have a pictureBox1 paint event. In the paint event im writing to a text file some information: private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { SolidBrush brush; Pen p=null; Point connectionPointStart; Point connectionPointEnd; Graphics g = e.Graphics; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; brush = new SolidBrush(Color.Red); p = new Pen(brush); for (int idx = 0; idx < wireObject1._point_X.Count; ++idx) { Point dPoint = new Point((int)wireObject1._point_X[idx], (int)wireObject1._point_Y[idx]); dPoint.X = dPoint.X - 5; // was - 2 dPoint.Y = dPoint.Y - 5; // was - 2 Rectangle rect = new Rectangle(dPoint, new Size(10, 10)); g.FillEllipse(brush, rect); // g.FillEllipse(brush, rect); } for (int i = 0; i < wireObject1._connectionstart.Count; i++) { int startIndex = wireObject1._connectionstart[i]; int endIndex = wireObject1._connectionend[i]; connectionPointStart = new Point((int)wireObject1._point_X[startIndex], (int)wireObject1._point_Y[startIndex]); connectionPointEnd = new Point((int)wireObject1._point_X[endIndex], (int)wireObject1._point_Y[endIndex]); p.Width = 4; g.DrawLine(p, connectionPointStart, connectionPointEnd); moveCounter++; textBox1.Text = moveCounter.ToString(); if (moveCounter > 10) { w.WriteLine("Number Of Moves ===> " + moveCounter); } } } In the bottom i have a w.WriteLine.... In the top of Form1 i did StreamWriter w; In the constructor i did: w = new StreamWriter(@"d:\test.txt"); In the pictureBox1 mouse up event im doing w.Close(); private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { if (mouseMove == true) { Point NewPoint = e.Location; wireObject1._point_X[(int)selectedIndex] = NewPoint.X; wireObject1._point_Y[(int)selectedIndex] = NewPoint.Y; mouseMove = false; if (moveCounter == 0) { } else { w.Close(); } WireObjectCoordinatesCloneFrame(); } } So i move the mouse its recording writing to the file the information from the variable moveCounter wich is type of int. The problem is when i make the mouse up event and its closing the file in the pictureBox1 i see a BIG RED X with white background. The file it self is ok on the hard disk with all the information as i wanted. But why the big red x is appear in the pictureBox1 ? If i remove the w.WriteLine from the paint event so i dont see the big red x. What can i do to solve it ?
0
[ 2, 483, 3766, 9657, 107, 18, 2291, 170, 254, 572, 21, 5107, 807, 60, 1017, 580, 402, 993, 19, 14, 2151, 5309, 800, 3726, 3726, 31, 57, 21, 2151, 5309, 165, 5107, 807, 9, 19, 14, 5107, 807, 797, 1174, 20, 21, 1854, 3893, 109, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Drupal 7 file permissions === I've been having a problem using views to create thumbnails in drupal 7. Whenever I make (or update) my image styles, the folder which contains them reverts to 0700. Since I'm using suphp in apache, I keep getting 403's when trying to load the images. Is there a configuration that I'm missing so that I can make folders stay 755 and files 644?
0
[ 2, 15708, 6720, 453, 3893, 5572, 18, 800, 3726, 3726, 31, 22, 195, 74, 452, 21, 1448, 568, 4146, 20, 1600, 5078, 325, 947, 18, 19, 15708, 6720, 453, 9, 6634, 31, 233, 13, 5, 248, 11100, 6, 51, 1961, 6443, 15, 14, 19294, 56, 15...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Matplotlib ToolBar Icons disappear when selected in wxPython Panel === I've encountered this behaviour intermittently using the Matplotlib NavigationToolbar2Wx in a Matplotlib Figure canvas in a wx.Frame (or wx.Panel). If the Zoom Icon or Pan Icon are selected the icon disappears however a click in the vacant space still toggles the tool. The Icons for the Home, Backward step or Forward step all behave as expected. Can anyone offer advice on 1. what causes it and 2. how to fix it? Thanks to joaquin for posting the initial code slightly modified to include the toolbar. (http://stackoverflow.com/questions/10737459/embedding-a-matplotlib-figure-inside-a-wxpython-panel) I'm use python 2.6, wxPython 2.9.2.4 osx-carbon (classic) and Matplotlib 1.1.0 Thanks The code below shows the problem: #!/usr/bin/env python # encoding: UTF-8 """ wxPython and Matplotlib Canvas with Matplotlib Toolbar.py """ from numpy import arange, sin, pi import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure import wx class CanvasPanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent) self.figure = Figure() self.axes = self.figure.add_subplot(111) self.canvas = FigureCanvas(self, -1, self.figure) # Add Matplotlib Toolbar # Add the Matplotlib Navigation toolBar here self.toolbar=NavigationToolbar2Wx(self.canvas) self.toolbar.AddLabelTool(5,'',wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, (32,32))) #self.Bind(wx.EVT_TOOL, self.NewTitle(), id=5) self.toolbar.Realize() # Add to Box Sizer self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.TOP | wx.GROW) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.SetSizer(self.sizer) self.Fit() def draw(self): t = arange(0.0, 3.0, 0.01) s = sin(2 * pi * t) self.axes.plot(t, s) if __name__ == "__main__": app = wx.PySimpleApp() fr = wx.Frame(None, title='test',size=(800,600)) panel = CanvasPanel(fr) panel.draw() fr.Show() app.MainLoop()
0
[ 2, 4277, 13221, 38, 8326, 5607, 1850, 9801, 18, 10866, 76, 1704, 19, 619, 396, 6448, 11570, 4113, 800, 3726, 3726, 31, 22, 195, 8208, 48, 7727, 19667, 102, 568, 14, 4277, 13221, 38, 8326, 8368, 20799, 1850, 135, 499, 396, 19, 21, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
ORA 00932: expected NUMBER got BLOB error when trying to view table content === I wrote a `servlet` program to upload an image to Oracle table. I am using Oracle 10g version. I created the table using `create table insertimage( image BLOB);` The table created successfully. My `servlet` shows image uploaded successfully. Even when I delete using `delete from insertimage;` it shows successful row deletion. But when I try to see the table content using `select * from insertimage;` it gives me ` ORA-00932: inconsistent datatypes: expected NUMBER got BLOB` error. So how can I check if the image has been successfully uploaded or not directly in the Oracle table?
0
[ 2, 54, 58, 713, 2545, 3125, 45, 1727, 234, 330, 334, 10904, 7019, 76, 749, 20, 1418, 859, 2331, 800, 3726, 3726, 31, 738, 21, 13, 1, 10321, 1336, 1, 625, 20, 71, 8294, 40, 1961, 20, 15759, 859, 9, 31, 589, 568, 15759, 332, 263...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
jQuery UI Slider with control buttons? === I'm trying to add control buttons on to the jQuery UI slider but can't get it to work. Can anyone see what im doing wrong here: $(function() { var gmin = 1; var gmax = 500; $( "#slider" ).slider({ value:5, min: gmin, max: gmax, step: 1, slide: function( event, ui ) { $( "#donate_amount_label span" ).html( "£" + ui.value ); } }); $( "#donate_amount_label span" ).html( "£" + $( "#slider" ).slider( "value" ) ); $( "#" ).val( $( "#slider" ).slider( "value" ) ); $('#down').click(function() { var s = $("#slider"); s.slider('value', s.slider('value') + s.slider( "step" ) ); }); }); The slider works fine and the values get updated but when you click the #down link nothing happens to the scrollbar. I would like it to move up one step when the #down link is clicked. Thanks Pete
0
[ 2, 487, 8190, 93, 13, 5661, 3295, 106, 29, 569, 12861, 60, 800, 3726, 3726, 31, 22, 79, 749, 20, 3547, 569, 12861, 27, 20, 14, 487, 8190, 93, 13, 5661, 3295, 106, 47, 92, 22, 38, 164, 32, 20, 170, 9, 92, 1276, 196, 98, 797, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Gmap3 applying a new center postion without destroying the whole map === I am hacking around with gmap3 managing to get the first task working. Showing the map using a lat long. My javascript look likes $('#map_canvas').gmap3( { action: 'init', options: { center: [x,y], zoom: 12, mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControlOptions: { mapTypeIds: [] } } }, { action: 'addMarkers', radius: 100, markers: GetMarkers(), clusters: { 0: { content: '<div class="cluster cluster-3">CLUSTER_COUNT <div class="cluster-3text">Stops</div> </div>', width: 66, height: 65 } }, marker: { options: { icon: new google.maps.MarkerImage('../img/marker.png', size, origin, null, null) }, events: { mouseover: function (marker, event, data) { getArrivalsAndStop(marker, event, data); }, mouseout: function () { $(this).gmap3({ action: 'clear', name: 'overlay' }); } } } }); This loads the map how I want. My next step is to be able apply a new lat & long. How can I do this without destroying the whole map and recreating it everytime?
0
[ 2, 489, 15022, 240, 11989, 21, 78, 459, 678, 872, 366, 10498, 14, 979, 2942, 800, 3726, 3726, 31, 589, 25787, 140, 29, 489, 15022, 240, 5616, 20, 164, 14, 64, 3005, 638, 9, 3187, 14, 2942, 568, 21, 14303, 175, 9, 51, 8247, 8741,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to insert datetime property from asp.net c# to a date column in sql server? === I have got a problem using the calender control ..i am getting the date in a textbox...and i have to insert this into database ..using asp.net with c# in my webapplication the field property is set to datetime and in the table the field is date.. how can i do this?? and the error i am getting is: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. Could anyone help me in this regard? Thanks in advance
0
[ 2, 184, 20, 14692, 1231, 891, 1354, 37, 28, 306, 9, 2328, 272, 5910, 20, 21, 1231, 4698, 19, 4444, 255, 8128, 60, 800, 3726, 3726, 31, 57, 330, 21, 1448, 568, 14, 1658, 21607, 569, 13, 9, 9, 49, 589, 1017, 14, 1231, 19, 21, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Query string not working inside paging enabled grid view . === I am trying to pass RegionProjectID column of my grid from query string when ever a user will click on the RegionProjectName field on the grid. I had made RegionProjectname as hyperlink and below you can find the Code also. But this is not working . Please suggest me or help that why it is not working. The pagin is also enabled in my grid view. <asp:GridView ID="ResultGridView" runat="server" AutoGenerateColumns="False" ShowFooter="true" DataKeyNames="RegionProjectID" AllowPaging="True" CellPadding="3" OnPageIndexChanging="ResultGridView_PageIndexChanging" OnRowDeleting="ResultGridView_RowDeleting" CssClass="mGrid" OnRowEditing="ResultGridView_RowEditing" OnRowUpdating="ResultGridView_RowUpdating" OnRowCancelingEdit="ResultGridView_RowCancelingEdit" PageSize="15" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellSpacing="2" OnRowCommand="ResultGridView_RowCommand" > <Columns> <asp:BoundField DataField="RegionProjectID" HeaderText="Region ID" InsertVisible="False" ReadOnly="True" SortExpression="RegionProjectID" Visible="false" /> <asp:TemplateField HeaderText="Region Name" SortExpression="RegionProjectName"> <EditItemTemplate> <asp:TextBox ID="txtRegion" Width="250px" runat="server" Text='<%# Bind("RegionProjectName") %>'></asp:TextBox> </EditItemTemplate> <FooterTemplate> <asp:TextBox ID="txtRegion1" runat="server" Width="250px"></asp:TextBox> </FooterTemplate> <ItemTemplate> <asp:LinkButton ID="LinkButton3" CommandName="Details" CommandArgument='<%# Eval("RegionProjectID") %>' Text='<%# Bind("RegionProjectName") %>' runat="server" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Edit" ShowHeader="False"> <EditItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton> <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton> </EditItemTemplate> <FooterTemplate> <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="AddNew" Text="Add New"></asp:LinkButton> </FooterTemplate> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton> </ItemTemplate> </asp:TemplateField> <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" ShowHeader="True" /> <%-- <asp:CommandField HeaderText="Select" ShowSelectButton="True" ShowHeader="True"/> --%> </Columns> <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" /> <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" /> <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" /> <%--<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />--%> <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" /> </asp:GridView>` protected void ResultGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Details") { Server.Transfer("Default3.aspx?ID=" + e.CommandArgument.ToString()); } if (e.CommandName.Equals("AddNew")) { TextBox txtRegion1 = (TextBox)ResultGridView.FooterRow.FindControl("txtRegion1"); TextBox txtNatureOFWork1 = (TextBox)ResultGridView.FooterRow.FindControl("txtNatureOFWork1"); if (txtRegion1.Text != "") { cmd.Connection = conn; cmd.CommandText = "INSERT INTO RegionAndProjectInfo(RegionProjectName, NatureOFWorkID ) Values('" + txtRegion1.Text + "', '" + ddlnatureOfWork.SelectedValue.ToString() + "')"; conn.Open(); cmd.ExecuteNonQuery(); } FillVendorGrid(); conn.Close(); } }
0
[ 2, 25597, 3724, 52, 638, 572, 19006, 68, 9338, 7354, 1418, 13, 9, 800, 3726, 3726, 31, 589, 749, 20, 1477, 632, 21011, 1340, 4698, 16, 51, 7354, 37, 25597, 3724, 76, 462, 21, 4155, 129, 10840, 27, 14, 632, 21011, 7259, 575, 27, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to create log file using log4j in struts2+hibernate application? === I am using Struts2,hibernate web application. On that file i used following dependency for log4j in pom.xml <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.9</version> </dependency> In my Actionclass i used the following code to write log file: public class loginAction extends action{ static Logger log = Logger.getLogger(com.rewardz.action.LoginAction.class); public String checklogin(){ log.debug("Debug Message(LOGIN)!"); log.info("Info Message(LOGIN)!"); log.warn("Warn Message(LOGIN)!"); log.error("Error Message(LOGIN)!"); log.fatal("Fatal Message(LOGIN)!"); //my coding for checking logged status. } } I have placed log4j.properties file under WEB-INF/classes folder with the following code, log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.File=C\:\\logfile.log log4j.appender.file.MaxFileSize=10MB log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n # Root logger option log4j.rootLogger=debug, file When i run and deploy this application on server the property file is placed in correct path. but after running statement in action class nothing get affect from log4j.properties file. I dont know where i did wrong. So anyone please help me to find this issue. Thanks in Advance.
0
[ 2, 184, 20, 1600, 6738, 3893, 568, 6738, 300, 728, 19, 18316, 18, 21812, 8630, 106, 8820, 3010, 60, 800, 3726, 3726, 31, 589, 568, 18316, 18, 135, 15, 8630, 106, 8820, 2741, 3010, 9, 27, 30, 3893, 31, 147, 249, 26835, 26, 6738, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Serving image's data string over HTTPS while URLs on HTTP === I am attempting to read an image file, as a base64 encoded string and output a data string when the connection uses HTTPS/SSL, and otherwise put out the URL in the IMG src attribute if it is only on HTTP. Here is my current code, however it does not work. <?php function base64_encode_image($filename, $filetype) { if (($_SERVER["HTTPS"] == "on") && $filename) { $imgbinary = fread(fopen($filename, "r"), filesize($filename)); return "data:image/$filetype;base64," . base64_encode($imgbinary); } else { return $filename; } } ?> <img src="<?php echo base64_encode_image('/home/content/61/9295861/html/resource/image/logo-96x72.png', 'png'); ?>" width="96" height="72" />
0
[ 2, 1799, 1961, 22, 18, 1054, 3724, 84, 7775, 18, 133, 13, 911, 7532, 27, 7775, 800, 3726, 3726, 31, 589, 6314, 20, 1302, 40, 1961, 3893, 15, 28, 21, 1000, 3470, 13665, 3724, 17, 5196, 21, 1054, 3724, 76, 14, 2760, 2027, 7775, 18...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
calling cuda API === i want to call this cuda API---->NVGetHWEncodeCaps. this is my code but it has error,can anyone help me? #include "cuda_runtime.h" #include "device_launch_parameters.h" #include <NVEncodeDataTypes.h> #include <NVEncoderAPI.h> int main() { HRESULT hr = NVGetHWEncodeCaps(); if (FAILED(hr)) { printf("failed"+hr); } else printf("ok"+hr); getch(); return 0; } ______________________________________________________ error: error LNK2019: unresolved external symbol NVGetHWEncodeCaps referenced in function main error LNK2019: unresolved external symbol __cudaUnregisterFatBinary referenced in function "void __cdecl __cudaUnregisterBinaryUtil(void)" (?__cudaUnregisterBinaryUtil@@YAXXZ) error LNK2019: unresolved external symbol __cudaRegisterFatBinary referenced in function "void __cdecl __sti____cudaRegisterAll_52_tmpxft_000000f8_00000000_8_sample_compute_20_cpp1_ii_main(void)" (?__sti____cudaRegisterAll_52_tmpxft_000000f8_00000000_8_sample_compute_20_cpp1_ii_main@@YAXXZ) ___________________________ NVGetHWEncodeCaps Description: Query if the GPU supports the NVIDIA CUDA Video encoder Syntax: HRESULT __stdcall NVGetHWEncodeCaps(void) Parameter: None Return Value: S_OK: CUDA based encoding is supported E_FAIL: No CUDA capability present Remarks: None
0
[ 2, 2555, 272, 5729, 21, 2159, 800, 3726, 3726, 31, 259, 20, 645, 48, 272, 5729, 21, 2159, 8, 8, 8, 8, 1, 20763, 834, 96, 5036, 9375, 4666, 18, 9, 48, 25, 51, 1797, 47, 32, 63, 7019, 15, 1245, 1276, 448, 55, 60, 6926, 22640, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
UISegmentedControl event does not work properly === I am currently working with a UISegmentedControl with 2 selections here. I have already defined it in -(void)viewDidLoad: > _segmentSelector = [[UISegmentedControl alloc] initWithItems:_selectorItems]; > _segmentSelector.frame = CGRectMake(40, 356, 200, 43); > _segmentSelector.segmentedControlStyle = UISegmentedControlStyleBezeled; > _segmentSelector.selectedSegmentIndex = 0; [_segmentSelector addTarget:self action:@selector(selectorValueChanged) > forControlEvents:UIControlEventValueChanged]; The action for @selector(selectorValueChanged) is as following: > - (void)selectorValueChanged > { > if(_segmentSelector.selectedSegmentIndex=1) > { > } > if(_segmentSelector.selectedSegmentIndex=0) > { > > } > } My problem is, that when i run a simulation and clicked on one button, then attempted to click another button, the SegmentedControl does not respond. It stays on the selection and refuses to accept another tap/click/whatever action i ordered it to. What is wrong with it?
0
[ 2, 13, 5661, 28857, 69, 12898, 807, 630, 52, 170, 7428, 800, 3726, 3726, 31, 589, 871, 638, 29, 21, 13, 5661, 28857, 69, 12898, 29, 172, 3155, 18, 235, 9, 31, 57, 614, 2811, 32, 19, 13, 8, 5, 2625, 1340, 6, 4725, 3052, 8294, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
how to pick a image from gallery (SD Card) for my app in android 3.0 and 3.1? === i having the problem to open image form the android (sdcard)gallery by coding but this coding is working proper in android 2.2 & 2.3 os version this issues is only related to android 3.0 & 3.1.
1
[ 2, 184, 20, 2036, 21, 1961, 37, 2246, 13, 5, 18, 43, 2056, 6, 26, 51, 4865, 19, 13005, 203, 9, 387, 17, 203, 9, 165, 60, 800, 3726, 3726, 31, 452, 14, 1448, 20, 368, 1961, 505, 14, 13005, 13, 5, 18, 43, 6648, 6, 14074, 384...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Algorithm to spread apart labels on a graph for better visualization === Basically, I want to make this graph look prettier. You can see there are areas of extreme overdraw. I could certainly abbreviate the names manually and shrink the font size, but I'd like some algorithm that pushes apart labels in overdrawn areas so their text is more readable. I think this must be a well studied problem, I just don't know what it's called. Already implemented solutions in Python would be great, but I'll settle for descriptions of techniques that tend to work in practice. ![Dominion projected card names][1] [1]: http://i.stack.imgur.com/PVBiE.png
0
[ 2, 9083, 20, 1789, 2629, 13173, 27, 21, 7210, 26, 574, 28873, 800, 3726, 3726, 11374, 15, 31, 259, 20, 233, 48, 7210, 361, 782, 38, 5259, 9, 42, 92, 196, 80, 50, 924, 16, 4750, 84, 43, 12404, 9, 31, 110, 3850, 21, 3490, 14587,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
There's no main.xml in /res/layout === I've started reading "Building your first app" in developer.android.com.<br> When they start creating different UI, they refer you to /res/layout/main.xml file. But I can't find it - under /res/layout There's only activity_first.xml file ( My activity' s name is FirstActivity ). I've read that it might be because of API16, but I get the same problem with API15. Any ideas? Thanks! :)
0
[ 2, 80, 22, 18, 90, 407, 9, 396, 8184, 19, 13, 118, 99, 18, 118, 4414, 1320, 800, 3726, 3726, 31, 22, 195, 373, 1876, 13, 7, 11783, 154, 64, 4865, 7, 19, 10058, 9, 290, 18524, 9, 960, 9, 1, 5145, 1, 76, 59, 799, 2936, 421, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
NSLog shows the error "expression result unused" and not working. iphone? === i am simply trying to NSLog something on xcode and it gives the error "Expression result unused" , i cant print anything using NSLog. actually i changed the Build configuration in edit scheme to Debug. i dont know what is actually the error? need some help
0
[ 2, 13, 2172, 5567, 1285, 14, 7019, 13, 7, 28993, 829, 18927, 7, 17, 52, 638, 9, 21024, 60, 800, 3726, 3726, 31, 589, 1659, 749, 20, 13, 2172, 5567, 301, 27, 993, 9375, 17, 32, 2352, 14, 7019, 13, 7, 28993, 829, 18927, 7, 13, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is there any limit to add object in NSMutableArray..? === Recently I'm working on project which requires a large no. of object should be added to an NSMutableArray. I'm little bit confusing how much object we can add in **NSMutableArray**..? Thanks in advance.
0
[ 2, 25, 80, 186, 4496, 20, 3547, 3095, 19, 13, 2172, 7903, 579, 8576, 93, 9, 9, 60, 800, 3726, 3726, 1989, 31, 22, 79, 638, 27, 669, 56, 4781, 21, 370, 90, 9, 16, 3095, 378, 44, 905, 20, 40, 13, 2172, 7903, 579, 8576, 93, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
calling Raphael custom library === I have worked on creating certain gauge using Raphael by scripting within the html page. But now i want to call it using js script. I am not sure how to do that. But what i was trying is failing. Below is what i have done. xhtml ============== <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <script language="javascript" type="text/javascript" src="raphael-min.js"></script> <!-- Raphael 1.5.2 - JavaScript Vector Library --> <script language="javascript" type="text/javascript" src="vmgauge.js"></script> <!-- vmGauge JavaScript. --> </h:head> <h:body onload="ready();"> <h:form> <div id="jGaugeDemo" ></div> </h:form> </h:body> <script type="text/javascript"> var myGauge = new vmGauge('jGaugeDemo'); function ready(){ // Create a new jGauge. myGauge.init(); // Put the jGauge on the page by initialising it. // myGauge.setValue(7.35); }; </script> </html> vmgauge.js ============= vmGauge = funtion(id) { alert("id"); this.id=id; this.minAngle=-225; this.maxAngle=45; this.width=200; this.height=200; this.suffix='%'; this.prefix=''; this.imagePath='img/jgauge_face_taco.png'; var needleDefault={ imagePath:'img/jgauge_needle_taco.png', width:'', height:'' } function needle() { var needle=this; needle.width=this.width; needle.height=this.height; } this.needle= new needle(); } vmGauge.prototype.init = function() { this.root = document.getElementById(this.id); alert("got the doc"); this.paper = Raphael(this.id,this.width,this.height); this.paper.image("img/jgauge_face_taco.png",0,0,paper.width,paper.height); } Below is the error i am getting from Google Chrome console Uncaught ReferenceError: id is not defined vmgauge.js:1 (anonymous function) vmgauge.js:1 Uncaught ReferenceError: vmGauge is not defined vmgauage.xhtml:35 (anonymous function) vmgauage.xhtml:35
0
[ 2, 2555, 13874, 5816, 1248, 800, 3726, 3726, 31, 57, 577, 27, 2936, 1200, 7313, 568, 13874, 34, 3884, 68, 363, 14, 13, 15895, 2478, 9, 47, 130, 31, 259, 20, 645, 32, 568, 487, 18, 3884, 9, 31, 589, 52, 562, 184, 20, 107, 30, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
preg_replace( ) for two or more continuous Double Quotes? === For the strings like: ""abc""" It should be: "abc" But my attempt is failing by using: preg_replace('/[\"]+/','"',$input); I don't know :(
0
[ 2, 782, 263, 1, 99, 5119, 5, 13, 6, 26, 81, 54, 91, 6357, 1494, 18901, 60, 800, 3726, 3726, 26, 14, 7887, 101, 45, 13, 7, 7, 21880, 7, 7, 7, 32, 378, 44, 45, 13, 7, 21880, 7, 47, 51, 1735, 25, 7250, 34, 568, 45, 782, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Exception: Protocol error: Unknown transport === I installed SignalR using nuget and created a very basic hub. Then I registered my hubs in global.asax. But I get this exception when I navigate to the url of my hub. I use ASP.NET MVC 2 and Telerik MVC Extensions. This is my Global.asax public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("elmah.axd"); routes.IgnoreRoute("favicon.ico"); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); } protected void Application_Start() { RouteTable.Routes.MapHubs("~/flatwhitehubs"); AreaRegistration.RegisterAllAreas(); //RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); Application[ApplicationRepository.Current.StockLockObject] = new object(); Application["InvoiceGeneratorLock"] = new object(); } and this is my hub: [HubName("FlatwhiteHub")] public class FlatwhiteHub : Hub, IConnected, IDisconnect { public Task JoinGroup(string groupName) { return Groups.Add(Context.ConnectionId, groupName); } public Task Connect() { throw new NotImplementedException(); } public Task Reconnect(IEnumerable<string> groups) { throw new NotImplementedException(); } public Task Disconnect() { throw new NotImplementedException(); } }
0
[ 2, 5391, 45, 8494, 7019, 45, 2562, 1739, 800, 3726, 3726, 31, 4066, 2800, 139, 568, 3152, 3060, 17, 679, 21, 253, 2125, 5814, 9, 94, 31, 3801, 51, 5814, 18, 19, 2062, 9, 8588, 396, 9, 47, 31, 164, 48, 5391, 76, 31, 20782, 20, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
MYSQL with SUM results and GROUP BY === I've got this query and I want to SUM all the results of the query grouped by the column omschrijving. The query SELECT b.BoekRegelBedrag as total, c.omschrijving, ctl.vd1, b.BoekRegelId FROM condensations as c LEFT JOIN condensations_to_ledgers as ctl ON ctl.vd1 = c.code LEFT JOIN BoekstukRegels as b ON b.BoekRegelGrootboekNr = ctl.GrootboekNummer LEFT JOIN GrootboekRekeningen as g ON g.GrootboekNummer = ctl.GrootboekNummer WHERE c.bedrijf_id = 118 AND b.BoekregelUserId = 118 AND ctl.bedrijf_id = 118 AND g.GrootboekUserId = 118 AND c.code < 10 AND g.BaSoort = 2 AND b.BoekRegelPeriode BETWEEN 201000 AND 201013 GROUP BY b.BoekRegelId Is there a simple way to do this? Thanks in advance!
0
[ 2, 51, 18, 22402, 29, 3907, 1736, 17, 214, 34, 800, 3726, 3726, 31, 22, 195, 330, 48, 25597, 17, 31, 259, 20, 3907, 65, 14, 1736, 16, 14, 25597, 19511, 34, 14, 4698, 13, 2636, 2992, 16504, 8397, 9, 14, 25597, 5407, 334, 9, 119...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Querying across multiple Solr Instances, allowing for failure === We are looking at building multiple Solr indexes, which will be dotted in different data centres and each will have the same Schema, but different data. We currently have a prototype of it working across 2 sites, and are adding more over the next few days... but if I kill the Solr instance on one of the boxes, and use the other with the shards option, adding that second box, I get a 500 Error message telling me the connection on the other machine is refused... What I am wondering is how do I get it to fail gracefully? Can I add something that, when one (or more) Solr indexes are MIA, I can tell users? Is this something built into Solr, or will I need to code around this problem?
0
[ 2, 25597, 68, 464, 1886, 7176, 139, 13946, 15, 2719, 26, 2990, 800, 3726, 3726, 95, 50, 699, 35, 353, 1886, 7176, 139, 4348, 160, 15, 56, 129, 44, 23696, 19, 421, 1054, 10548, 17, 206, 129, 57, 14, 205, 23874, 15, 47, 421, 1054,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Compare and Merge Array === I am trying to Compare and merge arrays in php. Lets say i have two arrays as follows $topCountries1 = array( array( 'India', '23', '34', '11'), array( 'USA', '13', '24', '21'), array( 'Japan', '13', '24', '21')); $topCountries2 = array( array( 'France', '23', '34', '11'), array( 'India', '13', '24', '21'), array( 'Japan', '13', '24', '21')); I want to merge the above two arrays so that i will have unique set of values for the countries and if there are duplicate countries in the array it should add the values of the other three fields and combine it. Trying out the following code - but i am confused with the logic. $topCountries = array_merge($topCountries1, $topCountries2); $collect = array(); foreach ($topCountries as $tc) { echo $count = count($collect); if ($count > 0) { foreach ($collect as $c) { if ($c[0] == $tc[0]) { echo "match<br/>"; $collect[] = $tc; } else { $collect[] = $tc; echo "no match<br/>"; } } } else { $collect[] = $tc; } echo "<br/>"; }
0
[ 2, 11590, 17, 12666, 7718, 800, 3726, 3726, 31, 589, 749, 20, 11590, 17, 12666, 7718, 18, 19, 13, 26120, 9, 6884, 395, 31, 57, 81, 7718, 18, 28, 2415, 5579, 3880, 16549, 2829, 165, 800, 7718, 5, 7718, 5, 13, 22, 15357, 22, 15, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Need to create an event handler that can remove itself when the event occurs === I'm not really sure how to do this, as I've never had a need for this pattern just yet. I'm looking for the correct pattern on creating an event handler in a separate class that can remove itself when the object that contains the event executes. Basically, I want to create an `EventHandler` that occurs on the WPF `Window.Close` event. And, during the execution of the handler it removes itself from the `Window.Close` event. I hope that's specific enough to go on. Also, is there a specific name for this pattern?
0
[ 2, 376, 20, 1600, 40, 807, 24641, 30, 92, 4681, 1145, 76, 14, 807, 3690, 800, 3726, 3726, 31, 22, 79, 52, 510, 562, 184, 20, 107, 48, 15, 28, 31, 22, 195, 243, 41, 21, 376, 26, 48, 3732, 114, 768, 9, 31, 22, 79, 699, 26, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Variable inside sql querry, to avoid multiple computations === How to avoid multiple calculations I have this in a stored procedure(IBM DB2) UPDATE my_table SET field1 = my_func(fieldx, 1, 2), field2 = my_func(fieldx, 1, 2) * fieldy WHERE my_key = AND another_field < 0; How can i avoid duplicate call to that function my_func ? Thanks
0
[ 2, 7612, 572, 4444, 255, 13, 8190, 622, 15, 20, 2658, 1886, 21683, 18, 800, 3726, 3726, 184, 20, 2658, 1886, 19186, 31, 57, 48, 19, 21, 8214, 7004, 5, 4598, 79, 13, 9007, 135, 6, 11100, 51, 1, 5924, 309, 575, 165, 800, 51, 1, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
MSMQ How best to handle classes when using binary encoding === I'm new here, so please be gentle. This question revolves around VB.net / VS2010 / MSMQ 4.0 I'm developing an application that has MSMQ at its heart. There are (currently) 3 separate VB solutions each of which send and receive message to a queue. I tried using the XMLformatter and ran into problems with that, plus this is a high performance, time critical app and I understand that XMLFormatter has a high overhead, so I've switched over to using Binaryformatter for the messages. I've established a class (clsTMessage) which provides the structure for the message data and resides in its own .vb file attached to the solution. I realize that the downside of using Binaryformatter is that the exact same class (down to version and all) has to encode and decode the messages and indeed I'm seeing that problem. So I figured, no problem, I'd just copy clsTmessage.vb to each solution, but that doesn't quite do the trick as the messages encodes with the namespace of the host assemby and therefore the next solution to pick up the message is technically looking for a different class to decode it. In this example, for instance, you can see that TelemanusWorkbench Version 1.0.0.0 encoded the message using TelemanusWorkbench.clsTMessage. 00 01 00 00 00 FF FF FF .....ÿÿÿ FF 01 00 00 00 00 00 00 ÿ....... 00 0C 02 00 00 00 49 54 ......IT 65 6C 65 6D 61 6E 75 73 elemanus 57 6F 72 6B 62 65 6E 63 Workbenc 68 2C 20 56 65 72 73 69 h, Versi 6F 6E 3D 31 2E 30 2E 30 on=1.0.0 2E 30 2C 20 43 75 6C 74 .0, Cult 75 72 65 3D 6E 65 75 74 ure=neut 72 61 6C 2C 20 50 75 62 ral, Pub 6C 69 63 4B 65 79 54 6F licKeyTo 6B 65 6E 3D 6E 75 6C 6C ken=null 05 01 00 00 00 1E 54 65 ......Te 6C 65 6D 61 6E 75 73 57 lemanusW 6F 72 6B 62 65 6E 63 68 orkbench 2E 63 6C 73 54 4D 65 73 .clsTMes 73 61 67 65 09 00 00 00 sage.... 0E 6E 65 77 4D 65 73 73 .newMess 61 67 65 54 79 70 65 12 ageType. 6E 65 77 50 72 6F 74 6F newProto 63 6F 6C 56 65 72 73 69 colVersi 6F 6E 0D 6E 65 77 49 64 on.newId 65 6E 74 69 66 69 65 72 entifier 0B 6E 65 77 53 6F 75 72 .newSour 63 65 49 50 0D 6E 65 77 ceIP.new 53 6F 75 72 63 65 50 6F SourcePo 72 74 10 6E 65 77 44 65 rt.newDe 73 74 69 6E 61 74 69 6F stinatio 6E 49 50 12 6E 65 77 44 nIP.newD 65 73 74 69 6E 61 74 69 estinati 6F 6E 50 6F 72 74 0C 6E onPort.n 65 77 54 69 6D 65 73 74 ewTimest 61 6D 70 0E 6E 65 77 4D amp.newM 65 73 73 61 67 65 42 6F essageBo 64 79 01 01 01 01 01 01 dy...... 01 00 01 0D 02 00 00 00 ........ 06 03 00 00 00 03 44 46 ......DF 58 06 04 00 00 00 01 30 X......0 06 05 00 00 00 0C 30 30 ......00 30 30 30 30 30 30 30 30 00000000 30 30 06 06 00 00 00 07 00...... 30 2E 30 2E 30 2E 30 06 0.0.0.0. 07 00 00 00 01 30 06 08 .....0.. 00 00 00 0B 31 39 32 2E ....192. 31 36 38 2E 31 2E 31 06 168.1.1. 09 00 00 00 04 35 30 30 .....500 30 20 46 FE 12 F9 32 CF 0 Fþ.ù2Ï 88 06 0A 00 00 00 49 70 .....Ip 2C 31 2C 31 32 33 34 35 ,1,12345 36 37 38 39 30 31 32 33 67890123 34 35 36 37 38 39 2C 31 456789,1 32 33 34 35 36 37 38 39 23456789 30 31 32 33 34 35 2C 31 012345,1 2C 69 6E 74 65 72 6E 65 ,interne 74 2C 75 73 65 72 6E 61 t,userna 6D 65 2C 70 61 73 73 77 me,passw 6F 72 64 2C 30 2C 33 30 ord,0,30 0B . Given that it's generically a bad idea to have multiple copies of the class in different parts of the app, what's the reccomended way to do this ? I've read what MSDN has to say bout this, but it's very thin on how to actually implement it. Hope I've explained that well enought, if not please ask for more info. Duncan
0
[ 2, 4235, 79, 1251, 184, 246, 20, 3053, 2684, 76, 568, 14171, 19608, 800, 3726, 3726, 31, 22, 79, 78, 235, 15, 86, 2247, 44, 5654, 9, 48, 1301, 21719, 140, 13, 20468, 9, 2328, 13, 118, 4611, 2751, 13, 118, 4235, 79, 1251, 268, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to load Struts2 MessageResources.properties file into non-action classes === How to load Struts2 MessageResources.properties into other non-action class. Basically the requirement is i have a Quartz scheduler servlet and a job class within a struts2 webapplication. I want to get the properties of MessageResource.properties into this servlet/job class. But i am unable to read the file.
0
[ 2, 184, 20, 6305, 18316, 18, 135, 2802, 99, 12097, 18, 9, 10890, 106, 3915, 3893, 77, 538, 8, 8645, 2684, 800, 3726, 3726, 184, 20, 6305, 18316, 18, 135, 2802, 99, 12097, 18, 9, 10890, 106, 3915, 77, 89, 538, 8, 8645, 718, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
open or create files with assembly code === I'm trying to write a code in **assembly** language for accessing the specific file for example open,close or create a file. please tell me what codes can i write to do that.
1
[ 2, 368, 54, 1600, 6488, 29, 1475, 1797, 800, 3726, 3726, 31, 22, 79, 749, 20, 2757, 21, 1797, 19, 13, 1409, 29432, 1409, 816, 26, 1381, 68, 14, 1903, 3893, 26, 823, 368, 15, 14330, 54, 1600, 21, 3893, 9, 2247, 494, 55, 98, 113...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
How to Pass windows full title name with space using Pywinauto in python === I wanted to automate Adobe Reader menus, from pywinauto import application app = application.Application() app.start_(r"C:\Program Files (x86)\Adobe\Reader 9.0\Reader\AcroRd32.exe") so after how to get complete windows title "Adobe Reader" & navigate to File menus
0
[ 2, 184, 20, 1477, 1936, 503, 581, 204, 29, 726, 568, 7103, 4181, 18042, 19, 20059, 800, 3726, 3726, 31, 417, 20, 3108, 5281, 20299, 7765, 11379, 18, 15, 37, 7103, 4181, 18042, 9010, 3010, 4865, 800, 3010, 9, 2552, 20669, 5, 6, 486...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Hibernate Native Query Result list Datatype mismatch === I am trying to get run a native query to get a resultset in hibernate. I am able to get List<Object[]> from the query. Query nativeQuery = manager.createNativeQuery("select name, country_cd from fresher"); List<Object[]> amount = nativeQuery.getResultList() for(Object[] e : amount) { for(Object n : e) { if(n != null) System.out.print(n + " \t " + n.getClass()); } } The expected Result is : Joe, US The Result of this is like : class java.lang.String -- > Joe class java.lang.Character -- > U In the database, **name** (VARCHAR2(100)) and **country_cd** (CHAR(2 BYTE)) are defined in table fresher. As per [hibernate database types][1], the char(2byte) is taken as java.lang.Character How can I retrieve the data of type char(2b) as String ? Note : I cannot use a result class/entity since the results could be dynamic. [1]: http://docs.jboss.org/hibernate/orm/4.0/devguide/en-US/html/ch08.html
0
[ 2, 4148, 2102, 8820, 1275, 25597, 829, 968, 1054, 4474, 2462, 12280, 800, 3726, 3726, 31, 589, 749, 20, 164, 485, 21, 1275, 25597, 20, 164, 21, 1736, 1198, 19, 4148, 2102, 8820, 9, 31, 589, 777, 20, 164, 968, 1, 23793, 2558, 500, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to write variables to file in VIM === I need to write some settings and variables into some text file for later retrieval. Retrieving the file can be a simple source command. So what is the simplest way write the file from a vimscript?
0
[ 2, 184, 20, 2757, 12157, 20, 3893, 19, 1790, 79, 800, 3726, 3726, 31, 376, 20, 2757, 109, 12410, 17, 12157, 77, 109, 1854, 3893, 26, 138, 28419, 9, 13, 6239, 3272, 8397, 14, 3893, 92, 44, 21, 1935, 1267, 1202, 9, 86, 98, 25, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
how to display each (only one) search result each on an individual page mysql php === Hi i have a table called 'BookPage' with column: 'PageText' i have set up a search on the column 'PageText' (see code below). now when the user does a search for a keyword, all the result pages are displayed one below the other. Is there a way if i could display each pagetext on its individual pages by clicking some sort of 'Next' button link they move to the next page. **form.php** <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Search</title> <link href="default.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <?php // include MySQL-processing classes require_once 'mysql.php'; try{ // connect to MySQL $db=new MySQL(array('host'=>'','user'=>'','password'=>'','database'=>'')); $searchterm=$db->escapeString($_GET['searchterm']); $result=$db->query("SELECT * FROM BookPage WHERE (PageText) like \"%$searchterm%\" "); if(!$result->countRows()){ echo '<div class="maincontainer"><h2>No results were found. Go back and try a new search.</h2></div>'."n"; } else{ // display search results echo '<div class="maincontainer"><h2>Your search criteria returned '.$result->countRows().' results.</h2>'."n"; while($row=$result->fetchRow()){ echo '<div class="rowcontainer"><p><strong>Book Id: </strong>'.$row['BookId'].'<p><p><strong>Page Id: </strong>'.$row['PageId'].'</p><p><strong>Page Text: </strong>'.$row['PageText'].'</p></div>'."n"; } } echo '</div>'; } catch(Exception $e){ echo $e->getMessage(); exit(); } ?> </body> </html>
0
[ 2, 184, 20, 3042, 206, 13, 5, 4965, 53, 6, 2122, 829, 206, 27, 40, 1359, 2478, 51, 18, 22402, 13, 26120, 800, 3726, 3726, 4148, 31, 57, 21, 859, 227, 13, 22, 5199, 6486, 22, 29, 4698, 45, 13, 22, 6486, 11969, 22, 31, 57, 309...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Custom ToolTip in User Control === I'm using a custom tool tip style defined in my App.xaml (without a x:key) <Style TargetType="ToolTip"> <Setter Property="Foreground" Value="White" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ToolTip"> <Grid Background="#001f5b"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="OpenStates"> <VisualState x:Name="Opened"/> </VisualStateGroup> </VisualStateManager.VisualStateGroups> <ContentPresenter Margin="5"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> but want to use another style in a UserControl. The problem is that if I define a style in the UserControl, it doesn't override the style from App.xaml (which works for a ScrollBar for example), nor does it work if a style isn't present in App.xaml in the first place.
0
[ 2, 5816, 5607, 10169, 19, 4155, 569, 800, 3726, 3726, 31, 22, 79, 568, 21, 5816, 5607, 4265, 1034, 2811, 19, 51, 4865, 9, 6791, 8184, 13, 5, 14506, 21, 993, 45, 4237, 6, 13, 1, 4381, 2935, 4474, 3726, 7, 20799, 10169, 7, 1, 13...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Joomla and K2 - populate extra field with options from database === We're using Joomla! and K2. Is it possible to 'extend' a K2 extra field, to present an admin user with a drop-down populated with items from the database? The ID of the selected item would be stored against the extra field. This seems like something that should be easy to achieve, but I haven't unearthed much information on extending K2. Thanks, Toby
0
[ 2, 2640, 2636, 531, 17, 680, 135, 13, 8, 1675, 12383, 2230, 575, 29, 6368, 37, 6018, 800, 3726, 3726, 95, 22, 99, 568, 2640, 2636, 531, 187, 17, 680, 135, 9, 25, 32, 938, 20, 13, 22, 1706, 1316, 43, 22, 21, 680, 135, 2230, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Helper functions in Kiwi specs === I have a few repetitive specs that I would like to DRY up. The common functionality doesn't lend itself to moving into a `beforeEach` block. Essentially, it's object creation and is 4 lines for each of 12 objects, I'd like to turn those 4 lines into a single function call. Where can I put helper functions in a Kiwi spec? In RSpec I can just put `def` between spec blocks, but that doesn't appear to be possible here. I've even tried skipping the `SPEC_END` macro and adding that content myself so I could add functions inside the @implementation from `SPEC_BEGIN` but that doesn't seem to work, either. **Correction**... I can manage something that kind of works with hand-coding the `SPEC_END` macro. I had the end } mis-placed. But still, it fails, because the method isn't in the `@interface`.
0
[ 2, 448, 106, 3719, 19, 26993, 12737, 18, 800, 3726, 3726, 31, 57, 21, 310, 24935, 12737, 18, 30, 31, 83, 101, 20, 2273, 71, 9, 14, 757, 18548, 1437, 22, 38, 13866, 1145, 20, 1219, 77, 21, 13, 1, 12750, 14322, 1, 1921, 9, 7398,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
SASS / SCSS @extend rule selectors === I'm having a little problem with the @extend rule, this is what I got (focus on the h1): .content-header { // CSS properties h1 { // CSS properties } } .box-header { // CSS properties h1 { @extend .content-header h1; // My selector problem! // And his own CSS properties } } So it will be: .content-header h1, .box-header h1 { /* Happily sharing the same CSS properties */ } But it seems like @extend don't like that, is any other way to write this without giving the h1 a class??
0
[ 2, 9233, 18, 13, 118, 4729, 18, 18, 13, 1, 1706, 1316, 43, 1828, 23946, 18, 800, 3726, 3726, 31, 22, 79, 452, 21, 265, 1448, 29, 14, 13, 1, 1706, 1316, 43, 1828, 15, 48, 25, 98, 31, 330, 13, 5, 23371, 27, 14, 746, 165, 6, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Installed Perl modules not available === On CentOS 6.2, perl v5.10.1 and I cannot install XML::SAX::Expat. Using "cpan XML::SAX::Expat" a lot of the earlier problems I solved (there were a lot more errors when I first tried to installl XML::Simple) came from missing binaries required by the cpan config (in my case: unzip, make, lynx, patch, gcc, ftp). Since this is the only module failing to install (all other prerequisites are already installed), I am under the impression that I already installed all the OS requirements (via yum). **Am I correct to assume this?** BTW, the histfile doesnt get created. **Which permissions should i apply to /root/.cpan/ ?** **What should I try next? Is it ok to force install?** All tests successful. Files=13, Tests=486, 12 wallclock secs ( 0.07 usr 0.01 sys + 1.84 cusr 0.07 csys = 1.99 CPU) Result: PASS GRANTM/XML-Simple-2.20.tar.gz Tests succeeded but one dependency not OK (XML::SAX::Expat) GRANTM/XML-Simple-2.20.tar.gz [dependencies] -- NA Running make install make test had returned bad status, won't install without force Failed during this command: TODDR/XML-Parser-2.41.tar.gz : make NO BJOERN/XML-SAX-Expat-0.40.tar.gz : make_test NO GRANTM/XML-Simple-2.20.tar.gz : make_test NO one dependency not OK (XML::SAX::Expat)
0
[ 2, 4066, 416, 255, 17113, 52, 904, 800, 3726, 3726, 27, 5802, 759, 400, 9, 135, 15, 416, 255, 566, 264, 9, 1036, 9, 165, 17, 31, 1967, 16146, 23504, 45, 45, 18, 7522, 45, 45, 6899, 721, 9, 568, 13, 7, 150, 3206, 23504, 45, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Doctrine 2.1 - Relation Lost After ManyToMany Cascade Merge === After merging an entity that has related entities with relations set to cascade both persist and merge the relations are lost! Here are the entities: class Event implements NormalizableInterface { /** * @ORM\ManyToMany(targetEntity="Participant", inversedBy="events", cascade={"persist", "merge"}) * @ORM\JoinTable(name="event_participant", * joinColumns={@ORM\JoinColumn(name="event_id", referencedColumnName="id", onDelete="CASCADE")}, * inverseJoinColumns={@ORM\JoinColumn(name="participant_id", referencedColumnName="id", onDelete="CASCADE")} * ) */ private $participants; } class Participant implements NormalizableInterface { /** * @ORM\ManyToMany(targetEntity="Event", mappedBy="participants", cascade={"persist", "merge"}) */ protected $events; } Here are my joins: foreach ($events as $event) { if (!$event->hasParticipant($participant)) { $event->addParticipant($participant); } if (!$participant->hasEvent($event)) { $participant->addEvent($event); } } Here is my merge code: echo "Before merge participant count: ".count($event->getParticipants()).PHP_EOL; $event = $em->merge($event); echo "After merge participant count: ".count($event->getParticipants()).PHP_EOL; ...and here is the output: Before merge participant count: 2 After merge participant count: 0 Can anyone see where I'm being dumb? BTW there are more relationships than this. I've simplified things here to make the explanation clearer. My other relations aren't affected negatively by the merge. Also I'm doing the merge in a console Command not a in a controller. I can post more code if it'll help :) Also I'm using Doctrine 2.1.7 and Symfony 2.1.15 Many thanks, Matthew
0
[ 2, 7521, 172, 9, 165, 13, 8, 5827, 529, 75, 151, 262, 14842, 13542, 12666, 800, 3726, 3726, 75, 18842, 40, 9252, 30, 63, 1597, 12549, 29, 2649, 309, 20, 13542, 156, 22084, 17, 12666, 14, 2649, 50, 529, 187, 235, 50, 14, 12549, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Make a div or list element select/trigger a radio input button on click with jQuery? === I'm not sure if this possible but probably is fairly simple. I've made a fiddle [http://jsfiddle.net/WTSWP/1/][1] or the kind of situation I'm in. I've got multiple radio inputs, each contained by a div/li, and what the containing element to select the radio button when clicked. I'm using jQuery to so if anyone has ideas using jquery that would be great thanks. <br /> I started this but isn't working right. $(".select-area").click(function() { $(this).find('input').trigger('click'); }); <br /> <li class="select-area"> <input type="radio" name="colour" value="black"> </li> <br /> ![enter image description here][2] <br /> Fiddle here [http://jsfiddle.net/WTSWP/1/][1] [1]: http://jsfiddle.net/WTSWP/1/ [2]: http://i.stack.imgur.com/Yo0eb.png
0
[ 2, 233, 21, 13, 12916, 54, 968, 4520, 5407, 118, 3367, 11356, 21, 603, 6367, 5167, 27, 10840, 29, 487, 8190, 93, 60, 800, 3726, 3726, 31, 22, 79, 52, 562, 100, 48, 938, 47, 910, 25, 6647, 1935, 9, 31, 22, 195, 117, 21, 12759, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to write OOP JS and use jQuery at the same time === Usually (if not always), when jQuery allows you to add a callback to some JS event like click, in the callback function they change the "meaning" of `this` into the DOM element which triggered the event. This can be quite useful, but it will stand in your way when you write OOP code in js, like in [this jsFiddle example][1]. In this example, `this.test()` will not work, because `this` is not anymore an instance on `MyClass` but instead a jQuery DOM element (the span). My questions are: is there a way to continue writing OOP code in JS using this pattern and also use jQuery? And: why is jQuery changing `this` in the callback function when it could as easily send the jQuery DOM element as first argument ? [1]: http://jsfiddle.net/p4Ban/
0
[ 2, 184, 20, 2757, 13, 21709, 487, 18, 17, 275, 487, 8190, 93, 35, 14, 205, 85, 800, 3726, 3726, 951, 13, 5, 821, 52, 550, 6, 15, 76, 487, 8190, 93, 2965, 42, 20, 3547, 21, 645, 1958, 20, 109, 487, 18, 807, 101, 10840, 15, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Java Tomcat LDAP authentication === Since I'm running Java with Tomcat6 as servlet container I found it appropriate to use the [Tomcat JNDIRealm feature](http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JNDIRealm) so that LDAP users can log into my site without any additional efforts. The LDAP server I'm using is [OpenLDAP on Ubuntu](https://help.ubuntu.com/community/OpenLDAPServer). On top of this I have the login page using [form-based authentication](http://www.avajava.com/tutorials/lessons/how-do-i-use-basic-authentication-with-tomcat.html) over an [https connection](http://www.avajava.com/tutorials/lessons/how-do-i-set-up-ssl-on-tomcat.html). I found two very good examples of authentication users via LDAP, [here](http://www.jspwiki.org/wiki/WebContainerAuthenticationViaLDAP) and [here](http://blog.mc-thias.org/?title=tomcat_ldap_authentication&more=1&c=1&tb=1&pb=1), that both achieve what I feel I almost achieved. Why *almost* achieved? When I attempt to login with the wrong credentials I'm appropriately sent to the `<form-error-page>`, `login-failed.html` in my case. When my credentials are good and I authenticate successfully I start getting a **403 for all urls** in the site. And I cannot remove the 403 error (not even for the login page!) unless I restart Tomcat. I suspect the reason is because I don't have `roles` in the realm or other config files set up correctly. For the sake of brevity I put the relevant config files excerpts on [pastebin](http://pastebin.com/): - [Realm in Tomcat `server.xml`](http://pastebin.com/35nNzSaS) - [Relevant `tomcat-users.xml` part](http://pastebin.com/0MYGitp8) - [Relevant `web.xml` part](http://pastebin.com/1h6W197b) Note that Tomcat-based auth works perfectly since the role is easily attached to the user in the `tomcat-users.xml`. Therefore I believe it's a problem in getting the role for an authenticated user from LDAP once it has been successfully been authenticated. **TL/DR** I have a config issue in connecting Tomcat to LDAP auth. User data fetched properly, but not the user's role. LDAP log messages available on request ;)
0
[ 2, 8247, 2067, 5782, 644, 20472, 27963, 800, 3726, 3726, 179, 31, 22, 79, 946, 8247, 29, 2067, 5782, 379, 28, 13, 10321, 1336, 12147, 31, 216, 32, 4593, 20, 275, 14, 636, 6015, 5782, 487, 9805, 7467, 79, 1580, 500, 5, 21127, 6903,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
jQuery: Can't get submit() to work === When ever I try submitting the form I either get an <error> or if i type it manually in my console i get this error: RangeError: Maximum call stack size exceeded Here's my code: <script type="text/javascript"> $(document).ready(function() { $('#contact').on('submit', function(event) { event.preventDefault(); var valid = 1; var name = $('input[name$="name"]'); var email = $('input[name$="email"]') var phone = $('input[name$="phone"]'); var comment = $('input[name$="comment"]'); if (!name.val() && valid == 1) { valid = 0; alert('Please fill out the Name field'); name.focus(); } if (!email.val() && valid == 1) { valid = 0; alert('Please fill out the E-mail Address field'); email.focus(); } if (!phone.val() && valid == 1) { valid = 0; alert('Please fill out the Phone field'); phone.focus(); } if (valid == 1) { $('#contact').submit(); } }) }); </script>
0
[ 2, 487, 8190, 93, 45, 92, 22, 38, 164, 12298, 5, 6, 20, 170, 800, 3726, 3726, 76, 462, 31, 1131, 28848, 14, 505, 31, 694, 164, 40, 13, 1, 29992, 1, 54, 100, 31, 1001, 32, 23671, 19, 51, 8650, 31, 164, 48, 7019, 45, 978, 29...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
can not read the whole image in numpy array === Following the last question: http://stackoverflow.com/questions/11571216/read-16-bit-or-32-bit-images-in-python I still do not know why I can not read the whole tif image in. I used Image library to load image and converted to numpy array. Then, I changed the negative values to 0 and exported as a new tif file. I found that the two images of original image and new image are similar, but the new image only read about 2/3 image in. The following codes show the above process and the first row of image. Except this image, I also tried other images (16 and 32 bit float, 8 bit is correct) , but they also showed the similar situation. Do I make some mistakes? Any suggestion? import Image import numpy as num im=Image.open('srtm.tif') imarray=num.array(im) imarray arr[arr < 0] = 0 arr[0] array([ 0., 0., 400., 400., 402., 402., 408., 408., 408., 416., 416., 426., 426., 426., 437., 437., 450., 450., 462., 462., 462., 470., 470., 477., 477., 477., 481., 481., 477., 477., 477., 467., 467., 465., 465., 465., 472., 472., 483., 483., 483., 498., 498., 505., 505., 505., 507., 507., 507., 507., 507., 508., 508., 517., 517., 526., 526., 526., 528., 528., 526., 526., 526., 535., 535., 537., 537., 537., 548., 548., 543., 543., 543., 539., 539., 541., 541., 541., 551., 551., 558., 558., 558., 558., 558., 549., 549., 533., 533., 533., 515., 515., 503., 503., 503., 494., 494., 481., 481., 481., 468., 468., 459., 459., 459., 451., 451., 446., 446., 446., 434., 434., 426., 426., 426., 422., 422., 421., 421., 419., 419., 419., 410., 410., 398., 398., 398., 390., 390., 384., 384., 384., 369., 369., 354., 354., 354., 355., 355., 358., 358., 358., 360., 360., 359., 359., 359., 360., 360., 367., 367., 371., 371., 371., 381., 381., 390., 390., 390., 399., 399., 404., 404., 404., 412., 412., 418., 418., 418., 422., 422., 426., 426., 426., 436., 436., 448., 448., 448., 464., 464., 480., 480., 491., 491., 491., 498., 498., 493., 493., 493., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)
0
[ 2, 92, 52, 1302, 14, 979, 1961, 19, 13, 6336, 6448, 7718, 800, 3726, 3726, 249, 14, 236, 1301, 45, 7775, 6903, 25325, 2549, 9990, 9, 960, 118, 24652, 18, 11698, 13187, 12586, 12626, 10647, 8, 1091, 8, 3326, 8, 248, 8, 3125, 8, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Redirecting obsolete categories and child products via 301 redirects === Good Afternoon! *I've used StackOverflow over the years, the quality of posts have been outstanding* I am currently (merging) moving categories around, child products will cease to exist. As we have quite a few products it makes sense to redirect all products under the parent category. **Example URL:** http://www.domain.com/chandeliers/modern-chandeliers/* (Where '*' = Child products/urls) **Redirect URL:** http://www.domain.com/chandeliers/ **Currently Displayed as:** RewriteCond %{HTTP_HOST} ^.*$ RewriteRule ^chandeliers\/modern-chandeliers\/$ "http\:\/\/www\.domain\.com\/chandeliers\/" [R=301,L]
0
[ 2, 302, 14706, 68, 18562, 6422, 17, 850, 1985, 1197, 13, 18979, 302, 14706, 18, 800, 3726, 3726, 254, 3435, 187, 1637, 49, 22, 195, 147, 7566, 2549, 9990, 84, 14, 122, 15, 14, 2190, 16, 9868, 57, 74, 4012, 2483, 31, 589, 871, 13...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
how to save an object using .net webapi === I've create WebAPI in .net (my first). Using this api to get object from db, query db etc is easy for me. Nothing new But I'm wondering how to save an object using this webapi ? I have a clinet application (tablet, phone, PC) that communicates with my webapi. From my application there is an possibility to save a user news. Now I need to save it in db. I use Azure SQL. Now how can I pass this object to API so I can save it ? For my application I use C#/XAML For my WebAPI I use .NET I'm tring with this code: HttpClient httpClient = new HttpClient(); String u = this.apiUrl + "sd/Localization/insert"; Uri uri = new Uri(u); HttpRequestMessage httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, uri); But I don't know how to send object ? Should I serialize it ? If yes how to send it via post.
0
[ 2, 184, 20, 2079, 40, 3095, 568, 13, 9, 2328, 95, 969, 2159, 800, 3726, 3726, 31, 22, 195, 1600, 95, 969, 2159, 19, 13, 9, 2328, 13, 5, 915, 64, 6, 9, 568, 48, 21, 2159, 20, 164, 3095, 37, 13, 9007, 15, 25597, 13, 9007, 27...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Using Rbind() to create a data.frame with coefficients from nested models? === I think I'm on to a good idea, but don't know how to implement it. I am currently running a number of nested models. For example: y<-c(1, 0, 1, 1, 1, 1, 1, 1, 0) x1<-c(1, 0, 9, 9, 1, 9, 2, 1, 0) x2<-c(1, 2, 3, 5, 4, 2, 4, 5, 1) x3<-c(1, 2, 1, 4, 1, 3, 4, 8, 3) model1 <-lm(y~x1) model2 <-lm(y~x1+x2) model3 <-lm(y~x1+x2+x3) model1_output<-(summary(model1 )$coefficients[1]) model2_output<-(summary(model1 )$coefficients[1]) model3_output<-(summary(model1 )$coefficients[1]) I would then like to put all of my output in a data table that matches along the rows (variable names) but inserts the new coefficients in their own columns. I'd like the data.frame presenting the output from my example as: b(Model 1) b(Model 2) b(Model 3) (Intercept) 0.59217 0.2555 0.27983 x1 0.05220 0.04116 0.0375 x2 NA 0.12530 0.15142 x3 NA NA -0.02994 I'm sure there must be some smart way to do this using the plyr() package (or some other package!), but can't seem to figure it out. Thanks!
0
[ 2, 568, 13, 9002, 706, 5, 6, 20, 1600, 21, 1054, 9, 8361, 29, 14612, 18, 37, 5618, 69, 2761, 60, 800, 3726, 3726, 31, 277, 31, 22, 79, 27, 20, 21, 254, 882, 15, 47, 221, 22, 38, 143, 184, 20, 8713, 32, 9, 31, 589, 871, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
viewing .cxx files in Doxygen documentation along with .h files === I'm trying to create Doxygen documentation for a C++ code package. When viewing the HTML documentation generated, I can view the header files for the package but cannot view the .cxx files, although the .cxx files are being detected by Doxygen. Could you advise me on how I would be able to include the .cxx files for viewing in the HTML documentation? Preemptive thanks
0
[ 2, 11244, 13, 9, 150, 8962, 6488, 19, 107, 15161, 1863, 13945, 303, 29, 13, 9, 252, 6488, 800, 3726, 3726, 31, 22, 79, 749, 20, 1600, 107, 15161, 1863, 13945, 26, 21, 272, 20512, 1797, 6030, 9, 76, 11244, 14, 13, 15895, 13945, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Gnuplot Draw vertical from a file === I have a file VERTICAL.txt with the following structure : 201 269 614 669 705 with a script traffic.gp : set terminal jpeg size 1024,768 set title "traffic path 0" set xlabel "Simulation duration" set ylabel "Link load (%)" set grid set xtics 0,50,1100 set ytics 0.0,10.0,100.0 set key below center plot [0:1100] [0.0:100.0] 'traffic_path0.txt' with lines title "path 0" i want to use VERTICAL.txt in traffic.gp to see the corresponding line. I tried to add: set parametrics set trange [0:100] plot VERTICAL.txt , t but the following error occurs :`"scripts/traffic.gp", line 11: parametric function not fully specified` How can i managed to do that ? Thanks a lot
0
[ 2, 26092, 13221, 38, 2003, 7035, 37, 21, 3893, 800, 3726, 3726, 31, 57, 21, 3893, 7035, 9, 38, 396, 38, 29, 14, 249, 1411, 13, 45, 13, 18421, 13, 24764, 400, 1419, 400, 3680, 3201, 264, 29, 21, 3884, 2227, 9, 13321, 13, 45, 30...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Creating a cookie to control Jquery toggled content === I would like to add a cookie that controls whether my collapsible content is shown or hidden. The default when the site loads is shown. I have tried and failed to implement cookies thus far so the raw code is shown below. <script type="text/javascript"> $(document).ready(function(){ $(".toggle_parent").toggle(function(){ $(".toggled_content").slideUp(); $("img.upmid").attr('src',"images/downmid.png"); },function(){ $(".toggled_content").slideDown(); $("img.upmid").attr('src',"images/upmid.png"); }); }); </script>
0
[ 2, 2936, 21, 19980, 20, 569, 487, 8190, 93, 20, 4572, 1294, 2331, 800, 3726, 3726, 31, 83, 101, 20, 3547, 21, 19980, 30, 8671, 1472, 51, 9470, 2552, 18, 3426, 2331, 25, 1721, 54, 3689, 9, 14, 12838, 76, 14, 689, 19069, 25, 1721,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Css And Different Browsers Issues === I am writing my first Blog using Html&Css, Php And MySql. While writing the "style.css" code I searched the web for any usefull tutorials and in every one I read: there was the same notes about Internet Explorer And Mac, such as: /* IE5 Mac Hack \*/ /*/ #main-nav { padding-left: 11px; overflow: hidden; } /* End Hack */ So I read some articles about IE issues with Css, and found great websites describing it like: http://www.webcredible.co.uk/user-friendly-resources/css/internet-explorer.shtml But, Even after reading so many articles\ websites, Im still a begginer who didnt totally understand how can I make sure that my Blog works on EVERY browser (such as IE5\6\7, chrome\ firefox\ mozilla\ opera .. etc.) ?! Is there a common Browser\Css issues that I have to cover (take care of) ? Thanks in advance.
0
[ 2, 272, 18, 18, 17, 421, 16495, 18, 1549, 800, 3726, 3726, 31, 589, 1174, 51, 64, 8146, 568, 13, 15895, 1569, 6824, 18, 15, 13, 26120, 17, 51, 18, 22402, 9, 133, 1174, 14, 13, 7, 4381, 9, 6824, 18, 7, 1797, 31, 9036, 14, 274...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Call knife commands from a Ruby script without shelling out === I've inherited some shell scripts that are helpful for setting up our application environment using Chef and knife. That's nice. But what I'd really like to do is have the power and flexibility of a Ruby script to do the same thing. If I shell out to `knife` I lose the real time output of the command. It seems like I should be able to call all of knife's functionality from within Ruby by including the 'chef' gem and maybe the 'cloudstack-fog' plug-in I use. But I haven't found any examples or API documentation. Trying to dig through the chef gem source is an exercise in frustration. Shouldn't I be able to do the equivalent of a `knife cloudstack server create -E ...` etc. from a Ruby script?
0
[ 2, 645, 4026, 14294, 37, 21, 10811, 3884, 366, 3593, 68, 70, 800, 3726, 3726, 31, 22, 195, 7179, 109, 3593, 17505, 30, 50, 15600, 26, 2697, 71, 318, 3010, 2307, 568, 8915, 17, 4026, 9, 30, 22, 18, 2210, 9, 47, 98, 31, 22, 43, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to add the generic error handling in Web.config === I need to have a generic error handling code integrated in the web.config. How should I do that?
0
[ 2, 184, 20, 3547, 14, 12733, 7019, 7988, 19, 2741, 9, 14093, 2816, 800, 3726, 3726, 31, 376, 20, 57, 21, 12733, 7019, 7988, 1797, 5547, 19, 14, 2741, 9, 14093, 2816, 9, 184, 378, 31, 107, 30, 60, 3, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Last n weekdays in sql where clausel === We are using MySQL as our database to store messages with timestamps. Is it possible to create a query that returns messages of the last n weekdays? I.e. if n is 4 and today is Tuesday, I want messages from this weeks Monday, last weeks Friday, last weeks Thursday and last weeks Wednesday .
0
[ 2, 236, 13, 103, 13411, 18, 19, 4444, 255, 113, 9040, 255, 800, 3726, 3726, 95, 50, 568, 51, 18, 22402, 28, 318, 6018, 20, 1718, 7561, 29, 436, 4919, 1919, 9, 25, 32, 938, 20, 1600, 21, 25597, 30, 4815, 7561, 16, 14, 236, 13, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
OutOfMemory Exception Occurs in Android App === I have a problem that I am receiving data from JSON response, there are many images in data also. There are large amount of data as more than 100. Therefore it returns OutOfmemory exception when I try to load it in LazyAdapter or when try to call method as NotifydatasetChanged of LazyAdapter. Please suggest any solution regarding the same. **Code:** final ProgressDialog dialog = ProgressDialog.show( ResearchList.this, "Research List ", "Please wait... ", true); final Handler handler = new Handler() { public void handleMessage(Message msg) { // System.out.println("The id after Save:"+id.get(0).toString()); // catagory.addAll(keyword_vector1); linear_Category_Child.setVisibility(View.GONE); linear_Category_Child_Child.setVisibility(View.VISIBLE); //tv_Child_Header.setText("Volvo"); tv_CategoryChildHeader.setText(from); setHeaderImage(tv_CategoryChildHeader.getText().toString()); if(coll.getDisplayNames().size()!=0) { adapter = new CategoryListLazyAdapter( ResearchList.this); lvCategory.setAdapter(adapter); Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory); } else { /*lvCategory.invalidate(); lvCategory.setAdapter(null);*/ AlertDialog.Builder builder = new Builder(ResearchList.this); builder.setTitle("Attention!"); builder.setMessage("No Data Available for the Particular Search."); builder.setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub } }); builder.create().show(); } /*Utility util = new Utility(); util.setListViewHeightBasedOnChildren(lvCategory);*/ dialog.dismiss(); } }; final Thread checkUpdate = new Thread() { public void run() { try { String sortEncode = URLEncoder.encode("mpg"); String filterEncode = URLEncoder.encode(filter); String clientEncode = URLEncoder.encode("10030812"); String fromEncode = URLEncoder.encode(from); String toEncode = URLEncoder.encode(to); String catUrl = "/v1/vehicles/get-make-models.json?sort=" + sortEncode + "&filter=" + filterEncode + "&client-id=" + clientEncode + "&from=" + fromEncode; genSig = new GetSignature(catUrl, "acura"); try { signature = genSig.getUrlFromString(); } catch (InvalidKeyException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (NoSuchAlgorithmException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // jsonString = // getJsonSring("http://api.highgearmedia.com/v1/vehicles/get-models.json?make=acura&client-id=10030812&signature=LWQbdAlJVxlXZ1VO2mfqAA=="); // String signatureEncode = // URLEncoder.encode(signature); String urlEncode = URLEncoder.encode(catUrl + "&signature=" + signature); jsonString = getJsonSring("http://apibeta.highgearmedia.com" + catUrl + "&signature=" + signature); System.out.println("The json category:===>" + jsonString); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } JsonParse json = new JsonParse(jsonString); json.parseCat(); LIST_SIZE = coll.getDisplayNames().size(); for (int i = 0; i <= BATCH_SIZE; i++) { // countriesSub.add(COUNTRIES[i]); countriesSubCat.add(coll.getDisplayNames().get(i)); imagesSubCat.add(coll.getImages().get(i)); YearSubCat1.add(coll.getYears().get(i)); YearSubCat2.add(coll.getYears().get(i + 1)); mpgSubCat1.add(coll.getMpg().get(i)); mpgSubCat2.add(coll.getMpg().get(i + 1)); priceSubCat1.add(coll.getPrice().get(i)); priceSubCat2.add(coll.getPrice().get(i + 1)); ratingSubCat1.add(coll.getRating().get(i)); ratingSubCat2.add(coll.getRating().get(i + 1)); } setLastOffset(BATCH_SIZE); handler.sendEmptyMessage(0); } }; checkUpdate.start(); **GetJSonString Method(Error Place):** public String getJsonSring(String api_url) throws URISyntaxException, ClientProtocolException, IOException { try { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(); URL url = new URL(api_url); URI uri = new URI(url.getProtocol(), url.getHost(), url.getPath(), url.getQuery(), null); request.setURI(uri); HttpResponse response = client.execute(request); InputStream ips = response.getEntity().getContent(); BufferedReader buf = new BufferedReader(new InputStreamReader(ips, "UTF-8")); StringBuilder sb = new StringBuilder(); String s; while (true) { s = buf.readLine(); if (s == null || s.length() == 0) break; sb.append(s); } buf.close(); ips.close(); return sb.toString(); } finally { // any cleanup code... } }
0
[ 2, 70, 1041, 790, 5171, 93, 5391, 3690, 19, 13005, 4865, 800, 3726, 3726, 31, 57, 21, 1448, 30, 31, 589, 3396, 1054, 37, 487, 528, 1627, 15, 80, 50, 151, 3502, 19, 1054, 67, 9, 80, 50, 370, 2006, 16, 1054, 28, 91, 119, 808, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
JavaFX and FXML. When are the references to components loaded into the controller class? === I have a very simple fxml file, with a checkbox: ... <AnchorPane id="AnchorPane" xmlns:fx="http://javafx.com/fxml" fx:controller="jfx01.T01"> ... <CheckBox fx:id="checkBox1" text="CheckBox" /> ... the very simple controller class is the following: public class T01 extends Application { @FXML protected CheckBox checkBox1; @Override public void start(Stage primaryStage) throws IOException { Parent root = FXMLLoader.load(getClass().getResource("t01.fxml")); primaryStage.setScene(new Scene(root)); primaryStage.show(); //here, here is the problem! System.out.println("checkBox1==null? "+ (checkBox1==null?"yes":"no")); } } <h3>The output of this basic app is:</h3> checkBox1==null? yes Inside the "start" method the components are obviously created, but not yet assigned to @FXML fields of the controller class. As a test that there aren't other errors, i've added a button and an event. There the checkBox1 IS assigned! @FXML protected void handleButton1Action(ActionEvent event) { System.out.println("button pressed"); checkBox1.setSelected(!checkBox1.isSelected()); } <h3>Question</h3> If I can't use start method because init is not yet complete, what is the first method available where the init is complete and so the components are available?
0
[ 2, 8247, 16488, 17, 13, 16488, 8184, 9, 76, 50, 14, 7231, 20, 5090, 8572, 77, 14, 9919, 718, 60, 800, 3726, 3726, 31, 57, 21, 253, 1935, 13, 16488, 8184, 3893, 15, 29, 21, 2631, 5309, 45, 13, 9, 9, 9, 13, 1, 210, 11840, 1666...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
PDF Button That Links To Website === Does anyone know how (or if it is even possible) to create a button on an html page that, when that webpage is saved as a PDF, the button is still functional? I am trying to have this button link to a webpage so that in the PDF, the user can click on the button to go to a link.
0
[ 2, 13, 11124, 5167, 30, 6271, 20, 2271, 800, 3726, 3726, 630, 1276, 143, 184, 13, 5, 248, 100, 32, 25, 166, 938, 6, 20, 1600, 21, 5167, 27, 40, 13, 15895, 2478, 30, 15, 76, 30, 2741, 6486, 25, 4377, 28, 21, 13, 11124, 15, 14...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to duplicate javascript scroller on the same page? === I'm using this scroller on an html page: http://www.dynamicdrive.com/dynamicindex2/translucentscroll.htm I already have this scroller functioning on the page, but I'd like to have another scroller on the same page with duplicate content. I tried copying and pasting the code, but nothing comes up with the 2nd scroller. How can I do this? <script language="JavaScript1.2"> //Translucent scroller- By Dynamic Drive //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com //This credit MUST stay intact for use var scroller_width='150px' var scroller_height='115px' var bgcolor='#E0EFD1' var pause=3000 //SET PAUSE BETWEEN SLIDE (3000=3 seconds) var scrollercontent=new Array() //Define scroller contents. Extend or contract array as needed scrollercontent[0]='Visit our partner site <a href="http://freewarejava.com">Freewarejava.com </a>for free Java applets!' scrollercontent[1]='Got JavaScript? <a href="http://www.javascriptkit.com">JavaScript Kit</a> is the most comprehensive JavaScript site online.' scrollercontent[2]='Link to Dynamic Drive on your site. Please visit our <a href="http://www.dynamicdrive.com/link.htm">links page</a>.' ////NO need to edit beyond here///////////// var ie4=document.all var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1 if (ie4||dom) document.write('<div style="position:relative;width:'+scroller_width+';height:'+scroller_height+';overflow:hidden"><div id="canvas0" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div><div id="canvas1" style="position:absolute;background-color:'+bgcolor+';width:'+scroller_width+';height:'+scroller_height+';top:'+scroller_height+';filter:alpha(opacity=20);-moz-opacity:0.2;"></div></div>') else if (document.layers){ document.write('<ilayer id=tickernsmain visibility=hide width='+scroller_width+' height='+scroller_height+' bgColor='+bgcolor+'><layer id=tickernssub width='+scroller_width+' height='+scroller_height+' left=0 top=0>'+scrollercontent[0]+'</layer></ilayer>') } var curpos=scroller_height*(1) var degree=10 var curcanvas="canvas0" var curindex=0 var nextindex=1 function moveslide(){ if (curpos>0){ curpos=Math.max(curpos-degree,0) tempobj.style.top=curpos+"px" } else{ clearInterval(dropslide) if (crossobj.filters) crossobj.filters.alpha.opacity=100 else if (crossobj.style.MozOpacity) crossobj.style.MozOpacity=1 nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1" tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas) tempobj.innerHTML=scrollercontent[curindex] nextindex=(nextindex<scrollercontent.length-1)? nextindex+1 : 0 setTimeout("rotateslide()",pause) } } function rotateslide(){ if (ie4||dom){ resetit(curcanvas) crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas) crossobj.style.zIndex++ if (crossobj.filters) document.all.canvas0.filters.alpha.opacity=document.all.canvas1.filters.alpha.opacity=20 else if (crossobj.style.MozOpacity) document.getElementById("canvas0").style.MozOpacity=document.getElementById("canvas1").style.MozOpacity=0.2 var temp='setInterval("moveslide()",50)' dropslide=eval(temp) curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0" } else if (document.layers){ crossobj.document.write(scrollercontent[curindex]) crossobj.document.close() } curindex=(curindex<scrollercontent.length-1)? curindex+1 : 0 } function resetit(what){ curpos=parseInt(scroller_height)*(1) var crossobj=ie4? eval("document.all."+what) : document.getElementById(what) crossobj.style.top=curpos+"px" } function startit(){ crossobj=ie4? eval("document.all."+curcanvas) : dom? document.getElementById(curcanvas) : document.tickernsmain.document.tickernssub if (ie4||dom){ crossobj.innerHTML=scrollercontent[curindex] rotateslide() } else{ document.tickernsmain.visibility='show' curindex++ setInterval("rotateslide()",pause) } } if (ie4||dom||document.layers) window.onload=startit </script>
0
[ 2, 184, 20, 19429, 8247, 8741, 12159, 106, 27, 14, 205, 2478, 60, 800, 3726, 3726, 31, 22, 79, 568, 48, 12159, 106, 27, 40, 13, 15895, 2478, 45, 7775, 6903, 6483, 9, 20985, 14573, 9, 960, 118, 20985, 25671, 9298, 7028, 2377, 5089,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
SSIS Flat-file source - Text was truncated or one or more characters had no match in the target code page === I'm trying to import records into an SQL database file from a comma-delimited flat file and I get a "Text was truncated or one or more characters had no match in the target code page." when the source file has more than 50 characters in a particular field. The Destination file target for that field is 1000 characters, so that shouldn't be an issue. I narrowed it down to "A123456789B123456789C123456789D123456789E123456789" in the text file did import while "A123456789B123456789C123456789D123456789E123456789F" threw the error. How can I get it to allow more characters before truncating?
0
[ 2, 13, 18, 4557, 1844, 8, 16877, 1267, 13, 8, 1854, 23, 22328, 69, 54, 53, 54, 91, 1766, 41, 90, 730, 19, 14, 2935, 1797, 2478, 800, 3726, 3726, 31, 22, 79, 749, 20, 9010, 742, 77, 40, 4444, 255, 6018, 3893, 37, 21, 11951, 5...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Applet JTextArea fit to window === I have an applet which loads a text file into a JTextArea. I would like this JTextArea to auto-fit to the browser window and then scroll to view the text file. When I try this, however, the file loads right-aligned and extends off the page without scroll bars. Any ideas on what I can do? Thanks public class View extends Applet{ JTextArea file = new JTextArea(); JScrollPane outputScroll = new JScrollPane(); public void init( ) { try{ outputScroll.setViewportView(file); String filePath = getParameter("file"); FileReader reader = new FileReader( filePath ); BufferedReader br = new BufferedReader(reader); file.read( br, null ); br.close(); add(file); add(outputScroll); }catch(Exception e){ e.printStackTrace(); } }
0
[ 2, 4037, 38, 487, 11969, 17760, 2742, 20, 1463, 800, 3726, 3726, 31, 57, 40, 4037, 38, 56, 19069, 21, 1854, 3893, 77, 21, 487, 11969, 17760, 9, 31, 83, 101, 48, 487, 11969, 17760, 20, 3108, 8, 11765, 20, 14, 16495, 1463, 17, 94,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Using the output of .tellg() to know the position in the file. === I have a downloaded C++ utility program that dies due to an error while reading an input file. Unfortunately all that it outputs is that "error at offset: 69570744324 in file"; by looking at it's source code, I found that it was actually printing out the .tellg() output there. I don't quite understand how one can use this offset information constructively to understand the error in the input file. I would greatly appreciate any help.
0
[ 2, 568, 14, 5196, 16, 13, 9, 4213, 263, 5, 6, 20, 143, 14, 649, 19, 14, 3893, 9, 800, 3726, 3726, 31, 57, 21, 23887, 272, 20512, 10082, 625, 30, 8972, 397, 20, 40, 7019, 133, 1876, 40, 6367, 3893, 9, 6200, 65, 30, 32, 5196, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
CMD Silent Uninstall - Registry Search === I'm installing a software that every time it gets installed, the software would change it's registry key every single time. Is there a way to search the registry for the uninstall script? Also note that if I copied the folder from install shield and ran the setup.exe -removeonly -f1uninst.iss it would fail. It would only work if I ran the registry uninstall path. Any tips?
0
[ 2, 2390, 43, 2690, 367, 108, 21300, 13, 8, 18269, 2122, 800, 3726, 3726, 31, 22, 79, 25429, 21, 2306, 30, 352, 85, 32, 3049, 4066, 15, 14, 2306, 83, 753, 32, 22, 18, 18269, 1246, 352, 345, 85, 9, 25, 80, 21, 161, 20, 2122, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to determine deprecated permissions? === I'm working on an android application with a huge source code base. I don't like it that my application requires not a few permissions, and i started to suspect that there are a few which are deprecated and no longer needed. The question is - **How to determine if so, and which are really deprecated?** I tried to remove a suspicious permission off and recompile it (using Eclipse Juno), and hoped the compiled to mark it as an error or a warning, but it didn't. Also tried to explicitly run Lint on the code, and it didn't detect it either. The application compiled and runs on the device, and i guess that will throw runtime exception with AccessDenied when the relevant API will be called at some code flow. Is there any effective way to detect that API, without browsing all the source code or running the application in multiple scenarios? Thanks!
0
[ 2, 184, 20, 3746, 121, 3515, 150, 1669, 5572, 18, 60, 800, 3726, 3726, 31, 22, 79, 638, 27, 40, 13005, 3010, 29, 21, 2329, 1267, 1797, 1000, 9, 31, 221, 22, 38, 101, 32, 30, 51, 3010, 4781, 52, 21, 310, 5572, 18, 15, 17, 31,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to implement LFU cache using STL? === I'm trying to implement LFU (Least Frequently Used) cache using pure STL (I don't want to use Boost!). Requirements are: - Associative access to any element using a `Key` like with `std::map`. - Ability to release the lowest priority item (using its `UsesCount` attribute). - Ability to update priority (`UsesCount`) of any item. The problems are: - If I use `std::vector` as container of items (`Key`, `Value`, `UsesCount`), `std::map` as a container of iterators to the vector for associative access and `std::make_heap`, `std::push_heap` and `std::pop_heap` as priority queue implementation within the vector, the itertors in the map are not valid after heap operations. - If I use `std::list` (or `std::map`) instead of `std::vector` in the previous configuration, `std::make_heap` etc. can't be compiled becasue their iterators does not support aritmetic. - If I'd like to use `std::priority_queue`, I don't have ability to update item priority. The questions are: - Am I missing something obvious how this problem could be solved? - Can you point me to some pure C++/STL implementation of LFU cache meeting previous requirements as an example? Thank you for your insights.
0
[ 2, 184, 20, 8713, 644, 4096, 16522, 568, 354, 255, 60, 800, 3726, 3726, 31, 22, 79, 749, 20, 8713, 644, 4096, 13, 5, 255, 2857, 3086, 147, 6, 16522, 568, 4267, 354, 255, 13, 5, 49, 221, 22, 38, 259, 20, 275, 10419, 187, 6, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Reference - const pointer === I have read in many places about references: Reference is like a const pointer Reference always refer to an object Once initialised, a Reference cannot be reseated I want to make myself clear on the last point. What does that mean? I tried this code: #include <iostream> int main() { int x = 5; int y = 8; int &rx = x; std::cout<<rx<<"\n"; rx = y; //Changing the reference rx to become alias of y std::cout<<rx<<"\n"; } **Output** 5 8 Then what does it mean by "References cannot be reseated"?
0
[ 2, 2801, 13, 8, 11608, 38, 454, 106, 800, 3726, 3726, 31, 57, 1302, 19, 151, 1489, 88, 7231, 45, 2801, 25, 101, 21, 11608, 38, 454, 106, 2801, 550, 5017, 20, 40, 3095, 382, 2104, 2541, 15, 21, 2801, 1967, 44, 302, 8324, 69, 31...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Routing API using PHP === Does anybody know where i can find some free routing software? I don't think Google Maps does what i need. We have a set of postcodes and each set of postcodes has an allocated time associated with it. We need a service we can pass in these set of postcodes with times and for it calculate the optimised route. Does thing exist, for free? Thanks
1
[ 2, 19880, 21, 2159, 568, 13, 26120, 800, 3726, 3726, 630, 11181, 143, 113, 31, 92, 477, 109, 551, 19880, 2306, 60, 31, 221, 22, 38, 277, 8144, 6867, 630, 98, 31, 376, 9, 95, 57, 21, 309, 16, 678, 9375, 18, 17, 206, 309, 16, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
printing elements with javascript === I'm learning javascript at the moment and the code below isn't producing the results I thought it would: var links = document.getElementsByTagName("a"); for(i=0; i<links.length; i++) { document.write(links[i]); } When I run this code, it writes 1 element from the array. I want it to return everything (there are over 1,000 in `links`) What did I do wrong?
0
[ 2, 7312, 2065, 29, 8247, 8741, 800, 3726, 3726, 31, 22, 79, 2477, 8247, 8741, 35, 14, 688, 17, 14, 1797, 1021, 2532, 22, 38, 4081, 14, 1736, 31, 289, 32, 83, 45, 4033, 6271, 800, 4492, 9, 3060, 27567, 18, 779, 8628, 7259, 5, 7...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
App crashes when setting delegate for UITextField === I ave an app n which a table view instantiates cell objects from a class called "NameCell" that has a nib file called "NameCellView.xib" (Name Cell is the class for NameCellView). Within the NameCellView.xib view controller there is a UITextField Named "NameField". Now i have tried to set up the UITextField's (NameField) delegate to be the file owner (e.g. the class of the cell = NameCell). But when I do that, the app crashes as soon as I try interacting with the textfield (e.g. when I tap it), and the only message I get is '(lldb)' and the following line highlighted in green in the main.m app file : return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); Any ideas as for why that happens and how to fix it? All I am trying to do id dismiss the keyboard when the user taps the 'return' key, so if you have a better way to do that without delegation I am all ears! Thanks a lot for your help! Any comment is highly appreciated!
0
[ 2, 4865, 21563, 76, 2697, 11300, 26, 13, 5661, 11969, 1109, 800, 3726, 3726, 31, 21, 195, 40, 4865, 13, 103, 56, 21, 859, 1418, 6322, 15882, 18, 1667, 3916, 37, 21, 718, 227, 13, 7, 7259, 9725, 7, 30, 63, 21, 1781, 220, 3893, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
About fetching data from facebook === I have made a website using php where i can fetch a users facebook user id, email id , and fb id and some other stuff. But is it possible for me to fetch my profile picture from facebook. So i dont need to upload my pic when i enter to the system. If any one can help please suggest.
0
[ 2, 88, 18312, 68, 1054, 37, 9090, 800, 3726, 3726, 31, 57, 117, 21, 2271, 568, 13, 26120, 113, 31, 92, 18312, 21, 3878, 9090, 4155, 4924, 15, 8517, 4924, 13, 15, 17, 13, 13478, 4924, 17, 109, 89, 3217, 9, 47, 25, 32, 938, 26, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to solve this error in C#? === when we used this code occure: var v1 = from P in db1.QuranWordsNews where P.Aye == perId select P; var vv= v1.LastOrDefault();\\the error occure Massage error: LINQ to Entities does not recognize the method 'TashihQuran.QuranWordsNew LastOrDefault[QuranWordsNew](System.Linq.IQueryable`1[TashihQuran.QuranWordsNew])' method, and this method cannot be translated into a store expression.
0
[ 2, 184, 20, 8402, 48, 7019, 19, 272, 5910, 60, 800, 3726, 3726, 76, 95, 147, 48, 1797, 3744, 62, 45, 4033, 566, 165, 800, 37, 351, 19, 13, 9007, 165, 9, 5495, 2195, 12827, 14962, 113, 351, 9, 9754, 800, 3726, 9366, 43, 5407, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Symfony2 Form: Tags Collection does not get persisted === I have an `Upload` Entity , that can have many Tags, /** * @ORM\ManyToMany(targetEntity="Tag", mappedBy="uploads") */ protected $tags; and a `Tag` can be in Many Uploads /** * @ORM\ManyToMany(targetEntity="Upload", inversedBy="tags") * @ORM\JoinTable(name="upload_tag") */ protected $uploads; i have a Form, where i can upload a file, and select tags with multi-select....here is a snippet from the `UploadType` file ......other form elements..... $builder->add('tags', 'entity', array( 'multiple' => true, 'property' => 'name', 'class' => 'BoiMembersBundle:Tag', )); The forum submits fine, without errors.....but when i look into my upload_tag, which represents the ManyToMany relationship in my mysql DB, i see no new lines!!! So the application does not report any errors what so ever..other form elements of Upload get insterted fine, and forwards to the "success"-Route, but i do not see persistanse for the tags.
0
[ 2, 13, 7261, 10229, 93, 135, 505, 45, 3383, 18, 1206, 630, 52, 164, 22125, 800, 3726, 3726, 31, 57, 40, 13, 1, 576, 8294, 1, 9252, 13, 15, 30, 92, 57, 151, 3383, 18, 15, 13, 118, 1409, 1637, 13, 1, 248, 79, 1, 14842, 262, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is there a required context for presentViewController? === My iOS app has a welcome screen (not to be confused with the default view). The view controller downloads and parses an XML file using NSXMLParser. When it completes it's task it makes a button visible, which when clicked calls "presentViewController" which takes the user into the actual app. This worked fine. I then decided that I would just like the the app to automatically transition, and so I removed the button altogether and moved the call to presentViewController into the "parserDidEndDocument" delegate method. The method gets called but nothing happens. I suspect it has something to do with the context, but when I log "self" it prints an instance of the welcome view controller. What am I doing wrong? How should I fix this?
0
[ 2, 25, 80, 21, 1390, 4141, 26, 734, 4725, 12898, 1252, 60, 800, 3726, 3726, 51, 13, 7760, 4865, 63, 21, 5575, 2324, 13, 5, 1270, 20, 44, 4230, 29, 14, 12838, 1418, 6, 9, 14, 1418, 9919, 7121, 18, 17, 2017, 7202, 40, 23504, 389...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Json / Jsonp not connecting to php (Phonegap + jquerymobile) === <h2>I am trying to make -</h2> - an android WEB application - with phonegap - layout with JqueryMobile <h3>What Im doing -</h3> - An html form that takes ID, name, and address as input - 'Serialize's this data using ajax - makes a json object out of it - Should send it to a file called 'connection.php' - Where, this data is put into a database (MySql) <h3>Other details -</h3> - My server is localhost, Im using xampp - I have already created a database and table using phpmyadmin <h2>The problem -</h2> - My html file, where my json object is created, does not connect to the php file which is hosted by my localhost <h2>Here is my COMPLETE html file:</h2> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <!-- Change this if you want to allow scaling --> <meta name="viewport" content="width=default-width; user-scalable=no" /> <meta http-equiv="Content-type" content="text/html;charset=utf-8"> <title>Trial app</title> <link rel="stylesheet" href="thestylesheet.css" type="text/css"> <script type="text/javascript" charset="utf-8" src="javascript1.js"></script> <script type="text/javascript" charset="utf-8" src="javascript2.js"></script> <script type="text/javascript" charset="utf-8" src="cordova-1.8.0.js"></script> <script> $(document).ready(function () { $("#btn").click( function() { alert('hello hello'); $.ajax({ url: "connection.php", type: "POST", data: { id: $('#id').val(), name: $('#name').val(), Address: $('#Address').val() }, datatype: "json", success: function (status) { if (status.success == false) { alert("Failure!"); } else { alert("Success!"); } } }); }); }); </script> </head> <body> <div data-role="header"> <h1>Heading of the app</h1> </div><!-- /header --> <div data-role="content"> <form id="target" method="post"> <label for="id"> <input type="text" id="id" placeholder="ID"> </label> <label for="name"> <input type="text" id="name" placeholder="Name"> </label> <label for="Address"> <input type="text" id="Address" placeholder="Address"> </label> <div id="btn" data-role="button" data-icon="star" data-theme="e">Add record</div> <!--<input type="submit" value="Add record" data-icon="star" data-theme="e"> --> </form> </div> </body> </html> <h2>And here is my 'connection.php' hosted by my localhost</h2> <?php header('Content-type: application/json'); $server = "localhost"; $username = "root"; $password = ""; $database = "jqueryex"; $con = mysql_connect($server, $username, $password); if($con) { echo "Connected to database!"; } else { echo "Could not connect!"; } //or die ("Could not connect: " . mysql_error()); mysql_select_db($database, $con); /* CREATE TABLE `sample` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(45) DEFAULT NULL, `Address` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) */ $id= json_decode($_POST['id']); $name = json_decode($_POST['name']); $Address = json_decode($_POST['Address']); $sql = "INSERT INTO sample (id, name, Address) "; $sql .= "VALUES ($id, '$name', '$Address')"; if (!mysql_query($sql, $con)) { die('Error: ' . mysql_error()); } else { echo "Comment added"; } mysql_close($con); ?> <h2>My doubts:</h2> - No entry is made in my table 'sample' when i view it in phpmyadmin - So obviously, i see no success messages either - I dont get any errors, not from ajax and neither from the php file. <h2>Stuff Im suspecting:</h2> - Should i be using jsonp instead of json? Im new to this. - Is there a problem with my php file? - Perhaps I need to include some more javascript files in my html file? I assume this is a very simple problem so please help me out! I think there is just some conceptual error, as i have only just started with jquery, ajax, and json. Thank you.
0
[ 2, 487, 528, 13, 118, 487, 528, 306, 52, 6440, 20, 13, 26120, 13, 5, 7709, 1136, 306, 2754, 487, 8190, 93, 12571, 6, 800, 3726, 3726, 13, 1, 252, 135, 1, 49, 589, 749, 20, 233, 13, 8, 1, 118, 252, 135, 1, 13, 8, 40, 13005,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Obtaining generic key_type from C++ STL collections === I came up with the following code which demonstrates a technique for iterating generically over an STL collection and obtaining the key value regardless of how the key is stored. The context of this is that I am refactoring two functions which both operate the same functionality on two collections: one is a `set<int>` and the other is a `map<int, int>` so in the first case I want to act on `*it` and in the second on `it->first` (where `it` is a const_iterator.) #include <map> #include <set> #include <iostream> using namespace std; // General case for obtaining from, say, a set. template< typename T > const typename T::key_type getKey( const typename T::const_iterator& it ) { return *it; } // Specific case for a map<int,int> template<> const map<int, int>::key_type getKey< map<int, int> >( const map<int, int>::const_iterator& it ) { return it->first; } template< typename T > void dumpOut( T& coll ) { for ( typename T::const_iterator it = coll.begin(); it != coll.end(); ++it ) { const typename T::key_type& a = getKey<T>(it); cout << a << endl; } } int main() { set<int> s1; s1.insert(10); s1.insert(15); s1.insert(20); dumpOut< set<int> >( s1 ); map<int, int> m1; m1.insert( pair<int, int>(11, -1) ); m1.insert( pair<int, int>(16, -1) ); m1.insert( pair<int, int>(21, -1) ); dumpOut< map<int, int> >( m1 ); return 0; } My question is: Is it possible to make the specialised case for `map<int,int>` a little more general since the approach would clearly work for `map` generally, regardless of what the key and value actually are. Any pointer (no pun intended) would be useful. Please note that I can't use C++11 solutions although I'm interested in solutions using it from an academic perspective. Thanks.
0
[ 2, 12114, 12733, 1246, 1, 4474, 37, 272, 20512, 354, 255, 5721, 800, 3726, 3726, 31, 281, 71, 29, 14, 249, 1797, 56, 19466, 21, 4873, 26, 32, 106, 1880, 12733, 1326, 84, 40, 354, 255, 1206, 17, 12114, 14, 1246, 1923, 7148, 16, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Using expand on Parent type navigation property wcf-data-services === I have entity defined as follows (details omitted): public class Order :Cart,IEntity { } The base class Cart has a Navigation Property Order Items to public List<Item> Items { get; set; } Using Odata protocol how can I access the Parent types Item property using the expand statement? When I perform the following query I get the following error: https://localhost/ECommerceOData.svc/Order?$expand=Items <?xml version="1.0" encoding="utf-8" standalone="yes"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code></code><message xml:lang="en-GB">Error processing request stream. The property name 'Items' specified for type 'Bsi.Cloud.eCommerce.Model.Context.Order' is not valid.</message></error> Also the DBContext exposes Order as a DBSet. The Odata service exposes the Order entity: config.SetEntitySetAccessRule("Order", EntitySetRights.AllRead); Best Regards, Romeel
0
[ 2, 568, 6073, 27, 4766, 1001, 8368, 1354, 11801, 410, 8, 18768, 8, 11449, 18, 800, 3726, 3726, 31, 57, 9252, 2811, 28, 2415, 13, 5, 546, 8682, 18, 18761, 6, 45, 317, 718, 389, 13, 45, 1367, 38, 15, 49, 2291, 856, 13, 1, 13, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
JMeter: View Result Tree in Proxy and live is showing different result === Scenario : 1 user will login 2 search 3 if result exits it will return that row else it will return message when i record this scenario through proxy in the view result tree,request and response are showing correctly but when the same thing I run directly in the view result tree list for the same request sub request are showing and in the response tab wrong data are showing and for that reason assertions are not working during running the test case. This application is Ajax+json based, so can anyone suggest how to overcome this situation.
1
[ 2, 487, 7307, 45, 1418, 829, 1541, 19, 27188, 17, 515, 25, 3187, 421, 829, 800, 3726, 3726, 12705, 13, 45, 137, 4155, 129, 6738, 108, 172, 2122, 203, 100, 829, 4350, 18, 32, 129, 788, 30, 3131, 962, 32, 129, 788, 2802, 76, 31, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
POSTing a ManagedObject via RestKit results in "Cannot update object that was never inserted" === I create a managed object save the context and post like so: [[RKObjectManager sharedManager] postObject:tag mapResponseWith:tagMappingForPOST delegate:tagLoader]; The `tagLoader` gets the object back but fails to save in the RestKit's context saying: Failed to save managed object context after mapping completed: The operation couldn’t be completed. (Cocoa error 134030.) NSUnderlyingException=Cannot update object that was never inserted. I'm doing the same thing with the same backend server (Parse.com) with the same class and it's working fine. Any clues as to the potential reasons why one would get a "Cannot update object that was never inserted." error?
0
[ 2, 15669, 21, 1471, 23793, 1197, 760, 13703, 1736, 19, 13, 7, 1245, 1270, 11100, 3095, 30, 23, 243, 14215, 7, 800, 3726, 3726, 31, 1600, 21, 1471, 3095, 2079, 14, 4141, 17, 678, 101, 86, 45, 636, 2558, 7005, 23793, 22256, 2592, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
what is "Use Custom Permissions" in Magento installer? === What is meaning of "Use Custom Permissions" check-box in Magento installer? version 1.7.0.0 ![enter image description here][1] [1]: http://i.stack.imgur.com/cJ9YE.png
0
[ 2, 98, 25, 13, 7, 3699, 5816, 5572, 18, 7, 19, 4723, 17050, 16146, 106, 60, 800, 3726, 3726, 98, 25, 1813, 16, 13, 7, 3699, 5816, 5572, 18, 7, 2631, 8, 5309, 19, 4723, 17050, 16146, 106, 60, 615, 137, 9, 465, 9, 387, 9, 387,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Why do I get the wrong output from this query? === Im trying to page results in ms sql server and I'm having some troubles getting the right result. I'd like to achieve the same result as mysql:s LIMIT and Iäm trying to use this model to do it: SELECT * FROM ( SELECT TOP x * FROM ( SELECT TOP y fields FROM table WHERE conditions ORDER BY table.field ASC) as foo ORDER by field DESC) as bar ORDER by field ASC from: http://josephlindsay.com/archives/2005/05/27/paging-results-in-ms-sql-server/ The original query listing top 30 rows is the following: SELECT TOP 30 pt.[BSNR], t.ID, pt.RESDATUMTID, pt.LAND1, pt.HPL1, pt.ANKDATUMTID, pt.LAND2, pt.HPL2 FROM [statistik2].[dbo].[ttrip] AS t JOIN [statistik2].[dbo].[tparttrip] AS pt ON t.ID = pt.TRIP_ID WHERE t.DBKRDAT > '2012-06-27' ORDER BY pt.BSNR DESC, t.ID, pt.RESDATUMTID And my attempt is: SELECT * FROM ( SELECT TOP 10 * FROM ( SELECT TOP 30 pt.ID AS PTID, pt.[BSNR], t.ID, pt.RESDATUMTID, pt.LAND1, pt.HPL1, pt.ANKDATUMTID, pt.LAND2, pt.HPL2 FROM [statistik2].[dbo].[ttrip] AS t JOIN [statistik2].[dbo].[tparttrip] AS pt ON t.ID = pt.TRIP_ID WHERE t.DBKRDAT > '2012-06-27' ORDER BY pt.BSNR DESC, t.ID DESC, pt.RESDATUMTID ) as pttt ORDER BY pttt.PTID DESC) AS ptttt ORDER BY ptttt.PTID Output from the queries: http://speedy.sh/5NQeq/sqloutput.txt Can someone explain what I'm doing wrong?
0
[ 2, 483, 107, 31, 164, 14, 1389, 5196, 37, 48, 25597, 60, 800, 3726, 3726, 797, 749, 20, 2478, 1736, 19, 4235, 4444, 255, 8128, 17, 31, 22, 79, 452, 109, 16615, 1017, 14, 193, 829, 9, 31, 22, 43, 101, 20, 4689, 14, 205, 829, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
SQL query to group results into hourly buckets === I have a very simple MySQL table Name | Time | Count James | 11:00 | 10 Simon | 11:00 | 5 James | 11:30 | 4 Oliver| 11:30 | 2 James | 12:00 | 1 etc. I would like to create a MySQL query which sums the Count for each person and outputs a last 1 hour value, a last 3 hour value, a last 6 hour value, a last 12 hour value and a last 24 hour value. e.g. if the time is now 12:59 the above table would output: Name | Last-1 | Last-3 | Last-6 James | 1 | 15 | 15 Simon | 0 | 5 | 5 Oliver| 0 | 2 | 2 Is it possible to do this in a single query? So far I have: SELECT name, HOUR( NOW( ) ) - HOUR( time ) AS lasthours, SUM( count ) AS c FROM table GROUP BY name, lasthours HAVING lasthours =0 ORDER BY c DESC Which gives me the past hour, but how do I get the additional columns? Any help much appreciated.
0
[ 2, 4444, 255, 25597, 20, 214, 1736, 77, 1671, 102, 12433, 18, 800, 3726, 3726, 31, 57, 21, 253, 1935, 51, 18, 22402, 859, 204, 13, 1, 85, 13, 1, 2468, 586, 13, 1, 547, 45, 2032, 13, 1, 332, 2214, 13, 1, 547, 45, 2032, 13, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to add a local project to asdf configured by quicklisp === I want to add a local project to the known projects by asdf, but due to the fact that asdf was installed and configured by quicklisp and the `*central-registry*` points to "#P/home/user/quicklisp/quicklisp/", which contains .lisp files. I do not know how to do it as the [manual][1] explains that a symbolic link into the directory would do it, but I do not want to mess around inside quicklisp. (It does work as a hotfix, though!) Therefore:How to add a local project to asdf (NOT QUICKLISP) which was installed and configured by quicklisp? [1]: http://common-lisp.net/project/asdf/asdf/Configuring-ASDF.html
0
[ 2, 184, 20, 3547, 21, 375, 669, 20, 28, 8736, 28895, 34, 2231, 3159, 306, 800, 3726, 3726, 31, 259, 20, 3547, 21, 375, 669, 20, 14, 167, 2314, 34, 28, 8736, 15, 47, 397, 20, 14, 837, 30, 28, 8736, 23, 4066, 17, 28895, 34, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
(building cabal-install from git) Why Module `Distribution.Compat.Exception' does not export `SomeException' === I'm trying to compile hackport ( here is sources: https://github.com/Nensha/hackport ) with newer cabal but always getting the same Error: [61 of 91] Compiling Distribution.Client.Types ( cabal/cabal-install/Distribution/Client/Types.hs, dist/build/hackport/hackport-tmp/Distribution/Client/Types.o ) cabal/cabal-install/Distribution/Client/Types.hs:33:12: Module `Distribution.Compat.Exception' does not export `SomeException' according Distribution.Compat.Exception there must not be any problems and in must come from base but fails. So the question is why?
0
[ 2, 13, 5, 11783, 4846, 192, 8, 108, 21300, 37, 13, 10404, 6, 483, 12613, 13, 1, 2906, 13202, 3309, 9, 18415, 38, 9, 10066, 872, 22, 630, 52, 7487, 13, 1, 3220, 10066, 872, 22, 800, 3726, 3726, 31, 22, 79, 749, 20, 26561, 11835...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Invalid operation.The connection is closed error while reading from SQL server === I like to read from database using Linq to SQL. However in this method throw exception public string[] readFromAbbrevationsPerson() { string[] resultAbbrevationsPerson = new string[10000]; DataClassesDataContext db = new DataClassesDataContext("NERMacedonianConnectionString"); var query = from abb in db.abbrevationsPersons select abb.abbrevationsPerson1; int i = 0; foreach (string noun in query) resultAbbrevationsPerson[i++] = noun; return resultAbbrevationsPerson; } in the foreach statement.The exception is Invalid operation the connection is closed. I made refresh in VS 2010 to the server and I made refresh in SQL Management studio.Ichecked the status of the server is running.
0
[ 2, 16671, 1453, 9, 124, 2760, 25, 827, 7019, 133, 1876, 37, 4444, 255, 8128, 800, 3726, 3726, 31, 101, 20, 1302, 37, 6018, 568, 6294, 1251, 20, 4444, 255, 9, 207, 19, 48, 2109, 3814, 5391, 317, 3724, 2558, 500, 1302, 2665, 58, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Expectation of the maximum consecutive subsequence sum of a random sequence === Here is a problem from Programming Pearls 2nd edition (Chapter 8.7): Considering a real number sequence, whose elements are drawn uniformly from the range [-1, 1], what is the expected maximum consecutive subsequence sum? (If all the elements are negative, the maximum sum is 0.) Assuming the length of the sequence is N, is there a closed form for the expected maximum subsequence sum f(N)? I try to do some simulation, but failed to find any clue. Thanks for help.
0
[ 2, 19505, 16, 14, 2979, 4195, 972, 29413, 3907, 16, 21, 5477, 4030, 800, 3726, 3726, 235, 25, 21, 1448, 37, 3143, 5445, 18, 172, 706, 1322, 13, 5, 27396, 469, 9, 465, 6, 45, 5154, 21, 683, 234, 4030, 15, 1196, 2065, 50, 3160, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Adding zero to a single digit number, Is it possible? === public class MultiplicationTable { public static void main (String[]a){ int[] x; x = new int[10]; int i; int n=0; for (i=0;i<x.length;i++){ n++; x[i]=n; System.out.print(x[i] + " "); } System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[0] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[1] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[2] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[3] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[4] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[5] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[6] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[7] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[8] * x[i] + " "); System.out.println(); for (i=0;i<x.length;i++) System.out.print(x[9] * x[i] + " "); } } This is a program that will display a Multiplication Table like this: 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 4 8 12 16 20 24 28 32 36 40 5 10 15 20 25 30 35 40 45 50 6 12 18 24 30 36 42 48 54 60 7 14 21 28 35 42 49 56 63 70 8 16 24 32 40 48 56 64 72 80 9 18 27 36 45 54 63 72 81 90 10 20 30 40 50 60 70 80 90 100 =============================================================== It is running and correct but I want it to look like this one: 01 02 03 04 05 06 07 08 09 10 01 02 03 04 05 06 07 08 09 10 02 04 06 08 10 12 14 16 18 20 03 06 09 12 15 18 21 24 27 30 04 08 12 16 20 24 28 32 36 40 05 10 15 20 25 30 35 40 45 50 06 12 18 24 30 36 42 48 54 60 07 14 21 28 35 42 49 56 63 70 08 16 24 32 40 48 56 64 72 80 09 18 27 36 45 54 63 72 81 90 10 20 30 40 50 60 70 80 90 100 =============================================== Is there any way?
0
[ 2, 4721, 4606, 20, 21, 345, 15611, 234, 15, 25, 32, 938, 60, 800, 3726, 3726, 317, 718, 25432, 5924, 13, 1, 317, 12038, 11364, 407, 13, 5, 11130, 2558, 500, 58, 6, 1, 19, 38, 2558, 500, 993, 73, 993, 800, 78, 19, 38, 2558, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Mathematics on a special column in mysql === I want to do a mathematic on a column of my table. i have numbers in my column that i want to divide by 11 and then *0.5 and mines from frist number can i do somthing like this with only mysql? or need to a php file to do this ????
0
[ 2, 4264, 27, 21, 621, 4698, 19, 51, 18, 22402, 800, 3726, 3726, 31, 259, 20, 107, 21, 1216, 124, 6732, 27, 21, 4698, 16, 51, 859, 9, 31, 57, 2116, 19, 51, 4698, 30, 31, 259, 20, 8918, 34, 547, 17, 94, 1637, 387, 9, 264, 17...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Google App Engine RuntimeHelper.checkRestricted taking 25X time from antlr GAE Java 1.7 === We are using antlr parsing on GAE 1.7 and find a 25x overhead (running GAE in eclipse locally compared to running a standalone Java app) because it spends 96% of its time in RuntimeHelper.checkRestricted (We are NOT in GAE 1.6.4 which had a bug of extra calls to RuntimeHelper.checkRestricted) Does anyone know a list of which method calls trigger calls to RuntimeHelper.checkRestricted so that we can potentially avoid those please? For some reason I can't find any documentation of this security manager and what triggers it. One call which repeatedly triggers a time-consuming call to checkRestricted seems to be antlr.runtime.DFA.predict(IntStream) Thanks!
0
[ 2, 8144, 4865, 1406, 485, 891, 14593, 106, 9, 12542, 99, 27245, 69, 741, 771, 396, 85, 37, 40, 38, 12988, 13, 17721, 8247, 137, 9, 465, 800, 3726, 3726, 95, 50, 568, 40, 38, 12988, 2017, 18, 68, 27, 13, 17721, 137, 9, 465, 17,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Implementation of Time Machine Feature in grails application === I am trying to implement a 'time machine' feature in my grails application. The feature would allow user to select a date in past and would display the interface of the application that was on the selected date. How do I implement this feature? I was thinking of adding a 'dateCreated' field for all domains, so that in the time machine feature, I could query all the results with created date before the selected date. I think this would work but as the data would grow, the size of database would grow and at that time the application would be heavy. Is there any other way to do this ? Thanks
0
[ 2, 6123, 16, 85, 1940, 1580, 19, 489, 7301, 18, 3010, 800, 3726, 3726, 31, 589, 749, 20, 8713, 21, 13, 22, 891, 1940, 22, 1580, 19, 51, 489, 7301, 18, 3010, 9, 14, 1580, 83, 1655, 4155, 20, 5407, 21, 1231, 19, 640, 17, 83, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to use OpenJPA 2.2 on WebSphere 7.0? === I'm starting a project where I need to use OpenJPA 2.2 and run on WAS 7.0. How do I make WAS 7.0 pick up the OpenJPA 2.2 jar instead of using its own?
0
[ 2, 184, 20, 275, 368, 728, 1060, 172, 9, 135, 27, 2741, 14079, 453, 9, 387, 60, 800, 3726, 3726, 31, 22, 79, 1422, 21, 669, 113, 31, 376, 20, 275, 368, 728, 1060, 172, 9, 135, 17, 485, 27, 23, 453, 9, 387, 9, 184, 107, 31,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
"import atom" in gdata-python-client, whiich atom === I was running through the gdata-python-client, when I tried to run the code it failed as the module atom isn't installed. http://code.google.com/p/gdata-python-client/source/browse/samples/contacts/contacts_example.py When I try and do a pip install of atom sudo pip install atom it seems to pick up "Automated Testing on Mac", which doesn't compile on ubuntu. http://pypi.python.org/pypi/atom/0.9.2 And isn't right any way as reading the code suggests that the atom module used here is for atom feed generation. What is the correct module for atom to install in the gdata world and can it just used as is or does it need to be corrected in the file: import pyatom as atom for example
0
[ 2, 13, 7, 1660, 1993, 14571, 7, 19, 489, 18768, 8, 6448, 11570, 8, 150, 18513, 38, 15, 13, 9373, 3870, 14571, 800, 3726, 3726, 31, 23, 946, 120, 14, 489, 18768, 8, 6448, 11570, 8, 150, 18513, 38, 15, 76, 31, 794, 20, 485, 14, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Django model group by more than 2 elements === I have a table that contains userids and their score. eg. userid rating 123 1 123 2 456 1 789 5 123 1 What I would like to achieve is a summary table like this: rating 1 : 32 ratings by 20 ppl 2 : 37 ratings by 15 ppl etc.. The number of ppl should be distinct users who have given that rating. I have gone through Django model aggregation methods and know how to use count etc. But I am not able to come up with something that will achieve this. Of course i can retrieve the whole set and use a for loop in python to count but that wouldnt be efficient. Thanks for any help.
0
[ 2, 3857, 14541, 1061, 214, 34, 91, 119, 172, 2065, 800, 3726, 3726, 31, 57, 21, 859, 30, 1588, 4155, 9178, 17, 66, 1618, 9, 12369, 9, 275, 5175, 4647, 390, 240, 137, 390, 240, 172, 13, 26204, 137, 453, 3877, 331, 390, 240, 137, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How do I get the gravity when the screen is titled (Box2D/AndEngine)? === I'm using AndEngine and Box2d to develop a game. I'm applying a force to a body to keep it "aloft" equal to that of gravity. I have the scene set up so that: public void onAccelerationChanged(final AccelerationData pAccelerationData) { gravity = Vector2Pool.obtain(pAccelerationData.getX(), pAccelerationData.getY()); this.mPhysicsWorld.setGravity(gravity); Vector2Pool.recycle(gravity); } Now I need to set my force applied: body.applyForce(new Vector2(0,-*gravity*), new Vector2(body.getWorldCenter())); How do I get the gravity? I tried gravity.y, but that returns null.
0
[ 2, 184, 107, 31, 164, 14, 8849, 76, 14, 2324, 25, 3008, 13, 5, 5309, 135, 43, 118, 290, 16847, 6, 60, 800, 3726, 3726, 31, 22, 79, 568, 17, 16847, 17, 1649, 135, 43, 20, 2803, 21, 250, 9, 31, 22, 79, 11989, 21, 558, 20, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Deploying Web API Controller to Production === I have a ASP.NET MVC application in VS 2010. I added a new Web API Controller to my application. Here is the simple method I am trying to call: public List<Article> Get() { using (var db = new HighOnCodingDbEntities()) { var articles = (from a in db.Articles select a).Take(10).ToList(); return articles; } } When I call this method I get "Resource Not Found". I have published the application binary to the production and I believe that is all I need to do.
0
[ 2, 17617, 68, 2741, 21, 2159, 9919, 20, 637, 800, 3726, 3726, 31, 57, 21, 28, 306, 9, 2328, 307, 8990, 3010, 19, 4611, 498, 9, 31, 905, 21, 78, 2741, 21, 2159, 9919, 20, 51, 3010, 9, 235, 25, 14, 1935, 2109, 31, 589, 749, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What is named.exe process and how to avoid consuming high CPU rates === I have a Windows Server 2008 with Plesk running two web sites. Sometimes the server is going slow and there is a named.exe process making the CPU peak 100%. It last a short period of time and after a while it comes again. I would like to know what this process is for and how to configure it for not consuming this cpu and make my sites go slow.
0
[ 2, 98, 25, 377, 9, 1706, 62, 953, 17, 184, 20, 2658, 13, 17601, 183, 17578, 5332, 800, 3726, 3726, 31, 57, 21, 1936, 8128, 570, 29, 11375, 3656, 946, 81, 2741, 3259, 9, 1030, 14, 8128, 25, 228, 2276, 17, 80, 25, 21, 377, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
I have a native php function issue when i convert plain PHP code into codeigniter === I have a native php function issue when i convert plain PHP code into codeigniter. you guys have any idea or alternate solution about this please let me know helps are definitely appreciated >Plain PHP CODE $aColumns = array( 'id', 'name', 'first_name' ); $sTable = "ajax"; $sQuery = "SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ", implode(", ", $aColumns))."FROM $sTable $rResult = mysql_query( $sQuery ); while ( $aRow = mysql_fetch_assoc( $rResult ) ) { print_r($aRow); } >Perfect Result Output Array ( [id] => 1 [name] => kane [first_name] => kane ) Array ( [id] => 2 [name] => kane [first_name] => kane ) Array ( [id] => 3 [name] => kane [first_name] => kane ) >Codeigniter CODE $aColumns = array( 'id', 'name', 'first_name' ); $sTable = "ajax"; $sQuery = "SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ", implode(", ", $aColumns))."FROM $sTable $rResult = $this->db->query($sQuery); while ( $aRow = $rResult->row_array() ) { print_r($aRow); } > Infinite Result Output Array ( [id] => 1 [name] => kane [first_name] => kane ) Array ( [id] => 1 [name] => kane [first_name] => kane )
0
[ 2, 31, 57, 21, 1275, 13, 26120, 1990, 1513, 76, 31, 8406, 3748, 13, 26120, 1797, 77, 1797, 9693, 242, 106, 800, 3726, 3726, 31, 57, 21, 1275, 13, 26120, 1990, 1513, 76, 31, 8406, 3748, 13, 26120, 1797, 77, 1797, 9693, 242, 106, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
WS Client "Service Account" Pooling === I am developing a WS Client, in Java. The WS requires authentication via a login/password to create a session, and all actions are taken using that valid session id. The users of my WS Client, will not have accounts to authenticate with the WS individually (This is actually the whole point of developing the client. The WS is an alternative way to access a certain enterprise application, and we need users without accounts in that application to have access.), so we will be using a "Service Account". That is, an account that does have access to the WS, that will perform all actions on behalf of the WS Client users. My problem is that each Service Account, can only have one active session at a time with the WS. So, if multiple users attempt to perform an action simultaneously, the WS will throw an error. It seems to me that we obviously need a pool of Service Accounts that will be called upon as needed to create a session and perform an action, and will be freed up when that action is finished, and the session is closed. My question is: Are there well established ways to handle this situation? My idea is to load a list of Service Accounts on application startup, and have a synchronized method that returns an idle Service Account, when a user must perform an action on the WS, flag that account as in use, and then flag it as idle again, when the action is completed, and the session is closed. Does this sound reasonable, or am I barking up the wrong tree? I appreciate the help. I have done quite a bit of Googling about the issue, but have not come up with an answer. I am sure that others are handling similar situations, so I may just be searching for the wrong terms.
0
[ 2, 619, 18, 6819, 13, 7, 11449, 2176, 7, 3067, 68, 800, 3726, 3726, 31, 589, 3561, 21, 619, 18, 6819, 15, 19, 8247, 9, 14, 619, 18, 4781, 27963, 1197, 21, 6738, 108, 118, 6201, 9587, 20, 1600, 21, 3723, 15, 17, 65, 3078, 50, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Dynamically add validation rules === I have a plugin which generically handle the creation of a jQuery dialog used for CRUD operations. The markup of the form that is added to the dialog is available externally of the plugin code and the plugin just ask to an http service to provide the markup and when received simply add it to the dialog itself. I have then created a callback in the plugin (`onSetupValidation` function) which is meant to be the handle for the plugin user to customize the validation for each form. This is an example of code I am using var element = $('#mydiv'); element.crudplugin({ [...] onSetupValidation: function(markup) { var form = $('#myForm', markup); var container = $('<div class="error"><p>Errors were found validating your form. Please correct them and retry.</p><ol></ol></div>') .appendTo(form).hide(); var validator = form.validate({ errorContainer: container, errorLabelContainer: $('ol', container), errorElement: 'em', wrapper: 'li', highlight: function (element) { $(element).addClass("ui-state-error"); }, unhighlight: function (element) { $(element).removeClass("ui-state-error"); }, submitHandler: function (form) { [...] } }); } [...] }); Well. Let's go to the problems 1. If I add the validation rules inside the markup (as class attributes) validation does not work at all. Same behaviour if I add the rules in the `validate()` method 2. Googling around I have found many samples, expecially here on SO, that uses the `.rules('add', rule)` method of the [validation plugin][1] like in the following sample and all these links recommends to call the `validate` method before adding any rule like in the following sample $("#myField", markup).rules("add", { required: true }); But if I use this method when the istruction get executed I get the following error: > SCRIPT5007: Unable to get value of the property 'settings': object is > null or undefined jquery.validate.min.js, line 15 character 257 Any advice? [1]: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
0
[ 2, 7782, 1326, 3547, 27999, 1761, 800, 3726, 3726, 31, 57, 21, 10922, 108, 56, 12733, 1326, 3053, 14, 2502, 16, 21, 487, 8190, 93, 28223, 147, 26, 11498, 43, 1311, 9, 14, 943, 576, 16, 14, 505, 30, 25, 905, 20, 14, 28223, 25, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Publish SBT project to local directory === I am trying to publish some of my SBT projects on my personal webserver. As far as I know you usually export a SBT project as a Maven directory including a POM.xml, that contains the project definitions. As [Brian Clapper pointed out](http://brizzled.clapper.org/blog/2010/05/07/sbt-and-your-own-maven-repository/), you can publish such a Maven repository by creating several configuration files and using `sbt publish`. In his tutorial, the repository is transferred via FTP. I want to push my Maven repository to the server manually so I have more control. Can you give me some hints, how to accomplish this?
0
[ 2, 10824, 13, 18, 220, 38, 669, 20, 375, 16755, 800, 3726, 3726, 31, 589, 749, 20, 10824, 109, 16, 51, 13, 18, 220, 38, 2314, 27, 51, 1319, 2741, 10321, 106, 9, 28, 463, 28, 31, 143, 42, 951, 7487, 21, 13, 18, 220, 38, 669, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
finding the sum of a file of numbers from the command line === when executing on the command line it is supposed to have python3 a4.py apple the file whose numbers i am trying to sum looks exactly like this 4 14 5 this is what i have gathered so far import sys print(sys.argv[1]) fp = open(sys.argv[1]) fileContents = fp.read() fp.close() numbers = fileContents print(numbers) def map(f,items): result = [] for i in range(0,len(items),1): result = result + [f(items[i])] return result a=map(eval,numbers) def sum(num): total = 0 for i in range(0,len(num),1): total = total + i return total print(sum(a))
0
[ 2, 3007, 14, 3907, 16, 21, 3893, 16, 2116, 37, 14, 1202, 293, 800, 3726, 3726, 76, 25836, 27, 14, 1202, 293, 32, 25, 2293, 20, 57, 20059, 240, 21, 300, 9, 6448, 4037, 14, 3893, 1196, 2116, 31, 589, 749, 20, 3907, 1879, 1890, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...