Posts

vb.net - trying to compare a SQL record count and a DataGridView row count -

i trying compare sql record count , datagridview row count ensure returning same info. example, if have 6 records come sql query, want execute try-catch statement compares row count , sql record count make sure display same number of items. tried: sql3.addparam("@plan", cmboplans.selecteditem()) sql3.execquery("select dbo.tagsinplan.[tag number] tagsinplan [plan number] = @plan , [plant] ='" & getplant() & "'") sqlrecordcount = sql3.recordcount dgvtagsinplan.rowcount = dgvcount try dgvcount = sqlrecordcount catch ex exception tagsinplan() end try tagsinplan() sub statement in. want rerun sub if datagridview row count not match sql record count wiki

python - How to properly define a middleware class in Django v1.11? -

i'm working on django (v1.11) project , need provide middleware functionality site. version of django modify old middleware_classes setting described in docs : a new style of middleware introduced use new middleware setting. however, i can't understand how new middleware works . after reading middleware's documentation come following conclusion: class foomiddleware(object): def __init__(self, get_response): self.get_response = get_response def __call__(self, request): return self.get_response(request) def process_template_response(self, request, response): # here return response i thought it'll work, unfortunately code above doesn't work , ignored django ( without error! ). when following: class foomiddleware(object): def process_template_response(self, request, response): # here return response ...an error occured (because __init__ method of object class has no arg...

python - Regex named groups in R -

for intents , purposes, python user , use pandas library on daily basis. named capture groups in regex extremely useful. so, example, relatively trivial extract occurrences of specific words or phrases , produce concatenated strings of results in new columns of dataframe. example of how might achieved given below: import numpy np import pandas pd import re mydf = pd.dataframe(['here text', 'we love text', 'where txt or txt textfile', 'words , words', 'just few works', 'see text', 'both words , text'],columns=['origtext']) print("original dataframe\n------------------") print(mydf) # define regex find occurrences of 'text' or 'word' separate named groups myregex = """(?p<textocc>t[e]?xt)|(?p<wordocc>word)""" mycompiledregex ...

latex - TikZ: plotting data file with missing values -

Image
i have data: data2 missing third point. thought, i'd define 2 different x columns , assign data2 x2. problem: third point of data1 goes 3 in compiled graphic. if have different , more values, points start go anywhere, not belong. that code i've used: \addplot[only marks, mark = diamond, color = orange, mark size = 3pt] table[x=x1, y=data1]{example.dat}; \addlegendentry{data1}; \addplot[only marks, mark = square, color = gray, mark size = 3pt] table[x=x2, y=data2]{example.dat}; \addlegendentry{data2}; \addplot[only marks, mark = o, color = blue, mark size = 3pt] table[x=x1, y=data3]{example.dat}; \addlegendentry{data3}; and graph get: thanks lot! btw. in real data 1 data set missing x/y value in middle of data. hope doesn't matter compared example. pgfplots interpreting 2 tabs single separator. thus, sees data file as: x1 x2 data1 data2 data3 0 0 1 2 3 1 1 1 2 3 2 1 3 solution 1. can replace empty cells na...

RHEL 7 installing tkinter with python 2.7 -

i've disabled subscription manager , registered few repos, epel , remi , unable install tkinter . keep getting error no package available. package available python 3.4 . wondering whether else had run issue. not sure how resolve there's not lot of documentation on rhel website. i've tried installing tcl/tk , yum can't seem find these packages either. 1 package tcl in it fails because of dependency problems. no luck yum groupinstall -y "development tools" either. i'm trying install pyautogui requires tkinter installed already. the tkinter package in rhel-7-server-optional-rpms repo, though don't see pyautogui available in rhel. your mileage may vary on whether tkinter @ right version needed. wiki

How to manage files in edit mode ASP.NET MVC Entity Framework? -

i working on asp.net mvc web application uses entity framework. here model class: public partial class complaint { public int complaintid { get; set; } public string reference { get; set; } public string clientname { get; set; } public string accountno { get; set; } public nullable<system.datetime> datecomplaint { get; set; } public nullable<decimal> value { get; set; } public nullable<int> typeid { get; set; } public string comment { get; set; } public nullable<int> statusid { get; set; } public nullable<system.guid> insertedby { get; set; } public nullable<system.datetime> createddatetime { get; set; } public nullable<system.datetime> modifieddatetime { get; set; } public virtual icollection<fileattach> fileattaches { get; set; } } controller method: [authorize] [authorizeroles("admin", "oficial")] public actionresult requestapproval(int? i...

javascript - Change Jquery variables to PHP -

i need put javascript variable php variable, dont know how that. possible answers appreciatable. <script type="text/javascript"> $(document).ready(function(){ $('#number_of_inwards,#number_of_outwards').each(function(){ var product_name,total_stock; $('#product_name').change(function(){ product_id = $('#product_name').val(); }); var hello = "13"; <?php $d = '<script>hello</script>' ?> total_stock = <?php echo $st[$d]; ?>; console.log(total_stock); $(this).focusout(function(){ var inward = parseint($('#number_of_inwards').val()); var outward = parseint($('#number_of_outwards').val()); $('#overall_stock').val(parseint(inward+outward)); console.log("insi...