Anonymní profil Sarge – Programujte.com
 x   TIP: Přetáhni ikonu na hlavní panel pro připnutí webu

Anonymní profil Sarge – Programujte.comAnonymní profil Sarge – Programujte.com

 

Příspěvky odeslané z IP adresy 89.103.128.–

› odovzdanie aktualnych stavov…
9. 8. 2012   #161273

Ahojte ucim sa RoR a narazil som sa na problem kedy potrebujem dostat aktualne stavy checkboxov z view to controllera bez pouzitia submit_tag.

Mam napriklad taktu skupinu checkboxov:

= form_tag cars_path, :method => :get do
  Include: 
  - @all_ratings.each do |rating|
    = rating
    = check_box_tag "ratings[#{rating}]"
  = submit_tag 'Refresh'

V controller ziskam zaskrtnute stavy pomocou  

params[:ratings].keys

A chcel by som tieto zaskrnute stavy dostat do controllera ked napriklad kliknem na hlavicku v tabulke:

%th Title

Vedeli by ste niekto poradit ako na to?

.NET › [C#] editovanie .doc dokumen…
2. 6. 2012   #158744

#5 DragonBehemont

J diki. Nakoniec som pouzil Interop kvoli tomu, ze som potreboval pracovat s formatom .doc

.NET › [C#] editacia konfiguracnych…
26. 5. 2012   #158420

Ahojte, mam vytvoreny konfiguracny subor v priecinku bin\Debug\settings.config. Nasledujucimi metodami sa chcem ulozit zmeny v subore:

 Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

 config.Save(ConfigurationSaveMode.Modified);
 ConfigurationManager.RefreshSection("appSettings");
 config.Save();

Zmeny sa v subore neprejavia a hodnoty sa neaktualizuju. Neviete ako by som zmene hodnoty mohol zapisat do konfiguracneho suboru?

.NET › [C#] editovanie .doc dokumen…
26. 5. 2012   #158414

#3 Evzen

Dikes, o tej Open XML SDK som vobec nevedel, vyzera to ako najrozumnejsie riesenie

C / C++ › error C2439: member could no…
1. 4. 2012   #155868

Ahojte, chcel by som sa spytat na tuto chybu, ako by som ju mohol vyriesit

template<class _Other1,
		class _Other2>
		_Pair_base(_Other1&& _Val1, _Other2&& _Val2)
		: first(_STD forward<_Other1>(_Val1)),
			second(_STD forward<_Other2>(_Val2))
		{	
		}

	_Ty1 first;	
	_Ty2 second;	
	};

error C2440: 'initializing' : cannot convert from 'int' to 'const PP_PropertyType 

error C2439: 'std::_Pair_base<_Ty1,_Ty2>::second' : member could not be initialized 

Aj ked si niesom isty ci tento kus kodu staci, za kazdu radu budem vdacnny

XML / XSL(T) › reprezentacia XML do grafu
30. 3. 2012   #155682

Ahojte, chcel by som previest XML do grafickej podoby, skusal som nastroj GraphViz ale nedari sa mi to..

 Ukazka XML suboru:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <EFG>
        <Events>
            <Event>
                <EventId>e2755731202</EventId>
                <Type>SYSTEM INTERACTION</Type>
                <Listeners>Project$W1Listener</Listeners>
            </Event>
            ...
       </Events>
       <EventGraph>
        <Row>
            <E>1</E>
            <E>1</E>
            <E>0</E>
            <E>0</E>
            <E>0</E>
        </Row>
        ...
   </EventGraph>
</EFG>

Chybova hlaska:

Error: <gvedit>:1: syntax error near line 1
context: <?xml version="1.0" encoding="UTF-8" standalone="yes" >>>  ?> <<<

Vedeli by ste niekto poradit ako XML prevediem do grafickej podoby?

Software › GUITAR - gui test framework
25. 3. 2012   #155445

Ahojte, nedari sa mi rozbehat nastroj GUITAR, ktory sluzi na testovanie GUI a sklada sa v podstate zo styrok nastrojov. Prvy je ripper, ktory prebehne zdrojovy kod GUI o ktorom ulozi nejake info. Druhy je gui2efg, ktory tieto info prevedie na subor, z ktoreho sa da vykreslit diagram GUI komponent, potom je tam tc-gen-seq, co je test case generator, ktory vytvori testovacieho priapdy z grafu a posledny je jfc-replayer, ktory vykona testovacie pripady a ulozi vysledky z testov.

http://sourceforge.net/apps/mediawiki/guitar/index.php?title=Main_Page

Ked pustim prvu utilitu cez Cygwin jfc-ripper.sh s pozadovanymi parametrami vyhodi mi to chybu:

java.lang.NoClassDefFoundError: edu/umd/cs/guitar/ripper/JFCRipperMain
Caused by: java.lang.ClassNotFoundException: edu.umd.cs.guitar.ripper.JFCRipperMain
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: edu.umd.cs.guitar.ripper.JFCRipperMain.  Program will exit.

Vedeli by ste niekto poradit co s tym?

undefined
C / C++ › error C2065: undeclared iden…
19. 2. 2012   #153763

#2 vitamin

diki :)

C / C++ › include WDK headers
26. 1. 2012   #152905

Ahojte, nedari sa mi vlozit hlavicky z Windows Driver Kit. Hlavicky vkladam postupne, pricom subory som skopiroval priamo do projektu podla screenu nizsie. Neviete niekto, co robim zle?

Vypise mi to chyby:


Error 1 error C1083: Cannot open include file: 'ntddk.h': No such file or directory c:\users\gajdy\desktop\wfp\wfp\ndis.h 45 1 wfp
2 IntelliSense: expected an identifier c:\users\gajdy\desktop\wfp\wfp\fwptypes.h 275 5
3 IntelliSense: expected a type specifier c:\users\gajdy\desktop\wfp\wfp\fwptypes.h 275 18
4 IntelliSense: unexpected parenthesis after declaration of function "<error>" (malformed parameter list or invalid initializer?) c:\users\gajdy\desktop\wfp\wfp\fwptypes.h 278 4
5 IntelliSense: expected a ';' c:\users\gajdy\desktop\wfp\wfp\fwptypes.h 281 4
6 IntelliSense: expected an identifier c:\users\gajdy\desktop\wfp\wfp\fwptypes.h 345 5
7 IntelliSense: expected a ')' c:\users\gajdy\desktop\wfp\wfp\fwptypes.h 345 49
8 IntelliSense: expected a ';' c:\users\gajdy\desktop\wfp\wfp\fwptypes.h 364 1
9 IntelliSense: expected an identifier c:\users\gajdy\desktop\wfp\wfp\iketypes.h 369 2
10 IntelliSense: expected a ';' c:\users\gajdy\desktop\wfp\wfp\iketypes.h 370 1
11 IntelliSense: identifier "IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS0" is undefined c:\users\gajdy\desktop\wfp\wfp\iketypes.h 418 5
12 IntelliSense: identifier "IKEEXT_IP_VERSION_SPECIFIC_KEYMODULE_STATISTICS0" is undefined c:\users\gajdy\desktop\wfp\wfp\iketypes.h 419 5
13 IntelliSense: identifier "FWP_FILTER_ENUM_TYPE" is undefined c:\users\gajdy\desktop\wfp\wfp\fwpmtypes.h 413 5
14 IntelliSense: cannot open source file "ntddk.h" c:\users\gajdy\desktop\wfp\wfp\ndis.h 45 1
15 IntelliSense: cannot open source file "netevent.h" c:\users\gajdy\desktop\wfp\wfp\ndis.h 145 1
16 IntelliSense: identifier "UNICODE_STRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 164 9
17 IntelliSense: identifier "CM_MCA_POS_DATA" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 483 9
18 IntelliSense: identifier "CM_EISA_SLOT_INFORMATION" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 484 9
19 IntelliSense: identifier "CM_EISA_FUNCTION_INFORMATION" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 485 9
20 IntelliSense: identifier "KIRQL" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 581 5
21 IntelliSense: identifier "KEVENT" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 590 5
22 IntelliSense: identifier "KINTERRUPT_MODE" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 611 9
23 IntelliSense: identifier "Internal" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 680 29
24 IntelliSense: identifier "Isa" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 681 24
25 IntelliSense: identifier "Eisa" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 682 25
26 IntelliSense: identifier "MicroChannel" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 683 24
27 IntelliSense: identifier "TurboChannel" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 684 33
28 IntelliSense: identifier "PCIBus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 685 24
29 IntelliSense: identifier "PCMCIABus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 686 27
30 IntelliSense: identifier "CBus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 687 25
31 IntelliSense: identifier "MPIBus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 688 27
32 IntelliSense: identifier "MPSABus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 689 28
33 IntelliSense: identifier "ProcessorInternal" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 690 38
34 IntelliSense: identifier "InternalPowerBus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 691 37
35 IntelliSense: identifier "PNPISABus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 692 30
36 IntelliSense: identifier "PNPBus" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 693 27
37 IntelliSense: identifier "CM_PARTIAL_RESOURCE_LIST" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 704 9
38 IntelliSense: identifier "MDL" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 773 9
39 IntelliSense: identifier "PHYSICAL_ADDRESS" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 1291 9
40 IntelliSense: identifier "KIRQL" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 1751 5
41 IntelliSense: identifier "MM_PAGE_PRIORITY" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 2637 9
42 IntelliSense: identifier "KTIMER" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 3229 5
43 IntelliSense: identifier "KDPC" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 3230 5
44 IntelliSense: identifier "PDRIVER_DISPATCH" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 4031 5
45 IntelliSense: identifier "PCUNICODE_STRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 4033 5
46 IntelliSense: identifier "PDEVICE_OBJECT" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 4045 9
47 IntelliSense: identifier "PDEVICE_OBJECT" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 4058 9
48 IntelliSense: identifier "PSTRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 6465 25
49 IntelliSense: identifier "PUNICODE_STRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 6611 11
50 IntelliSense: identifier "PUNICODE_STRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 6618 11
51 IntelliSense: identifier "PUNICODE_STRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 6619 11
52 IntelliSense: identifier "PUNICODE_STRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 6620 11
53 IntelliSense: cannot open source file "xfilter.h" c:\users\gajdy\desktop\wfp\wfp\ndis.h 7409 1
54 IntelliSense: identifier "KTIMER" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 8062 5
55 IntelliSense: identifier "KDPC" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 8063 5
56 IntelliSense: identifier "DMA_WIDTH" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 8278 5
57 IntelliSense: identifier "DMA_SPEED" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 8279 5
58 IntelliSense: identifier "KEVENT" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 8290 5
59 IntelliSense: identifier "PDEVICE_OBJECT" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 10074 19
60 IntelliSense: identifier "PDEVICE_OBJECT" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 10075 19
61 IntelliSense: identifier "PDEVICE_OBJECT" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 10076 19
62 IntelliSense: identifier "PCM_RESOURCE_LIST" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 10077 19
63 IntelliSense: identifier "PCM_RESOURCE_LIST" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 10078 19
64 IntelliSense: expected a ';' c:\users\gajdy\desktop\wfp\wfp\ndis.h 11113 51
65 IntelliSense: identifier "UNICODE_STRING" is undefined c:\users\gajdy\desktop\wfp\wfp\ndis.h 11389 14
66 IntelliSense: cannot open source file "ntdef.h" c:\users\gajdy\desktop\wfp\wfp\wdm.h 54 1
67 IntelliSense: cannot open source file "bugcodes.h" c:\users\gajdy\desktop\wfp\wfp\wdm.h 56 1
68 IntelliSense: cannot open source file "ntiologc.h" c:\users\gajdy\desktop\wfp\wfp\wdm.h 57 1
69 IntelliSense: cannot open source file "mce.h" c:\users\gajdy\desktop\wfp\wfp\wdm.h 161 1
70 IntelliSense: this declaration has no storage class or type specifier c:\users\gajdy\desktop\wfp\wfp\wdm.h 8837 1
71 IntelliSense: expected a ';' c:\users\gajdy\desktop\wfp\wfp\wdm.h 8838 1
72 IntelliSense: identifier "TIME_FIELDS" is undefined c:\users\gajdy\desktop\wfp\wfp\wdm.h 9012 9
73 IntelliSense: cannot open source file "dpfilter.h" c:\users\gajdy\desktop\wfp\wfp\wdm.h 9926 1
74 IntelliSense: declaration is incompatible with "LONG __stdcall InterlockedIncrement(volatile LONG *lpAddend)" (declared at line 2286 of "c:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h") c:\users\gajdy\desktop\wfp\wfp\wdm.h 12221 1
75 IntelliSense: declaration is incompatible with "LONG __stdcall InterlockedDecrement(volatile LONG *lpAddend)" (declared at line 2293 of "c:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h") c:\users\gajdy\desktop\wfp\wfp\wdm.h 12228 1
76 IntelliSense: declaration is incompatible with "LONG __stdcall InterlockedExchange(volatile LONG *Target, LONG Value)" (declared at line 2300 of "c:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h") c:\users\gajdy\desktop\wfp\wfp\wdm.h 12235 1
77 IntelliSense: declaration is incompatible with "LONG __stdcall InterlockedExchangeAdd(volatile LONG *Addend, LONG Value)" (declared at line 2311 of "c:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h") c:\users\gajdy\desktop\wfp\wfp\wdm.h 12242 1
78 IntelliSense: declaration is incompatible with "LONG __stdcall InterlockedCompareExchange(volatile LONG *Destination, LONG Exchange, LONG Comperand)" (declared at line 2319 of "c:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winbase.h") c:\users\gajdy\desktop\wfp\wfp\wdm.h 12250 1
79 IntelliSense: expected an identifier c:\users\gajdy\desktop\wfp\wfp\wdm.h 17964 1
80 IntelliSense: expected an identifier c:\users\gajdy\desktop\wfp\wfp\wdm.h 17970 9
81 IntelliSense: identifier "PCALLBACK_FUNCTION" is undefined c:\users\gajdy\desktop\wfp\wfp\wdm.h 17994 10
82 IntelliSense: identifier "NET_BUFFER_LIST" is undefined c:\users\gajdy\desktop\wfp\wfp\wfp.cpp 31 2 wfp
83 IntelliSense: identifier "pNetBufferList" is undefined c:\users\gajdy\desktop\wfp\wfp\wfp.cpp 31 19 wfp

#include "stdafx.h"


#include <Winsock2.h>
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <strsafe.h>
#include "fwpmu.h"
#include "fwptypes.h"
#include "iketypes.h"
#include "ndis.h"
#include "ntdef.h"
#include "wdm.h"
#include "ntddk.h"
#include "bugcodes.h"


int _tmain(int argc, _TCHAR* argv[])
{
	HANDLE m_hEngineHandle;
	DWORD dwFwAPiRetCode = ERROR_BAD_COMMAND;
	IPSEC_STATISTICS0 statistics;

	NET_BUFFER_LIST* pNetBufferList;

...
   
Sarge
C / C++ › Zapis na koniec suboru (Win…
3. 12. 2011   #150825

#2 KIIV

Stacil ten OPEN_ALWAYS, mohlo ma to napadnut.. Diki   

   
Sarge
C / C++ › Zapis na koniec suboru (Win…
3. 12. 2011   #150807

Ahojte, na MSDN som nasiel kus kodu pomocou ktoreho mozem zapisovat text na koniec suboru. Vo funkcii CreateFile je priznak OPEN_EXISTING, cize mi nevie vytvorit textovy subor, ked som to zmenil na CREATE_ALWAYS tak sa vzdy text zapisuje na zaciatok suboru. Vedeli by ste mi poradit ako to prerobit tak aby mi tento kus kodu aj vytvoril textovy subor? Napada ma pred createfile vytvorit este jeden createfile kde bude CREATE_ALWAYS ale to mi nepride ako elegantne riesenie.

#include <windows.h>
#include <tchar.h>
#define FILE_WRITE_TO_END_OF_FILE       0xffffffff

int
_tmain(int argc, _TCHAR* argv[])
{
 HANDLE hFile = ::CreateFile(L"Test.txt",
        GENERIC_WRITE,
        0,
        0,
        OPEN_EXISTING,
        FILE_ATTRIBUTE_NORMAL,
        0);
 if ( hFile == INVALID_HANDLE_VALUE )
  return ::GetLastError();

 OVERLAPPED o;
 ::memset(&o, 0, sizeof(o));

 o.Offset = FILE_WRITE_TO_END_OF_FILE;
 o.OffsetHigh = -1;

 DWORD dwBytesWritten;
 if ( ! ::WriteFile(hFile, "This is a test\r\n", 16, &dwBytesWritten, &o) )
  return ::GetLastError();

 return 0;
}

 

 

Hostujeme u Českého hostingu       ISSN 1801-1586       ⇡ Nahoru Webtea.cz logo © 20032024 Programujte.com
Zasadilo a pěstuje Webtea.cz, šéfredaktor Lukáš Churý