Posts

winforms - Avoid duplicate form loading in c# -

i have 2 windows forms.both form1 , form2 have button. when click button in form1 shows form2 , vice versa. create duplicate form when click button on each time. how avoid it. please tell me. code given below. form1: private void button1_click(object sender, eventargs e) { form2 f2 = new form2(); f2.show(); } form2: private void button1_click(object sender, eventargs e) { form1 f1 = new form1(); f1.show(); } just use method common , pass parameter 'this' when button click public bool formisexist(form frmopen) { formcollection fc = application.openforms; foreach (form frm in fc) { if (frm.name == frmopen.name) { return true; } } return false; }

javascript - How to apply an accordion to submenu -

Image
i developing wordpress site using underscores theme , @ moment, navbar works on big screens picture shows: but find problem in small screens when click on menu item has submenu. not have accordion. how can apply accordion submenu when click on example, sub-menu drop down accordion in way can still see rest of menu? here current css: @media(max-width: 600px){ ul#primary-menu li { width: 100%; } } .menu-main-menu-container { max-width: 1280px; margin: auto; } li#menu-item-65 > a:after { font-family: fontawesome; content: '\f107'; padding-left: 10px; color: #99c71b; } li#menu-item-66 > a:after { font-family: fontawesome; content: '\f107'; padding-left: 10px; color: #99c71b; } .main-navigation { clear: both; display: block; float: left; width: 100%; background-color: #353535; border-bottom: 5px solid #99c71b; } .main-navigation ul { display: none; list-style: none; m...

ruby on rails - Why my data won't save to SQL? -

i'm quite new ruby on rails. i'll playing around it. actually, i'm trying create form title , daterangepick (bootstrap). so, works fine until now. have 1 problem: data don't save in database. everytime submit form creates new record, inserts automatically "created_at" etc. 2 fields "title" , "date" empty every time... don't know fault is. may of can me? pls give me answer explication, cause i'm trying understand whats going on. here code (i'm using simple_form gem) new.html.erb: <%= simple_form_for @event |f| %> <%= f.input_field :title, required: false %> <%= f.input :date, input_html: { class: "daterange" }, required: false %> <%= f.button :submit %> <% end %> <script type="text/javascript"> $(document).ready(function() { $('input[class="string optional daterange"]').daterangepicker( { locale: { ...

jasper reports - How to align total fields in column footer? -

Image
i have created report in jasper ireport. alignment of fields in not appropriate want. i have added date , sms count in detail band , total sms count in column band . when have total sms count in detail band iterate , show multiple time. sms count report image: xml code ... <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="smscount" pagewidth="595" pageheight="842" columnwidth="555" leftmargin="20" rightmargin="20" topmargin="20" bottommargin="20"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> ...

sugarcrm - How to add condition for a field in the layout of SuiteCRM.? -

Image
in in studio have created fields in 1 module , add fields in layout. want display fields according selection, example: if user select option-1 dropdown field has display 3 field, , if user select option-2 dropdown field has display 6 fields. need add condition in layout field. can't find option there.. please me find out. attached example image below. you need modify view definitions add script edit view of module. example: $viewdefs ['<module name>'] = array( '<view name>view' => array( 'templatemeta' => array( ... 'includes' => array( 0 => array( 'file' => 'path/to/your/script.js', ), 1 =...

osx - Packet filter syntax and loopback -

i have tun adapter (os x) looks this: tun11: flags=8851<up,pointopoint,running,simplex,multicast> mtu 1500 inet 10.12.0.2 --> 10.12.0.1 netmask 0xff000000 open (pid 4004) i send udp packet it: echo "lol" | nc -4u 10.12.0.1 8000 and able see tcpdump : ➜ build git:(master) ✗ sudo tcpdump -i tun11 -vv tcpdump: listening on tun11, link-type null (bsd loopback), capture size 262144 bytes 14:39:16.669055 ip (tos 0x0, ttl 64, id 21714, offset 0, flags [none], proto udp (17), length 32) 10.12.0.2.55707 > 10.12.0.1.irdmi: [udp sum ok] udp, length 4 however not see when use capture filter: ➜ build git:(master) ✗ sudo tcpdump -i tun11 udp -vv tcpdump: listening on tun11, link-type null (bsd loopback), capture size 262144 bytes same syntax works fine ethernet adapter: ➜ build git:(master) ✗ sudo tcpdump -i en0 udp -vv tcpdump: listening on en0, link-type en10mb (ethernet), capture size 262144 bytes 14:42:15.010329 ip (tos 0x0, tt...

pyinstaller - Executable file not working (Ubuntu-Python-PyQt-QGIS) -

for can help... issue this: have created python application wish turn cross platform executable 1 file. however, though pyinstaller executed without problem, executable not working. says "failed execute script". have tried both onefile , onedir options. python application's imports these (yes, lot necessary): import os import sqlite3 import sys import easygui sys.path.append("/usr/bin/qgis") sys.path.append("~\.qgis2\python\plugins") pyqt4 import qtcore, qtgui pyqt4.qtcore import * pyqt4.qtgui import * geopy.exc import geocoderserviceerror geopy.geocoders import nominatim sklearn.decomposition import * sklearn.metrics import homogeneity_score, adjusted_rand_score #from pyqt4.qtcore import qt, qfileinfo, qsize pyqt4.qtnetwork import * pyqt4.qsci import * qgis.core import * qgis.gui import * qgis.utils import * pyqt4.qtxml import qdomdocument itertools import product # creating reports reportlab.lib import colors reportlab.lib.enums import ta_cen...